starmath/source/mathmlexport.cxx |    9 +++++++--
 starmath/source/parse.cxx        |    2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 75032fde426c781aea0af24eb9b9f6432a6bc9bb
Author: Frédéric Wang <fred.w...@free.fr>
Date:   Thu Jul 4 10:57:35 2013 +0200

     fdo#66575 - MathML export: fix errors with newline, binom and stack.
    
    Change-Id: I6c66864381a6a5b7415e9fae682e50865b3f76db
    Reviewed-on: https://gerrit.libreoffice.org/4712
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 12f7f5a..2c9474e 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -868,8 +868,13 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int 
nLevel)
     //no subnodes, the newline is superfulous so we just drop
     //the last node, inclusion would create a bad MathML
     //table
-    if (nSize >= 1 && pNode->GetSubNode(nSize-1)->GetNumSubNodes() == 0)
-        --nSize;
+    if (nSize >= 1)
+    {
+        const SmNode *pLine = pNode->GetSubNode(nSize-1);
+        if (pLine->GetType() == NLINE && pLine->GetNumSubNodes() > 0 &&
+            pLine->GetSubNode(0)->GetToken().eType == TEND)
+            --nSize;
+    }
 
     // try to avoid creating a mtable element when the formula consists only
     // of a single output line
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 5929447..e532591 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1072,7 +1072,7 @@ void SmParser::Line()
     //this is to avoid a formula tree without any caret
     //positions, in visual formula editor.
     if(ExpressionArray.empty())
-        ExpressionArray.push_back(new SmExpressionNode(SmToken()));
+        ExpressionArray.push_back(new SmExpressionNode(m_aCurToken));
 
     SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
     pSNode->SetSubNodes(ExpressionArray);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to