starmath/qa/extras/mmlexport-test.cxx |   41 +++++++++++++++++++---------------
 starmath/source/smmod.cxx             |    2 -
 2 files changed, 25 insertions(+), 18 deletions(-)

New commits:
commit 75d256929387eb8258439808e830b73abcdf2d8b
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Sun Nov 19 15:24:11 2023 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Sun Nov 19 20:37:13 2023 +0100

    Extended loplugin:ostr: starmath
    
    Change-Id: I24ab27d0f92d2d5d10ca2694138d7964ae947b62
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159676
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/starmath/qa/extras/mmlexport-test.cxx 
b/starmath/qa/extras/mmlexport-test.cxx
index 98607dbec3f2..402df43130d5 100644
--- a/starmath/qa/extras/mmlexport-test.cxx
+++ b/starmath/qa/extras/mmlexport-test.cxx
@@ -62,8 +62,8 @@ void MathMLExportTest::testBlank()
     save("MathML XML (Math)");
     xmlDocUniquePtr pDoc = parseXml(maTempFile);
     CPPUNIT_ASSERT(pDoc);
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]", "width", 
"0.5em");
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[2]", "width", 
"4em");
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]"_ostr, 
"width"_ostr, "0.5em");
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[2]"_ostr, 
"width"_ostr, "4em");
 }
 
 void MathMLExportTest::testTdf97049()
@@ -75,8 +75,8 @@ void MathMLExportTest::testTdf97049()
     save("MathML XML (Math)");
     xmlDocUniquePtr pDoc = parseXml(maTempFile);
     CPPUNIT_ASSERT(pDoc);
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]", "stretchy", 
"true");
-    auto aContent = getXPathContent(pDoc, 
"/m:math/m:semantics/m:mrow/m:mo[1]");
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"_ostr, 
"stretchy"_ostr, "true");
+    auto aContent = getXPathContent(pDoc, 
"/m:math/m:semantics/m:mrow/m:mo[1]"_ostr);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aContent.getLength());
     CPPUNIT_ASSERT_EQUAL(u'\x222B', aContent[0]);
 }
@@ -89,19 +89,23 @@ void MathMLExportTest::checkMathVariant(SmDocShell& 
rDocShell, bool bCapital, bo
     xmlDocUniquePtr pDoc = parseXml(maTempFile);
     CPPUNIT_ASSERT(pDoc);
     if (bCapital)
-        assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]", 
"mathvariant");
+        assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mi[1]"_ostr, "mathvariant"_ostr);
     else
-        assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]", "mathvariant", 
"normal");
-    assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mstyle[1]/m:mi[1]", "mathvariant");
-    assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[2]", 
"mathvariant");
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[2]/m:mi[1]", 
"mathvariant", "normal");
+        assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]"_ostr, 
"mathvariant"_ostr, "normal");
+    assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mstyle[1]/m:mi[1]"_ostr,
+                           "mathvariant"_ostr);
+    assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[2]"_ostr, 
"mathvariant"_ostr);
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[2]/m:mi[1]"_ostr, 
"mathvariant"_ostr,
+                "normal");
     if (bSmall)
-        assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]", 
"mathvariant");
+        assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mi[3]"_ostr, "mathvariant"_ostr);
     else
-        assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]", "mathvariant", 
"normal");
-    assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mstyle[3]/m:mi[1]", "mathvariant");
-    assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[4]", 
"mathvariant");
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[4]/m:mi[1]", 
"mathvariant", "normal");
+        assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]"_ostr, 
"mathvariant"_ostr, "normal");
+    assertXPathNoAttribute(pDoc, 
"/m:math/m:semantics/m:mrow/m:mstyle[3]/m:mi[1]"_ostr,
+                           "mathvariant"_ostr);
+    assertXPathNoAttribute(pDoc, "/m:math/m:semantics/m:mrow/m:mi[4]"_ostr, 
"mathvariant"_ostr);
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mstyle[4]/m:mi[1]"_ostr, 
"mathvariant"_ostr,
+                "normal");
     rDocShell.SetText("");
 }
 
@@ -130,8 +134,10 @@ void MathMLExportTest::testMaj()
     save("MathML XML (Math)");
     xmlDocUniquePtr pDoc = parseXml(maTempFile);
     CPPUNIT_ASSERT(pDoc);
-    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", 
"stretchy", "false");
-    assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", 
u"\U0001EEF0"_ustr);
+    assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr, 
"stretchy"_ostr,
+                "false");
+    assertXPathContent(pDoc, 
"/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr,
+                       u"\U0001EEF0"_ustr);
 }
 
 void MathMLExportTest::testHadd()
@@ -143,7 +149,8 @@ void MathMLExportTest::testHadd()
     save("MathML XML (Math)");
     xmlDocUniquePtr pDoc = parseXml(maTempFile);
     CPPUNIT_ASSERT(pDoc);
-    assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", 
u"\U0001EEF1"_ustr);
+    assertXPathContent(pDoc, 
"/m:math/m:semantics/m:mrow/m:munderover/m:mi"_ostr,
+                       u"\U0001EEF1"_ustr);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(MathMLExportTest);
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index d116316798f7..0ffb6035c100 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -118,7 +118,7 @@ void SmModule::InitInterface_Impl()
 }
 
 SmModule::SmModule(SfxObjectFactory* pObjFact)
-    : SfxModule("sm", {pObjFact})
+    : SfxModule("sm"_ostr, {pObjFact})
 {
     SetName("StarMath");
 

Reply via email to