diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-01-03 05:10:31 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2017-01-04 02:05:24 +0000 |
commit | d3c1a84d4c0bc24defcc497587fa6f258aa8ebdd (patch) | |
tree | c728250605b622fa29de11f5f8c52ac07b49679c /starmath | |
parent | 9fb55f7b1de8be1c3f86a4ae540f648574d3ed45 (diff) |
starmath: Reenable a test case for SmNodeToTextVisitor
by fixing a regression which seems introduced at
4f294a90877d2f91bb88c7d6cd5b74e8e546a025.
Change-Id: If47f7528f5b5fd04432da134f345d69c25a1ca77
Reviewed-on: https://gerrit.libreoffice.org/32665
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/qa/cppunit/test_nodetotextvisitors.cxx | 2 | ||||
-rw-r--r-- | starmath/source/visitors.cxx | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index c3c17f96cb7a..e2575c025db7 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -228,7 +228,7 @@ void Test::SimpleOperators() parseandparseagain("coprod{a}", "Coproduct"); parseandparseagain("int from {r_0} to {r_t} a", "Upper and lower bounds shown with integral (from & to)"); ParseAndCheck("int csup {r_0} csub {r_t} a", "int csup { r _ 0 } csub { r _ t } a ", "Upper and lower bounds shown with integral (csub & csup)"); -//FIXME ParseAndCheck("sum csup { size 8 { x - 1 } } csub { size 8 a } b ", "sum csup { size 8 { x - 1 } } csub { size 8 a } b ", "Sum with sized upper and lower bounds"); + ParseAndCheck("sum csup { size 8 { x - 1 } } csub { size 8 a } b ", "sum csup { size 8 { x - 1 } } csub { size 8 a } b ", "Sum with sized upper and lower bounds"); parseandparseagain("int{a}", "Integral"); parseandparseagain("intd_{1}^{2}{x dx}", "Dynamically-sized integral"); parseandparseagain("iint{a}", "Double integral"); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 90ce467c6d79..e6d393567133 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -2189,16 +2189,22 @@ void SmNodeToTextVisitor::Visit( SmUnHorNode* pNode ) void SmNodeToTextVisitor::Visit( SmBinHorNode* pNode ) { + const SmNode *pParent = pNode->GetParent(); + bool bBraceNeeded = pParent && pParent->GetType() == NFONT; SmNode *pLeft = pNode->LeftOperand(), *pOper = pNode->Symbol(), *pRight = pNode->RightOperand(); Separate( ); + if (bBraceNeeded) + Append( "{ " ); pLeft->Accept( this ); Separate( ); pOper->Accept( this ); Separate( ); pRight->Accept( this ); Separate( ); + if (bBraceNeeded) + Append( "} " ); } void SmNodeToTextVisitor::Visit( SmBinVerNode* pNode ) |