starmath/qa/extras/mmlimport-test.cxx |   18 ++++++++++--------
 starmath/source/visitors.cxx          |    4 ++--
 uitest/math_tests/tdf128610.py        |    2 +-
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit ac0e3e11d14d31b66e0f9a08f96d0233ec55951d
Author:     DowwdyJ <joeldowd...@gmail.com>
AuthorDate: Thu Feb 16 04:27:40 2023 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Feb 21 12:11:06 2023 +0000

    tdf#152850: Fix bad scoping of MathML frac command
    
    Change-Id: I4f5d0290e522fa6f3faccd26f74540abf848629b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147153
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/starmath/qa/extras/mmlimport-test.cxx 
b/starmath/qa/extras/mmlimport-test.cxx
index 0f80f375acea..d6411f8ff406 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -160,17 +160,19 @@ void Test::testtdf99556()
 void Test::testTdf103430()
 {
     
loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/tdf103430.mml"));
-    CPPUNIT_ASSERT_EQUAL(OUString("frac { { nitalic d ^ 2 nitalic color blue y 
} } { { color dvip "
-                                  "apricot nitalic d font sans bold italic 
color red x } }"),
-                         mxDocShell->GetText());
+    CPPUNIT_ASSERT_EQUAL(
+        OUString("{ frac { { nitalic d ^ 2 nitalic color blue y } } { { color 
dvip "
+                 "apricot nitalic d font sans bold italic color red x } } }"),
+        mxDocShell->GetText());
 }
 
 void Test::testTdf103500()
 {
     
loadURL(m_directories.getURLFromSrc(u"starmath/qa/extras/data/tdf103500.mml"));
-    CPPUNIT_ASSERT_EQUAL(OUString("{ { int csup b csub a { frac { 1 } { x } ` 
nitalic d x } } = { "
-                                  "intd csup b csub a { frac { 1 } { y } ` 
nitalic d y } } }"),
-                         mxDocShell->GetText());
+    CPPUNIT_ASSERT_EQUAL(
+        OUString("{ { int csup b csub a { { frac { 1 } { x } } ` nitalic d x } 
} = { "
+                 "intd csup b csub a { { frac { 1 } { y } } ` nitalic d y } } 
}"),
+        mxDocShell->GetText());
 }
 
 void Test::testTdf137008()
@@ -200,8 +202,8 @@ void Test::testMathmlEntities()
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
-}
+} // namespace
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 6efe9936b948..42257925d38e 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -2305,11 +2305,11 @@ void SmNodeToTextVisitor::Visit( SmBinVerNode* pNode )
     } else{
         SmNode *pNum    = pNode->GetSubNode( 0 ),
                *pDenom  = pNode->GetSubNode( 2 );
-        Append(u"frac {");
+        Append(u"{ frac {");
         LineToText( pNum );
         Append(u"} {");
         LineToText( pDenom );
-        Append(u"}");
+        Append(u"} }");
     }
 }
 
diff --git a/uitest/math_tests/tdf128610.py b/uitest/math_tests/tdf128610.py
index 4fdd9c2dbc52..29b7d5ac4564 100644
--- a/uitest/math_tests/tdf128610.py
+++ b/uitest/math_tests/tdf128610.py
@@ -27,6 +27,6 @@ class Tdf128610(UITestCase):
 
             # Without the fix in place, this test would have failed with
             # AssertionError: '{ f _ c = frac { 1 } { K _ m } }' != ''
-            self.assertEqual("{ f _ c = frac { 1 } { K _ m } }", 
get_state_as_dict(xEditView)["Text"])
+            self.assertEqual("{ f _ c = { frac { 1 } { K _ m } } }", 
get_state_as_dict(xEditView)["Text"])
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to