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