diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl index d9de0e9ba322..e83195c50cda 100644 --- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl +++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl @@ -2949,9 +2949,7 @@ --> - - - + @@ -2966,6 +2964,12 @@ - + + + + + + + diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index fb1e6c365130..fbc1e9747832 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -599,6 +599,22 @@ sal_uInt32 SmXMLExport::exportDoc(enum XMLTokenEnum eClass) void SmXMLExport::_ExportContent() { + uno::Reference xModel = GetModel(); + uno::Reference xTunnel; + xTunnel = uno::Reference (xModel,uno::UNO_QUERY); + SmModel *pModel = reinterpret_cast + (xTunnel->getSomething(SmModel::getUnoTunnelId())); + SmDocShell *pDocShell = pModel ? + static_cast(pModel->GetObjectShell()) : 0; + OSL_ENSURE( pDocShell, "doc shell missing" ); + + if (pDocShell && !pDocShell->GetFormat().IsTextmode()) + { + // If the Math equation is not in text mode, we attach a display="block" + // attribute on the root. We don't do anything if it is in + // text mode, the default display="inline" value will be used. + AddAttribute(XML_NAMESPACE_MATH, XML_DISPLAY, XML_BLOCK); + } SvXMLElementExport aEquation(*this, XML_NAMESPACE_MATH, XML_MATH, sal_True, sal_True); SvXMLElementExport *pSemantics=0; @@ -613,14 +629,6 @@ void SmXMLExport::_ExportContent() if (aText.Len()) { // Convert symbol names - uno::Reference xModel = GetModel(); - uno::Reference xTunnel; - xTunnel = uno::Reference (xModel,uno::UNO_QUERY); - SmModel *pModel = reinterpret_cast - (xTunnel->getSomething(SmModel::getUnoTunnelId())); - SmDocShell *pDocShell = pModel ? - static_cast(pModel->GetObjectShell()) : 0; - OSL_ENSURE( pDocShell, "doc shell missing" ); if (pDocShell) { SmParser &rParser = pDocShell->GetParser();