summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-07-21 12:37:19 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-07-21 12:52:57 +0400
commitcb4c69121a7ca4db4748a78a16d87aaadb3aa9fa (patch)
treecff5968361de87f1e6f34bd0173b210bf2714679
parent5a14b6bb09bd054589deec1a58d96fe5fc562f0c (diff)
fdo#38887: SmNodeToTextVisitor: use braces for nested scripts
Though it is unclear why everything is wrapped into SmExpressionNode. But still it is so, the patch will work. Change-Id: Ib62f1a148c737ad110f659f73181ed51e02b8594
-rw-r--r--starmath/source/visitors.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 2722e4e045c7..9c279702d057 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -2504,6 +2504,12 @@ void SmNodeToTextVisitor::Visit( SmLineNode* pNode )
void SmNodeToTextVisitor::Visit( SmExpressionNode* pNode )
{
bool bracketsNeeded = pNode->GetNumSubNodes() != 1 || pNode->GetSubNode(0)->GetType() == NBINHOR;
+ // nested subsups
+ bracketsNeeded |=
+ pNode->GetParent()->GetType() == NSUBSUP &&
+ pNode->GetNumSubNodes() == 1 &&
+ pNode->GetSubNode(0)->GetType() == NSUBSUP;
+
if (bracketsNeeded) {
Append( "{ " );
}