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:
committed by
Caolán McNamara
parent
5795edb20e
commit
75032fde42
@@ -868,8 +868,13 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
|
|||||||
//no subnodes, the newline is superfulous so we just drop
|
//no subnodes, the newline is superfulous so we just drop
|
||||||
//the last node, inclusion would create a bad MathML
|
//the last node, inclusion would create a bad MathML
|
||||||
//table
|
//table
|
||||||
if (nSize >= 1 && pNode->GetSubNode(nSize-1)->GetNumSubNodes() == 0)
|
if (nSize >= 1)
|
||||||
--nSize;
|
{
|
||||||
|
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
|
// try to avoid creating a mtable element when the formula consists only
|
||||||
// of a single output line
|
// of a single output line
|
||||||
|
@@ -1072,7 +1072,7 @@ void SmParser::Line()
|
|||||||
//this is to avoid a formula tree without any caret
|
//this is to avoid a formula tree without any caret
|
||||||
//positions, in visual formula editor.
|
//positions, in visual formula editor.
|
||||||
if(ExpressionArray.empty())
|
if(ExpressionArray.empty())
|
||||||
ExpressionArray.push_back(new SmExpressionNode(SmToken()));
|
ExpressionArray.push_back(new SmExpressionNode(m_aCurToken));
|
||||||
|
|
||||||
SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
|
SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
|
||||||
pSNode->SetSubNodes(ExpressionArray);
|
pSNode->SetSubNodes(ExpressionArray);
|
||||||
|
Reference in New Issue
Block a user