https://issues.apache.org/ooo/show_bug.cgi?id=124636

--- Comment #10 from Armin Le Grand <[email protected]> ---
The following code instead of the existing in starmath/source/smdetect.cxx:329
makes the detector more careful and works (checked with a content.xml from a
StarMath file), but can be polished some more:

                        const sal_uInt16 nSize = 400;
                        sal_Char aBuffer[nSize+1];
                        aBuffer[nSize] = 0;
                        pStrm->Seek( STREAM_SEEK_TO_BEGIN );
                        const sal_uLong nBytesRead = pStrm->Read( aBuffer,
nSize );

                        if(nBytesRead >= 5
                            && 0 == strncmp( "<?xml", aBuffer, 5)
                            && strstr(aBuffer, "<math"))
                        {
                            static const sal_Char sFltrNm_2[] = MATHML_XML;
                            static const sal_Char sTypeNm_2[] =
"math_MathML_XML_Math";
                            aFilterName.AssignAscii( sFltrNm_2 );
                            aTypeName.AssignAscii( sTypeNm_2 );
                        }

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

Reply via email to