diff options
author | Frédéric Wang <fred.wang@free.fr> | 2013-06-25 22:33:13 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-06-28 09:52:55 +0000 |
commit | 4f294a90877d2f91bb88c7d6cd5b74e8e546a025 (patch) | |
tree | a127136041d85090122e24fdf3332dd2a2339026 /starmath/source/parse.cxx | |
parent | 16a0d06f900027401716ddaba25e5c8998562b2d (diff) |
fdo#66081 - reduce the number of nested <mrow>'s in MathML
Change-Id: I768db4719119e53961c9cfa6a864daad7f1f7873
Reviewed-on: https://gerrit.libreoffice.org/4520
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'starmath/source/parse.cxx')
-rw-r--r-- | starmath/source/parse.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index cc35a6698775..cdb6865db623 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -1108,10 +1108,18 @@ void SmParser::Expression() RelationArray[n - 1] = lcl_popOrZero(m_aNodeStack); } - SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken); - pSNode->SetSubNodes(RelationArray); - pSNode->SetUseExtraSpaces(bUseExtraSpaces); - m_aNodeStack.push(pSNode); + if (n > 1) + { + SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken); + pSNode->SetSubNodes(RelationArray); + pSNode->SetUseExtraSpaces(bUseExtraSpaces); + m_aNodeStack.push(pSNode); + } + else + { + // This expression has only one node so just push this node. + m_aNodeStack.push(RelationArray[0]); + } } |