summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
Diffstat (limited to 'starmath')
-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( "{ " );
}