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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Frédéric Wang
2013-07-04 10:57:35 +02:00
committed by Caolán McNamara
parent 5795edb20e
commit 75032fde42
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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);