summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorFrédéric Wang <fred.wang@free.fr>2013-06-28 17:07:11 +0200
committerBosdonnat Cedric <cedric.bosdonnat@free.fr>2013-07-01 13:41:35 +0000
commit1ef63d0842dab4154c5ca2fc42e416950bd7459a (patch)
treeed4f883b134f3ae0cc708a843adfba24e3311727 /starmath
parenta70d429b96be02f0aa407216ab91edbe7883c7c7 (diff)
fdo#66278 - MathML export: distinguish inline/display equations.
Change-Id: Ia764c2fd64ab772342ce86f67ee290ab38dc4a83 Reviewed-on: https://gerrit.libreoffice.org/4607 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathmlexport.cxx24
1 files changed, 16 insertions, 8 deletions
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 <frame::XModel> xModel = GetModel();
+ uno::Reference <lang::XUnoTunnel> xTunnel;
+ xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
+ SmModel *pModel = reinterpret_cast<SmModel *>
+ (xTunnel->getSomething(SmModel::getUnoTunnelId()));
+ SmDocShell *pDocShell = pModel ?
+ static_cast<SmDocShell*>(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 <math> 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 <frame::XModel> xModel = GetModel();
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
- SmDocShell *pDocShell = pModel ?
- static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0;
- OSL_ENSURE( pDocShell, "doc shell missing" );
if (pDocShell)
{
SmParser &rParser = pDocShell->GetParser();