summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorFrédéric Wang <fred.wang@free.fr>2013-07-04 20:21:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-04 20:21:55 +0100
commit5d63514c6eddcd61a319c994202c7689f60ebf0a (patch)
tree7db8a47a6cf2b54af29649ee729824811bb1b6b8 /starmath/source
parent2429a89cf354c1af992a0ed5afad0b326b9d634a (diff)
fdo#66575 - MathML export: fix errors with newline, binom and stack.
Change-Id: I6833140aaf3fcfc47b81f7d324af88843de00834
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/mathmlexport.cxx4
-rw-r--r--starmath/source/parse.cxx6
2 files changed, 7 insertions, 3 deletions
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 2c9474e37755..b35753fe4156 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -871,8 +871,8 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
if (nSize >= 1)
{
const SmNode *pLine = pNode->GetSubNode(nSize-1);
- if (pLine->GetType() == NLINE && pLine->GetNumSubNodes() > 0 &&
- pLine->GetSubNode(0)->GetToken().eType == TEND)
+ if (pLine->GetType() == NLINE && pLine->GetNumSubNodes() == 1 &&
+ pLine->GetSubNode(0)->GetToken().eType == TNEWLINE)
--nSize;
}
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index e5325919f125..aa3a66f09d6e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1072,7 +1072,11 @@ 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(m_aCurToken));
+ {
+ SmToken aTok = SmToken();
+ aTok.eType = TNEWLINE;
+ ExpressionArray.push_back(new SmExpressionNode(aTok));
+ }
SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
pSNode->SetSubNodes(ExpressionArray);