22#include <com/sun/star/io/XInputStream.hpp>
23#include <com/sun/star/ucb/ContentCreationException.hpp>
24#include <com/sun/star/uno/XComponentContext.hpp>
51 uno::Reference< io::XInputStream > xInStream ( aMediaDesc[MediaDescriptor::PROP_INPUTSTREAM], uno::UNO_QUERY );
52 if ( !xInStream.is() )
60 if ( !pInStrm || pInStrm->
GetError() )
71 bool bStorageOk =
false;
75 bStorageOk = !aStorage->GetError();
78 if ( aStorage->IsStream(
"Equation Native") )
82 return "math_MathType_3x";
86 catch (
const css::ucb::ContentCreationException &)
96 static const sal_uInt16 nBufferSize = 200;
104 bool bIsMathType =
false;
105 if (0 == strncmp(
"<?xml",
aBuffer, 5))
106 bIsMathType = (strstr(
aBuffer,
"<math>" ) ||
108 strstr(
aBuffer,
"<math:math " ));
111 bIsMathType = (0 == strncmp(
"<math ",
aBuffer, 6) ||
112 0 == strncmp(
"<math> ",
aBuffer, 7) ||
113 0 == strncmp(
"<math:math> ",
aBuffer, 12));
116 return "math_MathML_XML_Math";
126 return "com.sun.star.comp.math.FormatDetector";
138 return {
"com.sun.star.frame.ExtendedTypeDetection" };
141extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
143 uno::Sequence<uno::Any>
const& )
constexpr OUStringLiteral sServiceName
void setStreamToLoadFrom(const css::uno::Reference< css::io::XInputStream > &xInputStream, bool bIsReadOnly)
void UseInteractionHandler(bool)
virtual OUString SAL_CALL detect(css::uno::Sequence< css::beans::PropertyValue > &lDescriptor) override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
virtual OUString SAL_CALL getImplementationName() override
virtual ~SmFilterDetect() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void StartReadingUnicodeText(rtl_TextEncoding eReadBomCharSet)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 remainingSize()
#define TOOLS_WARN_EXCEPTION(area, stream)
bool GetMathTypeVersion(SotStorage *pStor, sal_uInt8 &nVersion)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT uno::XInterface * math_FormatDetector_get_implementation(uno::XComponentContext *, uno::Sequence< uno::Any > const &)
#define STREAM_SEEK_TO_BEGIN
std::unique_ptr< char[]> aBuffer