From cb4c69121a7ca4db4748a78a16d87aaadb3aa9fa Mon Sep 17 00:00:00 2001 From: Ivan Timofeev Date: Sat, 21 Jul 2012 12:37:19 +0400 Subject: 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 --- starmath/source/visitors.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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( "{ " ); } -- cgit