starmath/inc/node.hxx | 2 starmath/qa/cppunit/test_cursor.cxx | 16 starmath/qa/cppunit/test_import.cxx | 2 starmath/qa/cppunit/test_node.cxx | 32 starmath/qa/cppunit/test_nodetotextvisitors.cxx | 24 starmath/qa/cppunit/test_parse.cxx | 10 starmath/qa/cppunit/test_starmath.cxx | 52 - starmath/qa/extras/mmlexport-test.cxx | 50 - starmath/qa/extras/mmlimport-test.cxx | 70 - starmath/source/SmElementsPanel.cxx | 8 starmath/source/SmPanelFactory.cxx | 26 starmath/source/SmPropertiesPanel.cxx | 16 starmath/source/accessibility.cxx | 10 starmath/source/cfgitem.cxx | 142 +-- starmath/source/cursor.cxx | 22 starmath/source/dialog.cxx | 198 ++-- starmath/source/document.cxx | 8 starmath/source/edit.cxx | 6 starmath/source/eqnolefilehdr.cxx | 2 starmath/source/mathml/export.cxx | 82 +- starmath/source/mathml/import.cxx | 16 starmath/source/mathml/mathmlexport.cxx | 20 starmath/source/mathml/mathmlimport.cxx | 32 starmath/source/mathml/starmathdatabase.cxx | 974 ++++++++++++------------ starmath/source/mathtype.cxx | 10 starmath/source/node.cxx | 4 starmath/source/ooxmlimport.cxx | 8 starmath/source/parse5.cxx | 28 starmath/source/smdetect.cxx | 10 starmath/source/smdll.cxx | 2 starmath/source/smediteng.cxx | 4 starmath/source/smmod.cxx | 2 starmath/source/symbol.cxx | 4 starmath/source/unofilter.cxx | 9 starmath/source/unomodel.cxx | 184 ++-- starmath/source/view.cxx | 20 36 files changed, 1060 insertions(+), 1045 deletions(-)
New commits: commit b56ca52cef77d4d1f99bc3edd89b2557e5cb2cfb Author: Noel Grandin <[email protected]> AuthorDate: Mon May 13 15:16:59 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue May 14 10:13:45 2024 +0200 loplugin:ostr in starmath Change-Id: Ied15eb71ae3ae2d80ba839a6c99ea3cf620ca52f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167598 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index b637fea76d6a..f59c23ea426f 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -1055,7 +1055,7 @@ class SmPlaceNode final : public SmMathSymbolNode public: explicit SmPlaceNode(const SmToken &rNodeToken) : SmMathSymbolNode(SmNodeType::Place, rNodeToken) { } - SmPlaceNode() : SmMathSymbolNode(SmNodeType::Place, SmToken(TPLACE, MS_PLACE, "<?>")) { }; + SmPlaceNode() : SmMathSymbolNode(SmNodeType::Place, SmToken(TPLACE, MS_PLACE, u"<?>"_ustr)) { }; /** * Prepare preliminary settings about font and text diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 89d4e6fe9a8e..ee442b75f067 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -70,7 +70,7 @@ void Test::tearDown() void Test::testCopyPaste() { - auto xTree = SmParser5().Parse("a * b + c"); + auto xTree = SmParser5().Parse(u"a * b + c"_ustr); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); SmCursor aCursor(xTree.get(), xDocShRef.get()); @@ -88,13 +88,13 @@ void Test::testCopyPaste() aCursor.Paste(); #ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason - CPPUNIT_ASSERT_EQUAL(OUString("{ { a * b } + { c * b } }"), xDocShRef->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ { a * b } + { c * b } }"_ustr, xDocShRef->GetText()); #endif } void Test::testCopySelectPaste() { - auto xTree = SmParser5().Parse("a * b + c"); + auto xTree = SmParser5().Parse(u"a * b + c"_ustr); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); SmCursor aCursor(xTree.get(), xDocShRef.get()); @@ -116,13 +116,13 @@ void Test::testCopySelectPaste() aCursor.Paste(); #ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason - CPPUNIT_ASSERT_EQUAL(OUString("{ { b + { c * b } } + c }"), xDocShRef->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ { b + { c * b } } + c }"_ustr, xDocShRef->GetText()); #endif } void Test::testCutPaste() { - auto xTree = SmParser5().Parse("a * b + c"); + auto xTree = SmParser5().Parse(u"a * b + c"_ustr); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); SmCursor aCursor(xTree.get(), xDocShRef.get()); @@ -140,13 +140,13 @@ void Test::testCutPaste() aCursor.Paste(); #ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason - CPPUNIT_ASSERT_EQUAL(OUString("{ a + { c * b } }"), xDocShRef->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ a + { c * b } }"_ustr, xDocShRef->GetText()); #endif } void Test::testCutSelectPaste() { - auto xTree = SmParser5().Parse("a * b + c"); + auto xTree = SmParser5().Parse(u"a * b + c"_ustr); xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); SmCursor aCursor(xTree.get(), xDocShRef.get()); @@ -168,7 +168,7 @@ void Test::testCutSelectPaste() aCursor.Paste(); #ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason - CPPUNIT_ASSERT_EQUAL(OUString("{ b + { c * {} } }"), xDocShRef->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ b + { c * {} } }"_ustr, xDocShRef->GetText()); #endif } diff --git a/starmath/qa/cppunit/test_import.cxx b/starmath/qa/cppunit/test_import.cxx index 984475878eb3..29b618be09cb 100644 --- a/starmath/qa/cppunit/test_import.cxx +++ b/starmath/qa/cppunit/test_import.cxx @@ -23,7 +23,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("starmath/qa/cppunit/data/") + : UnoApiTest(u"starmath/qa/cppunit/data/"_ustr) { } diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index 7b42056fb35e..4e69d2bcb273 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -68,10 +68,10 @@ void NodeTest::testTdf47813() { SmParser5 aParser; #define MATRIX "matrix {-2#33##4#-5##6,0#7}" - auto pNodeA = aParser.Parse(MATRIX); - auto pNodeC = aParser.Parse("alignc " MATRIX); - auto pNodeL = aParser.Parse("alignl " MATRIX); - auto pNodeR = aParser.Parse("alignr " MATRIX); + auto pNodeA = aParser.Parse(u"" MATRIX ""_ustr); + auto pNodeC = aParser.Parse(u"alignc " MATRIX ""_ustr); + auto pNodeL = aParser.Parse(u"alignl " MATRIX ""_ustr); + auto pNodeR = aParser.Parse(u"alignr " MATRIX ""_ustr); #undef MATRIX ScopedVclPtrInstance<VirtualDevice> pOutputDevice; SmFormat aFmt; @@ -115,26 +115,26 @@ void NodeTest::testTdf52225() { SmFormat aFormat = mxDocShell->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), aFormat.GetGreekCharStyle()); // default format = 2 - CHECK_GREEK_SYMBOL("%ALPHA", u'\x0391', false); - CHECK_GREEK_SYMBOL("%iALPHA", u'\x0391', true); - CHECK_GREEK_SYMBOL("%alpha", u'\x03b1', true); - CHECK_GREEK_SYMBOL("%ialpha", u'\x03b1', true); + CHECK_GREEK_SYMBOL(u"%ALPHA"_ustr, u'\x0391', false); + CHECK_GREEK_SYMBOL(u"%iALPHA"_ustr, u'\x0391', true); + CHECK_GREEK_SYMBOL(u"%alpha"_ustr, u'\x03b1', true); + CHECK_GREEK_SYMBOL(u"%ialpha"_ustr, u'\x03b1', true); // mode 1 aFormat.SetGreekCharStyle(1); mxDocShell->SetFormat(aFormat); - CHECK_GREEK_SYMBOL("%BETA", u'\x0392', true); - CHECK_GREEK_SYMBOL("%iBETA", u'\x0392', true); - CHECK_GREEK_SYMBOL("%beta", u'\x03b2', true); - CHECK_GREEK_SYMBOL("%ibeta", u'\x03b2', true); + CHECK_GREEK_SYMBOL(u"%BETA"_ustr, u'\x0392', true); + CHECK_GREEK_SYMBOL(u"%iBETA"_ustr, u'\x0392', true); + CHECK_GREEK_SYMBOL(u"%beta"_ustr, u'\x03b2', true); + CHECK_GREEK_SYMBOL(u"%ibeta"_ustr, u'\x03b2', true); // mode 0 aFormat.SetGreekCharStyle(0); mxDocShell->SetFormat(aFormat); - CHECK_GREEK_SYMBOL("%GAMMA", u'\x0393', false); - CHECK_GREEK_SYMBOL("%iGAMMA", u'\x0393', true); - CHECK_GREEK_SYMBOL("%gamma", u'\x03b3', false); - CHECK_GREEK_SYMBOL("%igamma", u'\x03b3', true); + CHECK_GREEK_SYMBOL(u"%GAMMA"_ustr, u'\x0393', false); + CHECK_GREEK_SYMBOL(u"%iGAMMA"_ustr, u'\x0393', true); + CHECK_GREEK_SYMBOL(u"%gamma"_ustr, u'\x03b3', false); + CHECK_GREEK_SYMBOL(u"%igamma"_ustr, u'\x03b3', true); #undef CHECK_GREEK_SYMBOL } diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index 0fbcfa1a81a1..3a0f55700870 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -524,7 +524,7 @@ void Test::testBinomInBinHor() // tack +d on the end, which will put the binom into an SmBinHorNode aCursor.InsertElement(PlusElement); - aCursor.InsertText("d"); + aCursor.InsertText(u"d"_ustr); sExpected += "{ { binom a { b + c } } + d }"; CPPUNIT_ASSERT_EQUAL_MESSAGE("Binom Node in BinHor Node", sExpected, xDocShRef->GetText()); @@ -552,7 +552,7 @@ void Test::testBinVerInUnary() // set up a fraction aCursor.InsertFraction(); aCursor.Move(pOutputDevice, MoveDown); - aCursor.InsertText("2"); + aCursor.InsertText(u"2"_ustr); sExpected += "- { 1 over 2 }"; CPPUNIT_ASSERT_EQUAL_MESSAGE("Binary Vertical in Unary Operator", sExpected, @@ -569,25 +569,25 @@ void Test::testBinHorInSubSup() ScopedVclPtrInstance<VirtualDevice> pOutputDevice; // Insert an RSup expression with a BinHor for the exponent - aCursor.InsertText("a"); + aCursor.InsertText(u"a"_ustr); aCursor.InsertSubSup(RSUP); - aCursor.InsertText("b"); + aCursor.InsertText(u"b"_ustr); aCursor.InsertElement(PlusElement); - aCursor.InsertText("c"); + aCursor.InsertText(u"c"_ustr); // Move to the end and add d to the expression aCursor.Move(pOutputDevice, MoveRight); aCursor.InsertElement(PlusElement); - aCursor.InsertText("d"); + aCursor.InsertText(u"d"_ustr); - CPPUNIT_ASSERT_EQUAL_MESSAGE("BinHor in SubSup", OUString("{ a ^ { b + c } + d }"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("BinHor in SubSup", u"{ a ^ { b + c } + d }"_ustr, xDocShRef->GetText()); } void Test::testUnaryInMixedNumberAsNumerator() { // set up a unary operator - auto pTree = SmParser5().Parse("- 1"); + auto pTree = SmParser5().Parse(u"- 1"_ustr); pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); SmCursor aCursor(pTree.get(), xDocShRef.get()); @@ -604,13 +604,13 @@ void Test::testUnaryInMixedNumberAsNumerator() // Set up a fraction aCursor.InsertFraction(); aCursor.Move(pOutputDevice, MoveDown); - aCursor.InsertText("2"); + aCursor.InsertText(u"2"_ustr); // Move left and turn this into a mixed number // (bad form, but this could happen right?) aCursor.Move(pOutputDevice, MoveLeft); aCursor.Move(pOutputDevice, MoveLeft); - aCursor.InsertText("2"); + aCursor.InsertText(u"2"_ustr); // move forward (more than) enough places to be at the end for (size_t i = 0; i < 8; ++i) @@ -618,10 +618,10 @@ void Test::testUnaryInMixedNumberAsNumerator() // add 4 to the end aCursor.InsertElement(PlusElement); - aCursor.InsertText("4"); + aCursor.InsertText(u"4"_ustr); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unary in mixed number as Numerator", - OUString("{ 2 { { - 1 over 2 } + 4 } }"), xDocShRef->GetText()); + u"{ 2 { { - 1 over 2 } + 4 } }"_ustr, xDocShRef->GetText()); } void Test::testMiscEquivalent() diff --git a/starmath/qa/cppunit/test_parse.cxx b/starmath/qa/cppunit/test_parse.cxx index 2e240c04a2ac..0cffe2cbce83 100644 --- a/starmath/qa/cppunit/test_parse.cxx +++ b/starmath/qa/cppunit/test_parse.cxx @@ -63,7 +63,7 @@ void ParseTest::tearDown() */ void ParseTest::testMinus() { - auto pNode = SmParser5().Parse("-1.2"); + auto pNode = SmParser5().Parse(u"-1.2"_ustr); CPPUNIT_ASSERT_EQUAL(size_t(1), pNode->GetNumSubNodes()); const SmNode *pNode0 = pNode->GetSubNode(0); CPPUNIT_ASSERT(pNode0); @@ -79,14 +79,14 @@ void ParseTest::testMinus() // GetText() vs GetToken().aText CPPUNIT_ASSERT_EQUAL(OUString(MS_MINUS), static_cast<const SmMathSymbolNode *>(pNode000)->GetText()); - CPPUNIT_ASSERT_EQUAL(OUString("-"), + CPPUNIT_ASSERT_EQUAL(u"-"_ustr, static_cast<const SmMathSymbolNode *>(pNode000)->GetToken().aText); const SmNode *pNode001 = pNode00->GetSubNode(1); CPPUNIT_ASSERT(pNode001); CPPUNIT_ASSERT_EQUAL(SmNodeType::Text, pNode001->GetType()); // GetText() vs GetToken().aText CPPUNIT_ASSERT(static_cast<const SmTextNode *>(pNode001)->GetText().isEmpty()); - CPPUNIT_ASSERT_EQUAL(OUString("1.2"), + CPPUNIT_ASSERT_EQUAL(u"1.2"_ustr, static_cast<const SmTextNode *>(pNode001)->GetToken().aText); } @@ -96,7 +96,7 @@ void ParseTest::testMinus() */ void ParseTest::testNospace() { - auto pNode = SmParser5().Parse("nospace{ nitalic d {F(x) G(x)} }"); + auto pNode = SmParser5().Parse(u"nospace{ nitalic d {F(x) G(x)} }"_ustr); CPPUNIT_ASSERT_EQUAL(size_t(1), pNode->GetNumSubNodes()); const SmNode *pNode0 = pNode->GetSubNode(0); CPPUNIT_ASSERT(pNode0); @@ -110,7 +110,7 @@ void ParseTest::testNospace() const SmNode *pNode000 = pNode00->GetSubNode(0); CPPUNIT_ASSERT(pNode000); CPPUNIT_ASSERT_EQUAL(SmNodeType::Font, pNode000->GetType()); - CPPUNIT_ASSERT_EQUAL(OUString("nitalic"), + CPPUNIT_ASSERT_EQUAL(u"nitalic"_ustr, static_cast<const SmFontNode *>(pNode000)->GetToken().aText); const SmNode *pNode001 = pNode00->GetSubNode(1); CPPUNIT_ASSERT(pNode001); diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index 79b1bd461181..8dd6bc0b22ba 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -148,7 +148,7 @@ void Test::testSmTmpDeviceRestoreFont() { ScopedVclPtrInstance<Printer> pPrinter; - OUString aFontName("Linux Libertine G"); + OUString aFontName(u"Linux Libertine G"_ustr); CPPUNIT_ASSERT(pPrinter->IsFontAvailable(aFontName)); vcl::Font aOriginalFont = pPrinter->GetFont(); @@ -178,7 +178,7 @@ void Test::editMarker() { SmEditWindow& rEditWindow = m_pSmCmdBoxWindow->GetEditWindow(); { - OUString sMarkedText("<?> under <?> under <?>"); + OUString sMarkedText(u"<?> under <?> under <?>"_ustr); rEditWindow.SetText(sMarkedText); rEditWindow.Flush(); OUString sFinalText = rEditWindow.GetText(); @@ -190,12 +190,12 @@ void Test::editMarker() rEditWindow.SelNextMark(); rEditWindow.Delete(); - rEditWindow.InsertText("a"); + rEditWindow.InsertText(u"a"_ustr); rEditWindow.SelNextMark(); rEditWindow.SelNextMark(); rEditWindow.Delete(); - rEditWindow.InsertText("c"); + rEditWindow.InsertText(u"c"_ustr); // should be safe i.e. do nothing rEditWindow.SelNextMark(); @@ -207,7 +207,7 @@ void Test::editMarker() rEditWindow.SelPrevMark(); rEditWindow.Delete(); - rEditWindow.InsertText("b"); + rEditWindow.InsertText(u"b"_ustr); // tdf#106116: should be safe i.e. do nothing rEditWindow.SelPrevMark(); @@ -219,7 +219,7 @@ void Test::editMarker() rEditWindow.Flush(); OUString sFinalText = rEditWindow.GetText(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be a under b under c", OUString("a under b under c"), sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be a under b under c", u"a under b under c"_ustr, sFinalText); } { @@ -230,7 +230,7 @@ void Test::editMarker() void Test::editFailure() { - m_xDocShRef->SetText("color a b over {a/}"); + m_xDocShRef->SetText(u"color a b over {a/}"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); @@ -263,7 +263,7 @@ void Test::editFailure() void Test::ParseErrorUnexpectedToken() { - m_xDocShRef->SetText("\foo"); + m_xDocShRef->SetText(u"\foo"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::UnexpectedToken expected", @@ -272,7 +272,7 @@ void Test::ParseErrorUnexpectedToken() void Test::ParseErrorPoundExpected() { - m_xDocShRef->SetText("matrix {1#2##a##b#c}"); + m_xDocShRef->SetText(u"matrix {1#2##a##b#c}"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::PoundExpected expected", @@ -281,7 +281,7 @@ void Test::ParseErrorPoundExpected() void Test::ParseErrorColorExpected() { - m_xDocShRef->SetText("color 42 x"); + m_xDocShRef->SetText(u"color 42 x"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::ColorExpected expected", @@ -290,7 +290,7 @@ void Test::ParseErrorColorExpected() void Test::ParseErrorLgroupExpected() { - m_xDocShRef->SetText("stack 42"); + m_xDocShRef->SetText(u"stack 42"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::LgroupExpected expected", @@ -299,7 +299,7 @@ void Test::ParseErrorLgroupExpected() void Test::ParseErrorRgroupExpected() { - m_xDocShRef->SetText("stack {a#b#c)"); + m_xDocShRef->SetText(u"stack {a#b#c)"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::RgroupExpected expected", @@ -308,7 +308,7 @@ void Test::ParseErrorRgroupExpected() void Test::ParseErrorLbraceExpected() { - m_xDocShRef->SetText("left 42"); + m_xDocShRef->SetText(u"left 42"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::LbraceExpected expected", @@ -317,7 +317,7 @@ void Test::ParseErrorLbraceExpected() void Test::ParseErrorRbraceExpected() { - m_xDocShRef->SetText("left ( foo right x"); + m_xDocShRef->SetText(u"left ( foo right x"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::RbraceExpected expected", @@ -326,7 +326,7 @@ void Test::ParseErrorRbraceExpected() void Test::ParseErrorParentMismatch() { - m_xDocShRef->SetText("lbrace foo rceil"); + m_xDocShRef->SetText(u"lbrace foo rceil"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::ParentMismatch expected", @@ -335,7 +335,7 @@ void Test::ParseErrorParentMismatch() void Test::ParseErrorRightExpected() { - m_xDocShRef->SetText("left ( x mline y )"); + m_xDocShRef->SetText(u"left ( x mline y )"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::RightExpected expected", @@ -344,7 +344,7 @@ void Test::ParseErrorRightExpected() void Test::ParseErrorFontExpected() { - m_xDocShRef->SetText("font small bar"); + m_xDocShRef->SetText(u"font small bar"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::FontExpected expected", @@ -353,7 +353,7 @@ void Test::ParseErrorFontExpected() void Test::ParseErrorSizeExpected() { - m_xDocShRef->SetText("size small baz"); + m_xDocShRef->SetText(u"size small baz"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::SizeExpected expected", @@ -362,7 +362,7 @@ void Test::ParseErrorSizeExpected() void Test::ParseErrorDoubleAlign() { - m_xDocShRef->SetText("alignl alignc x"); + m_xDocShRef->SetText(u"alignl alignc x"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::DoubleAlign expected", @@ -371,7 +371,7 @@ void Test::ParseErrorDoubleAlign() void Test::ParseErrorDoubleSubsupscript() { - m_xDocShRef->SetText("x_y_z"); + m_xDocShRef->SetText(u"x_y_z"_ustr); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser()->NextError(); CPPUNIT_ASSERT(pErrorDesc); CPPUNIT_ASSERT_EQUAL_MESSAGE("SmParseError::DoubleSubsupscript expected", @@ -382,7 +382,7 @@ void Test::editUndoRedo() { EditEngine &rEditEngine = m_xDocShRef->GetEditEngine(); - OUString sStringOne("a under b"); + OUString sStringOne(u"a under b"_ustr); { rEditEngine.SetText(0, sStringOne); m_xDocShRef->UpdateText(); @@ -391,7 +391,7 @@ void Test::editUndoRedo() } { - OUString sStringTwo("a over b"); + OUString sStringTwo(u"a over b"_ustr); rEditEngine.SetText(0, sStringTwo); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); @@ -437,11 +437,11 @@ void Test::replacePlaceholder() SmEditWindow& rEditWindow = m_pSmCmdBoxWindow->GetEditWindow(); // Test the placeholder replacement. In this case, testing 'a + b', it // should return '+a + b' when selecting '+<?>' in ElementsDock - rEditWindow.SetText("a + b"); + rEditWindow.SetText(u"a + b"_ustr); rEditWindow.SelectAll(); - rEditWindow.InsertText("+<?>"); + rEditWindow.InsertText(u"+<?>"_ustr); OUString sFinalText = rEditWindow.GetText(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be '+a + b'", OUString("+a + b"), sFinalText); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be '+a + b'", u"+a + b"_ustr, sFinalText); } void Test::viewZoom() @@ -451,7 +451,7 @@ void Test::viewZoom() EditEngine &rEditEngine = m_xDocShRef->GetEditEngine(); { - OUString sStringOne("a under b"); + OUString sStringOne(u"a under b"_ustr); rEditEngine.SetText(0, sStringOne); m_xDocShRef->UpdateText(); OUString sFinalText = m_xDocShRef->GetText(); diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 402df43130d5..63ee1feb1f4d 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -24,7 +24,7 @@ class MathMLExportTest : public UnoApiXmlTest { public: MathMLExportTest() - : UnoApiXmlTest("starmath/qa/extras/data/") + : UnoApiXmlTest(u"starmath/qa/extras/data/"_ustr) { } @@ -55,27 +55,27 @@ void MathMLExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) void MathMLExportTest::testBlank() { - mxComponent = loadFromDesktop("private:factory/smath"); + mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - pDocShell->SetText("x`y~~z"); - save("MathML XML (Math)"); + pDocShell->SetText(u"x`y~~z"_ustr); + save(u"MathML XML (Math)"_ustr); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - 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"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[1]"_ostr, "width"_ostr, u"0.5em"_ustr); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mspace[2]"_ostr, "width"_ostr, u"4em"_ustr); } void MathMLExportTest::testTdf97049() { - mxComponent = loadFromDesktop("private:factory/smath"); + mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - pDocShell->SetText("intd {{1 over x} dx}"); - save("MathML XML (Math)"); + pDocShell->SetText(u"intd {{1 over x} dx}"_ustr); + save(u"MathML XML (Math)"_ustr); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); - assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"_ostr, "stretchy"_ostr, "true"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mo[1]"_ostr, "stretchy"_ostr, u"true"_ustr); 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]); @@ -83,35 +83,37 @@ void MathMLExportTest::testTdf97049() void MathMLExportTest::checkMathVariant(SmDocShell& rDocShell, bool bCapital, bool bSmall) { - rDocShell.SetText("%GAMMA %iGAMMA {ital %GAMMA} {nitalic %iGAMMA} " - "%gamma %igamma {ital %gamma} {nitalic %igamma}"); - save("MathML XML (Math)"); + rDocShell.SetText(u"%GAMMA %iGAMMA {ital %GAMMA} {nitalic %iGAMMA} " + "%gamma %igamma {ital %gamma} {nitalic %igamma}"_ustr); + save(u"MathML XML (Math)"_ustr); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); if (bCapital) 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]"_ostr, "mathvariant"_ostr, "normal"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[1]"_ostr, "mathvariant"_ostr, + u"normal"_ustr); 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"); + u"normal"_ustr); if (bSmall) 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]"_ostr, "mathvariant"_ostr, "normal"); + assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:mi[3]"_ostr, "mathvariant"_ostr, + u"normal"_ustr); 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(""); + u"normal"_ustr); + rDocShell.SetText(u""_ustr); } void MathMLExportTest::testTdf101022() { - mxComponent = loadFromDesktop("private:factory/smath"); + mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); @@ -126,27 +128,27 @@ void MathMLExportTest::testTdf101022() void MathMLExportTest::testMaj() { - mxComponent = loadFromDesktop("private:factory/smath"); + mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); pDocShell->SetText( u"maj to { \u0661 } from { \U0001EE0A = \u0660 } { \u0661 over \U0001EE0A }"_ustr); - save("MathML XML (Math)"); + save(u"MathML XML (Math)"_ustr); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPath(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr, "stretchy"_ostr, - "false"); + u"false"_ustr); assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo"_ostr, u"\U0001EEF0"_ustr); } void MathMLExportTest::testHadd() { - mxComponent = loadFromDesktop("private:factory/smath"); + mxComponent = loadFromDesktop(u"private:factory/smath"_ustr); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); pDocShell->SetText(u"hadd to { \U0001EE4E } from { \U0001EE4E } \U0001EE4E"_ustr); - save("MathML XML (Math)"); + save(u"MathML XML (Math)"_ustr); xmlDocUniquePtr pDoc = parseXml(maTempFile); CPPUNIT_ASSERT(pDoc); assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi"_ostr, diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index d57dee0aa7f3..1d4a0cf00364 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -21,7 +21,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("starmath/qa/extras/data/") + : UnoApiTest(u"starmath/qa/extras/data/"_ustr) { } @@ -61,26 +61,26 @@ void Test::testColor() loadFromFile(u"color.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL(OUString("{ color black b" - " color white w" - " color red r" - " color green g" - " color blue b" - " color yellow y" - " color silver s" - " color gray g" - " color maroon m" - " color purple p" - " color lime l" - " color olive o" - " color navy n" - " color teal t" - " color aqua a" - " color fuchsia f" - " color crimson c" - " color dvip apricot" - " a color yellow y" - " color rgb 220 20 61 x }"), + CPPUNIT_ASSERT_EQUAL(u"{ color black b" + " color white w" + " color red r" + " color green g" + " color blue b" + " color yellow y" + " color silver s" + " color gray g" + " color maroon m" + " color purple p" + " color lime l" + " color olive o" + " color navy n" + " color teal t" + " color aqua a" + " color fuchsia f" + " color crimson c" + " color dvip apricot" + " a color yellow y" + " color rgb 220 20 61 x }"_ustr, pDocShell->GetText()); } @@ -89,7 +89,7 @@ void Test::testSimple() loadFromFile(u"simple.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", OUString("left ( { a + b } right ) ^ 2"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"left ( { a + b } right ) ^ 2"_ustr, pDocShell->GetText()); } @@ -98,7 +98,7 @@ void Test::testNsPrefixMath() loadFromFile(u"ns-prefix-math.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", OUString("left ( { a + b } right ) ^ 2"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"left ( { a + b } right ) ^ 2"_ustr, pDocShell->GetText()); } @@ -107,7 +107,7 @@ void Test::testMaction() loadFromFile(u"maction.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", OUString("matrix{ 1 ## 2 ## 3 }"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"matrix{ 1 ## 2 ## 3 }"_ustr, pDocShell->GetText()); } @@ -116,7 +116,7 @@ void Test::testMspace() loadFromFile(u"mspace.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL(OUString("{ a b ~ c ~~``` d }"), pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ a b ~ c ~~``` d }"_ustr, pDocShell->GetText()); } void Test::testtdf99556() @@ -124,7 +124,7 @@ void Test::testtdf99556() loadFromFile(u"tdf99556-1.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", OUString("sqrt { }"), pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("loaded text", u"sqrt { }"_ustr, pDocShell->GetText()); } void Test::testTdf103430() @@ -132,10 +132,9 @@ void Test::testTdf103430() loadFromFile(u"tdf103430.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL( - OUString("{ frac { { nitalic d ^ 2 nitalic color blue y } } { { color dvip " - "apricot nitalic d font sans bold italic color red x } } }"), - pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ frac { { nitalic d ^ 2 nitalic color blue y } } { { color dvip " + "apricot nitalic d font sans bold italic color red x } } }"_ustr, + pDocShell->GetText()); } void Test::testTdf103500() @@ -143,10 +142,9 @@ void Test::testTdf103500() loadFromFile(u"tdf103500.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - 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 } } }"), - pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL(u"{ { int csup b csub a { { frac { 1 } { x } } ` nitalic d x } } = { " + "intd csup b csub a { { frac { 1 } { y } } ` nitalic d y } } }"_ustr, + pDocShell->GetText()); } void Test::testTdf137008() @@ -155,7 +153,7 @@ void Test::testTdf137008() loadFromFile(u"tdf137008.mml"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL(OUString("matrix{ { } # ## # }"), pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL(u"matrix{ { } # ## # }"_ustr, pDocShell->GetText()); } void Test::testTdf151842() @@ -164,7 +162,7 @@ void Test::testTdf151842() loadFromFile(u"tdf151842.odf"); SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); SmDocShell* pDocShell = static_cast<SmDocShell*>(pModel->GetObjectShell()); - CPPUNIT_ASSERT_EQUAL(OUString("test"), pDocShell->GetText()); + CPPUNIT_ASSERT_EQUAL(u"test"_ustr, pDocShell->GetText()); SmFormat aFormat = pDocShell->GetFormat(); // Without the fix in place, this test would have failed with diff --git a/starmath/source/SmElementsPanel.cxx b/starmath/source/SmElementsPanel.cxx index cdb036dbcf85..ad0fb7089890 100644 --- a/starmath/source/SmElementsPanel.cxx +++ b/starmath/source/SmElementsPanel.cxx @@ -41,10 +41,12 @@ std::unique_ptr<PanelLayout> SmElementsPanel::Create(weld::Widget& rParent, } SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings) - : PanelLayout(&rParent, "MathElementsPanel", "modules/smath/ui/sidebarelements_math.ui") + : PanelLayout(&rParent, u"MathElementsPanel"_ustr, + u"modules/smath/ui/sidebarelements_math.ui"_ustr) , mrBindings(rBindings) - , mxCategoryList(m_xBuilder->weld_combo_box("categorylist")) - , mxElementsControl(std::make_unique<SmElementsControl>(m_xBuilder->weld_icon_view("elements"))) + , mxCategoryList(m_xBuilder->weld_combo_box(u"categorylist"_ustr)) + , mxElementsControl( + std::make_unique<SmElementsControl>(m_xBuilder->weld_icon_view(u"elements"_ustr))) { for (const auto& rCategoryId : SmElementsControl::categories()) mxCategoryList->append_text(SmResId(rCategoryId)); diff --git a/starmath/source/SmPanelFactory.cxx b/starmath/source/SmPanelFactory.cxx index df35dcadffbc..833530ace90d 100644 --- a/starmath/source/SmPanelFactory.cxx +++ b/starmath/source/SmPanelFactory.cxx @@ -62,10 +62,12 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen try { const comphelper::NamedValueCollection aArguments(Arguments); - auto xFrame(aArguments.getOrDefault("Frame", css::uno::Reference<css::frame::XFrame>())); - auto xParentWindow( - aArguments.getOrDefault("ParentWindow", css::uno::Reference<css::awt::XWindow>())); - const sal_uInt64 nBindingsValue(aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); + auto xFrame( + aArguments.getOrDefault(u"Frame"_ustr, css::uno::Reference<css::frame::XFrame>())); + auto xParentWindow(aArguments.getOrDefault(u"ParentWindow"_ustr, + css::uno::Reference<css::awt::XWindow>())); + const sal_uInt64 nBindingsValue( + aArguments.getOrDefault(u"SfxBindings"_ustr, sal_uInt64(0))); SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); weld::Widget* pParent(nullptr); @@ -73,11 +75,13 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen pParent = pTunnel->getWidget(); if (!pParent) - throw css::uno::RuntimeException("SmPanelFactory::createUIElement: no ParentWindow"); + throw css::uno::RuntimeException( + u"SmPanelFactory::createUIElement: no ParentWindow"_ustr); if (!xFrame) - throw css::uno::RuntimeException("SmPanelFactory::createUIElement: no Frame"); + throw css::uno::RuntimeException(u"SmPanelFactory::createUIElement: no Frame"_ustr); if (!pBindings) - throw css::uno::RuntimeException("SmPanelFactory::createUIElement: no SfxBindings"); + throw css::uno::RuntimeException( + u"SmPanelFactory::createUIElement: no SfxBindings"_ustr); std::unique_ptr<PanelLayout> pPanel; css::ui::LayoutSize aLayoutSize{ -1, -1, -1 }; @@ -102,8 +106,8 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen catch (const css::uno::Exception&) { css::uno::Any anyEx = cppu::getCaughtException(); - throw css::lang::WrappedTargetRuntimeException("SmPanelFactory::createUIElement exception", - nullptr, anyEx); + throw css::lang::WrappedTargetRuntimeException( + u"SmPanelFactory::createUIElement exception"_ustr, nullptr, anyEx); } return {}; @@ -111,7 +115,7 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen OUString SmPanelFactory::getImplementationName() { - return "org.libreoffice.comp.Math.sidebar.SmPanelFactory"; + return u"org.libreoffice.comp.Math.sidebar.SmPanelFactory"_ustr; } sal_Bool SmPanelFactory::supportsService(OUString const& ServiceName) @@ -121,7 +125,7 @@ sal_Bool SmPanelFactory::supportsService(OUString const& ServiceName) css::uno::Sequence<OUString> SmPanelFactory::getSupportedServiceNames() { - return { "com.sun.star.ui.UIElementFactory" }; + return { u"com.sun.star.ui.UIElementFactory"_ustr }; } } // end of unnamed namespace diff --git a/starmath/source/SmPropertiesPanel.cxx b/starmath/source/SmPropertiesPanel.cxx index 48f2c6897cd1..7f7108911b4f 100644 --- a/starmath/source/SmPropertiesPanel.cxx +++ b/starmath/source/SmPropertiesPanel.cxx @@ -41,12 +41,13 @@ SmPropertiesPanel::Create(weld::Widget& rParent, SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent, const css::uno::Reference<css::frame::XFrame>& xFrame) - : PanelLayout(&rParent, "MathPropertiesPanel", "modules/smath/ui/sidebarproperties_math.ui") + : PanelLayout(&rParent, u"MathPropertiesPanel"_ustr, + u"modules/smath/ui/sidebarproperties_math.ui"_ustr) , mxFrame(xFrame) - , mpFormatFontsButton(m_xBuilder->weld_button("btnFormatFonts")) - , mpFormatFontSizeButton(m_xBuilder->weld_button("btnFormatFontSize")) - , mpFormatSpacingButton(m_xBuilder->weld_button("btnFormatSpacing")) - , mpFormatAlignmentButton(m_xBuilder->weld_button("btnFormatAlignment")) + , mpFormatFontsButton(m_xBuilder->weld_button(u"btnFormatFonts"_ustr)) + , mpFormatFontSizeButton(m_xBuilder->weld_button(u"btnFormatFontSize"_ustr)) + , mpFormatSpacingButton(m_xBuilder->weld_button(u"btnFormatSpacing"_ustr)) + , mpFormatAlignmentButton(m_xBuilder->weld_button(u"btnFormatAlignment"_ustr)) , maButtonCommands{ { mpFormatFontsButton.get(), ".uno:ChangeFont" }, { mpFormatFontSizeButton.get(), ".uno:ChangeFontSize" }, { mpFormatSpacingButton.get(), ".uno:ChangeDistance" }, @@ -56,12 +57,13 @@ SmPropertiesPanel::SmPropertiesPanel(weld::Widget& rParent, auto xConfs = css::frame::theUICommandDescription::get(comphelper::getProcessComponentContext()); if (css::uno::Reference<css::container::XNameAccess> xConf{ - xConfs->getByName("com.sun.star.formula.FormulaProperties"), css::uno::UNO_QUERY }) + xConfs->getByName(u"com.sun.star.formula.FormulaProperties"_ustr), + css::uno::UNO_QUERY }) { for (const auto & [ button, command ] : maButtonCommands) { comphelper::SequenceAsHashMap props(xConf->getByName(command)); - button->set_label(props.getUnpackedValueOrDefault("Name", button->get_label())); + button->set_label(props.getUnpackedValueOrDefault(u"Name"_ustr, button->get_label())); } } diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 055cd0f66ef0..c6abfaed1743 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -723,7 +723,7 @@ sal_Bool SAL_CALL SmGraphicAccessible::scrollSubstringTo( sal_Int32, sal_Int32, OUString SAL_CALL SmGraphicAccessible::getImplementationName() { - return "SmGraphicAccessible"; + return u"SmGraphicAccessible"_ustr; } sal_Bool SAL_CALL SmGraphicAccessible::supportsService( @@ -735,10 +735,10 @@ sal_Bool SAL_CALL SmGraphicAccessible::supportsService( Sequence< OUString > SAL_CALL SmGraphicAccessible::getSupportedServiceNames() { return { - "css::accessibility::Accessible", - "css::accessibility::AccessibleComponent", - "css::accessibility::AccessibleContext", - "css::accessibility::AccessibleText" + u"css::accessibility::Accessible"_ustr, + u"css::accessibility::AccessibleComponent"_ustr, + u"css::accessibility::AccessibleContext"_ustr, + u"css::accessibility::AccessibleText"_ustr }; } diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 9aaa894d2fb5..d8805f44dfd0 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -48,41 +48,41 @@ constexpr OUString FONT_FORMAT_LIST = u"FontFormatList"_ustr; static Sequence< OUString > lcl_GetFontPropertyNames() { return Sequence< OUString > { - "Name", - "CharSet", - "Family", - "Pitch", - "Weight", - "Italic" + u"Name"_ustr, + u"CharSet"_ustr, + u"Family"_ustr, + u"Pitch"_ustr, + u"Weight"_ustr, + u"Italic"_ustr }; } static Sequence< OUString > lcl_GetSymbolPropertyNames() { return Sequence< OUString > { - "Char", - "Set", - "Predefined", - "FontFormatId" + u"Char"_ustr, + u"Set"_ustr, + u"Predefined"_ustr, + u"FontFormatId"_ustr }; } static Sequence<OUString> lcl_GetOtherPropertyNames() { - return Sequence<OUString>{ "LoadSave/IsSaveOnlyUsedSymbols", - "Misc/AutoCloseBrackets", - "Misc/DefaultSmSyntaxVersion", - "Misc/IgnoreSpacesRight", - "Misc/InlineEditEnable", - "Misc/SmEditWindowZoomFactor", - "Print/FormulaText", - "Print/Frame", - "Print/Size", - "Print/Title", - "Print/ZoomFactor", - "View/AutoRedraw", - "View/FormulaCursor", - "View/ToolboxVisible" }; + return Sequence<OUString>{ u"LoadSave/IsSaveOnlyUsedSymbols"_ustr, + u"Misc/AutoCloseBrackets"_ustr, + u"Misc/DefaultSmSyntaxVersion"_ustr, + u"Misc/IgnoreSpacesRight"_ustr, + u"Misc/InlineEditEnable"_ustr, + u"Misc/SmEditWindowZoomFactor"_ustr, + u"Print/FormulaText"_ustr, + u"Print/Frame"_ustr, + u"Print/Size"_ustr, + u"Print/Title"_ustr, + u"Print/ZoomFactor"_ustr, + u"View/AutoRedraw"_ustr, + u"View/FormulaCursor"_ustr, + u"View/ToolboxVisible"_ustr }; } static Sequence< OUString > lcl_GetFormatPropertyNames() @@ -90,48 +90,48 @@ static Sequence< OUString > lcl_GetFormatPropertyNames() //! Beware of order according to *_BEGIN *_END defines in format.hxx ! //! see respective load/save routines here return Sequence< OUString > { - "StandardFormat/Textmode", - "StandardFormat/RightToLeft", - "StandardFormat/GreekCharStyle", - "StandardFormat/ScaleNormalBracket", - "StandardFormat/HorizontalAlignment", - "StandardFormat/BaseSize", - "StandardFormat/TextSize", - "StandardFormat/IndexSize", - "StandardFormat/FunctionSize", - "StandardFormat/OperatorSize", - "StandardFormat/LimitsSize", - "StandardFormat/Distance/Horizontal", - "StandardFormat/Distance/Vertical", - "StandardFormat/Distance/Root", - "StandardFormat/Distance/SuperScript", - "StandardFormat/Distance/SubScript", - "StandardFormat/Distance/Numerator", - "StandardFormat/Distance/Denominator", - "StandardFormat/Distance/Fraction", - "StandardFormat/Distance/StrokeWidth", - "StandardFormat/Distance/UpperLimit", - "StandardFormat/Distance/LowerLimit", - "StandardFormat/Distance/BracketSize", - "StandardFormat/Distance/BracketSpace", - "StandardFormat/Distance/MatrixRow", - "StandardFormat/Distance/MatrixColumn", - "StandardFormat/Distance/OrnamentSize", - "StandardFormat/Distance/OrnamentSpace", - "StandardFormat/Distance/OperatorSize", - "StandardFormat/Distance/OperatorSpace", - "StandardFormat/Distance/LeftSpace", - "StandardFormat/Distance/RightSpace", - "StandardFormat/Distance/TopSpace", - "StandardFormat/Distance/BottomSpace", - "StandardFormat/Distance/NormalBracketSize", - "StandardFormat/VariableFont", - "StandardFormat/FunctionFont", - "StandardFormat/NumberFont", - "StandardFormat/TextFont", - "StandardFormat/SerifFont", - "StandardFormat/SansFont", - "StandardFormat/FixedFont" + u"StandardFormat/Textmode"_ustr, + u"StandardFormat/RightToLeft"_ustr, + u"StandardFormat/GreekCharStyle"_ustr, + u"StandardFormat/ScaleNormalBracket"_ustr, + u"StandardFormat/HorizontalAlignment"_ustr, + u"StandardFormat/BaseSize"_ustr, + u"StandardFormat/TextSize"_ustr, + u"StandardFormat/IndexSize"_ustr, + u"StandardFormat/FunctionSize"_ustr, + u"StandardFormat/OperatorSize"_ustr, + u"StandardFormat/LimitsSize"_ustr, + u"StandardFormat/Distance/Horizontal"_ustr, + u"StandardFormat/Distance/Vertical"_ustr, + u"StandardFormat/Distance/Root"_ustr, + u"StandardFormat/Distance/SuperScript"_ustr, + u"StandardFormat/Distance/SubScript"_ustr, + u"StandardFormat/Distance/Numerator"_ustr, + u"StandardFormat/Distance/Denominator"_ustr, + u"StandardFormat/Distance/Fraction"_ustr, + u"StandardFormat/Distance/StrokeWidth"_ustr, + u"StandardFormat/Distance/UpperLimit"_ustr, + u"StandardFormat/Distance/LowerLimit"_ustr, + u"StandardFormat/Distance/BracketSize"_ustr, + u"StandardFormat/Distance/BracketSpace"_ustr, + u"StandardFormat/Distance/MatrixRow"_ustr, + u"StandardFormat/Distance/MatrixColumn"_ustr, + u"StandardFormat/Distance/OrnamentSize"_ustr, + u"StandardFormat/Distance/OrnamentSpace"_ustr, + u"StandardFormat/Distance/OperatorSize"_ustr, + u"StandardFormat/Distance/OperatorSpace"_ustr, + u"StandardFormat/Distance/LeftSpace"_ustr, + u"StandardFormat/Distance/RightSpace"_ustr, + u"StandardFormat/Distance/TopSpace"_ustr, + u"StandardFormat/Distance/BottomSpace"_ustr, + u"StandardFormat/Distance/NormalBracketSize"_ustr, + u"StandardFormat/VariableFont"_ustr, + u"StandardFormat/FunctionFont"_ustr, + u"StandardFormat/NumberFont"_ustr, + u"StandardFormat/TextFont"_ustr, + u"StandardFormat/SerifFont"_ustr, + u"StandardFormat/SansFont"_ustr, + u"StandardFormat/FixedFont"_ustr }; } @@ -359,7 +359,7 @@ OUString SmFontFormatList::GetNewFontFormatId() const SmMathConfig::SmMathConfig() : - ConfigItem("Office.Math") + ConfigItem(u"Office.Math"_ustr) , bIsOtherModified(false) , bIsFormatModified(false) { @@ -392,7 +392,7 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol, Sequence< OUString > aNames = lcl_GetSymbolPropertyNames(); sal_Int32 nProps = aNames.getLength(); - OUString aDelim( "/" ); + OUString aDelim( u"/"_ustr ); for (auto& rName : asNonConstRange(aNames)) rName = rBaseNode + aDelim + rSymbolName + aDelim + rName; @@ -532,7 +532,7 @@ void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols ) PropertyValue *pValues = aValues.getArray(); PropertyValue *pVal = pValues; - OUString aDelim( "/" ); + OUString aDelim( u"/"_ustr ); for (const SmSym& rSymbol : rNewSymbols) { OUString aNodeNameDelim = SYMBOL_LIST + @@ -612,7 +612,7 @@ void SmMathConfig::ReadFontFormat( SmFontFormat &rFontFormat, Sequence< OUString > aNames = lcl_GetFontPropertyNames(); sal_Int32 nProps = aNames.getLength(); - OUString aDelim( "/" ); + OUString aDelim( u"/"_ustr ); for (auto& rName : asNonConstRange(aNames)) rName = rBaseNode + aDelim + rSymbolName + aDelim + rName; @@ -678,7 +678,7 @@ void SmMathConfig::SaveFontFormatList() PropertyValue *pValues = aValues.getArray(); PropertyValue *pVal = pValues; - OUString aDelim( "/" ); + OUString aDelim( u"/"_ustr ); for (size_t i = 0; i < nCount; ++i) { OUString aFntFmtId(rFntFmtList.GetFontFormatId(i)); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 6f8e9b0af042..b76c982d568a 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -643,7 +643,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) { pSelectedNodesList.reset(); //Create SmBraceNode - SmToken aTok(TLEFT, ' + SmToken aTok(TLEFT, ' SmBraceNode *pBrace = new SmBraceNode(aTok); pBrace->SetScaleMode(SmScaleMode::Height); std::unique_ptr<SmNode> pLeft( CreateBracket(eBracketType, true) ), @@ -669,25 +669,25 @@ SmNode *SmCursor::CreateBracket(SmBracketType eBracketType, bool bIsLeft) { if(bIsLeft){ switch(eBracketType){ case SmBracketType::Round: - aTok = SmToken(TLPARENT, MS_LPARENT, "(", TG::LBrace, 5); + aTok = SmToken(TLPARENT, MS_LPARENT, u"("_ustr, TG::LBrace, 5); break; case SmBracketType::Square: - aTok = SmToken(TLBRACKET, MS_LBRACKET, "[", TG::LBrace, 5); + aTok = SmToken(TLBRACKET, MS_LBRACKET, u"["_ustr, TG::LBrace, 5); break; case SmBracketType::Curly: - aTok = SmToken(TLBRACE, MS_LBRACE, "lbrace", TG::LBrace, 5); + aTok = SmToken(TLBRACE, MS_LBRACE, u"lbrace"_ustr, TG::LBrace, 5); break; } } else { switch(eBracketType) { case SmBracketType::Round: - aTok = SmToken(TRPARENT, MS_RPARENT, ")", TG::RBrace, 5); + aTok = SmToken(TRPARENT, MS_RPARENT, u")"_ustr, TG::RBrace, 5); break; case SmBracketType::Square: - aTok = SmToken(TRBRACKET, MS_RBRACKET, "]", TG::RBrace, 5); + aTok = SmToken(TRBRACKET, MS_RBRACKET, u"]"_ustr, TG::RBrace, 5); break; case SmBracketType::Curly: - aTok = SmToken(TRBRACE, MS_RBRACE, "rbrace", TG::RBrace, 5); + aTok = SmToken(TRBRACE, MS_RBRACE, u"rbrace"_ustr, TG::RBrace, 5); break; } } @@ -770,7 +770,7 @@ bool SmCursor::InsertRow() { pNewLineList.reset(); //Wrap pNewLine in SmLineNode if needed if(pLineParent->GetType() == SmNodeType::Line) { - std::unique_ptr<SmLineNode> pNewLineNode(new SmLineNode(SmToken(TNEWLINE, ' + std::unique_ptr<SmLineNode> pNewLineNode(new SmLineNode(SmToken(TNEWLINE, ' pNewLineNode->SetSubNodes(std::move(pNewLine), nullptr); pNewLine = std::move(pNewLineNode); } @@ -858,7 +858,7 @@ void SmCursor::InsertFraction() { pSelectedNodesList.reset(); //Create new fraction - SmBinVerNode *pFrac = new SmBinVerNode(SmToken(TOVER, ' + SmBinVerNode *pFrac = new SmBinVerNode(SmToken(TOVER, ' std::unique_ptr<SmNode> pRect(new SmRectangleNode(SmToken())); pFrac->SetSubNodes(std::move(pNum), std::move(pRect), std::move(pDenom)); @@ -917,7 +917,7 @@ void SmCursor::InsertElement(SmFormulaElement element){ }break; case FactorialElement: { - SmToken token(TFACT, MS_FACT, "fact", TG::UnOper, 5); + SmToken token(TFACT, MS_FACT, u"fact"_ustr, TG::UnOper, 5); pNewNode = new SmMathSymbolNode(token); }break; case PlusElement: @@ -1269,7 +1269,7 @@ void SmCursor::FinishEdit(std::unique_ptr<SmNodeList> pLineList, nParentIndex == 0 && entries > 1) { //Wrap pLine in scalable round brackets - SmToken aTok(TLEFT, ' + SmToken aTok(TLEFT, ' std::unique_ptr<SmBraceNode> pBrace(new SmBraceNode(aTok)); pBrace->SetScaleMode(SmScaleMode::Height); std::unique_ptr<SmNode> pLeft( CreateBracket(SmBracketType::Round, true) ), diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 1ad8376e5a7f..eafee6070a89 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -178,28 +178,28 @@ IMPL_LINK_NOARG(SmPrintOptionsTabPage, SizeButtonClickHdl, weld::Toggleable&, vo } SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rOptions) - : SfxTabPage(pPage, pController, "modules/smath/ui/smathsettings.ui", "SmathSettings", &rOptions) - , m_xTitle(m_xBuilder->weld_check_button("title")) - , m_xTitleImg(m_xBuilder->weld_widget("locktitle")) - , m_xText(m_xBuilder->weld_check_button("text")) - , m_xTextImg(m_xBuilder->weld_widget("locktext")) - , m_xFrame(m_xBuilder->weld_check_button("frame")) - , m_xFrameImg(m_xBuilder->weld_widget("lockframe")) - , m_xSizeNormal(m_xBuilder->weld_radio_button("sizenormal")) - , m_xSizeScaled(m_xBuilder->weld_radio_button("sizescaled")) - , m_xSizeZoomed(m_xBuilder->weld_radio_button("sizezoomed")) - , m_xLockPrintImg(m_xBuilder->weld_widget("lockprintformat")) - , m_xZoom(m_xBuilder->weld_metric_spin_button("zoom", FieldUnit::PERCENT)) - , m_xEnableInlineEdit(m_xBuilder->weld_check_button("enableinlineedit")) - , m_xEnableInlineEditImg(m_xBuilder->weld_widget("lockenableinlineedit")) - , m_xNoRightSpaces(m_xBuilder->weld_check_button("norightspaces")) - , m_xNoRightSpacesImg(m_xBuilder->weld_widget("locknorightspaces")) - , m_xSaveOnlyUsedSymbols(m_xBuilder->weld_check_button("saveonlyusedsymbols")) - , m_xSaveOnlyUsedSymbolsImg(m_xBuilder->weld_widget("locksaveonlyusedsymbols")) - , m_xAutoCloseBrackets(m_xBuilder->weld_check_button("autoclosebrackets")) - , m_xAutoCloseBracketsImg(m_xBuilder->weld_widget("lockautoclosebrackets")) - , m_xSmZoom(m_xBuilder->weld_metric_spin_button("smzoom", FieldUnit::PERCENT)) - , m_xSmZoomImg(m_xBuilder->weld_widget("locksmzoom")) + : SfxTabPage(pPage, pController, u"modules/smath/ui/smathsettings.ui"_ustr, u"SmathSettings"_ustr, &rOptions) + , m_xTitle(m_xBuilder->weld_check_button(u"title"_ustr)) + , m_xTitleImg(m_xBuilder->weld_widget(u"locktitle"_ustr)) + , m_xText(m_xBuilder->weld_check_button(u"text"_ustr)) + , m_xTextImg(m_xBuilder->weld_widget(u"locktext"_ustr)) + , m_xFrame(m_xBuilder->weld_check_button(u"frame"_ustr)) + , m_xFrameImg(m_xBuilder->weld_widget(u"lockframe"_ustr)) + , m_xSizeNormal(m_xBuilder->weld_radio_button(u"sizenormal"_ustr)) + , m_xSizeScaled(m_xBuilder->weld_radio_button(u"sizescaled"_ustr)) + , m_xSizeZoomed(m_xBuilder->weld_radio_button(u"sizezoomed"_ustr)) + , m_xLockPrintImg(m_xBuilder->weld_widget(u"lockprintformat"_ustr)) + , m_xZoom(m_xBuilder->weld_metric_spin_button(u"zoom"_ustr, FieldUnit::PERCENT)) + , m_xEnableInlineEdit(m_xBuilder->weld_check_button(u"enableinlineedit"_ustr)) + , m_xEnableInlineEditImg(m_xBuilder->weld_widget(u"lockenableinlineedit"_ustr)) + , m_xNoRightSpaces(m_xBuilder->weld_check_button(u"norightspaces"_ustr)) + , m_xNoRightSpacesImg(m_xBuilder->weld_widget(u"locknorightspaces"_ustr)) + , m_xSaveOnlyUsedSymbols(m_xBuilder->weld_check_button(u"saveonlyusedsymbols"_ustr)) + , m_xSaveOnlyUsedSymbolsImg(m_xBuilder->weld_widget(u"locksaveonlyusedsymbols"_ustr)) + , m_xAutoCloseBrackets(m_xBuilder->weld_check_button(u"autoclosebrackets"_ustr)) + , m_xAutoCloseBracketsImg(m_xBuilder->weld_widget(u"lockautoclosebrackets"_ustr)) + , m_xSmZoom(m_xBuilder->weld_metric_spin_button(u"smzoom"_ustr, FieldUnit::PERCENT)) + , m_xSmZoomImg(m_xBuilder->weld_widget(u"locksmzoom"_ustr)) { m_xSizeNormal->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); m_xSizeScaled->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); @@ -218,7 +218,7 @@ SmPrintOptionsTabPage::~SmPrintOptionsTabPage() OUString SmPrintOptionsTabPage::GetAllStrings() { OUString sAllStrings; - OUString labels[] = { "label4", "label5", "label1", "label6" }; + OUString labels[] = { u"label4"_ustr, u"label5"_ustr, u"label1"_ustr, u"label6"_ustr }; for (const auto& label : labels) { @@ -227,7 +227,7 @@ OUString SmPrintOptionsTabPage::GetAllStrings() } OUString checkButton[] - = { "title", "text", "frame", "norightspaces", "saveonlyusedsymbols", "autoclosebrackets" }; + = { u"title"_ustr, u"text"_ustr, u"frame"_ustr, u"norightspaces"_ustr, u"saveonlyusedsymbols"_ustr, u"autoclosebrackets"_ustr }; for (const auto& check : checkButton) { @@ -235,7 +235,7 @@ OUString SmPrintOptionsTabPage::GetAllStrings() sAllStrings += pString->get_label() + " "; } - OUString radioButton[] = { "sizenormal", "sizescaled", "sizezoomed" }; + OUString radioButton[] = { u"sizenormal"_ustr, u"sizescaled"_ustr, u"sizezoomed"_ustr }; for (const auto& radio : radioButton) { @@ -406,12 +406,12 @@ void SmFontDialog::SetFont(const vcl::Font &rFont) } SmFontDialog::SmFontDialog(weld::Window * pParent, OutputDevice *pFntListDevice, bool bHideCheckboxes) - : GenericDialogController(pParent, "modules/smath/ui/fontdialog.ui", "FontDialog") - , m_xFontBox(m_xBuilder->weld_entry_tree_view("fontgrid", "font", "fonts")) - , m_xAttrFrame(m_xBuilder->weld_widget("attrframe")) - , m_xBoldCheckBox(m_xBuilder->weld_check_button("bold")) - , m_xItalicCheckBox(m_xBuilder->weld_check_button("italic")) - , m_xShowFont(new weld::CustomWeld(*m_xBuilder, "preview", m_aShowFont)) + : GenericDialogController(pParent, u"modules/smath/ui/fontdialog.ui"_ustr, u"FontDialog"_ustr) + , m_xFontBox(m_xBuilder->weld_entry_tree_view(u"fontgrid"_ustr, u"font"_ustr, u"fonts"_ustr)) + , m_xAttrFrame(m_xBuilder->weld_widget(u"attrframe"_ustr)) + , m_xBoldCheckBox(m_xBuilder->weld_check_button(u"bold"_ustr)) + , m_xItalicCheckBox(m_xBuilder->weld_check_button(u"italic"_ustr)) + , m_xShowFont(new weld::CustomWeld(*m_xBuilder, u"preview"_ustr, m_aShowFont)) { m_xFontBox->set_height_request_by_rows(8); @@ -458,8 +458,8 @@ class SaveDefaultsQuery : public weld::MessageDialogController { public: explicit SaveDefaultsQuery(weld::Widget* pParent) - : MessageDialogController(pParent, "modules/smath/ui/savedefaultsdialog.ui", - "SaveDefaultsDialog") + : MessageDialogController(pParent, u"modules/smath/ui/savedefaultsdialog.ui"_ustr, + u"SaveDefaultsDialog"_ustr) { } }; @@ -479,14 +479,14 @@ IMPL_LINK_NOARG( SmFontSizeDialog, DefaultButtonClickHdl, weld::Button&, void ) } SmFontSizeDialog::SmFontSizeDialog(weld::Window* pParent) - : GenericDialogController(pParent, "modules/smath/ui/fontsizedialog.ui", "FontSizeDialog") - , m_xBaseSize(m_xBuilder->weld_metric_spin_button("spinB_baseSize", FieldUnit::POINT)) - , m_xTextSize(m_xBuilder->weld_metric_spin_button("spinB_text", FieldUnit::PERCENT)) - , m_xIndexSize(m_xBuilder->weld_metric_spin_button("spinB_index", FieldUnit::PERCENT)) - , m_xFunctionSize(m_xBuilder->weld_metric_spin_button("spinB_function", FieldUnit::PERCENT)) - , m_xOperatorSize(m_xBuilder->weld_metric_spin_button("spinB_operator", FieldUnit::PERCENT)) - , m_xBorderSize(m_xBuilder->weld_metric_spin_button("spinB_limit", FieldUnit::PERCENT)) - , m_xDefaultButton(m_xBuilder->weld_button("default")) + : GenericDialogController(pParent, u"modules/smath/ui/fontsizedialog.ui"_ustr, u"FontSizeDialog"_ustr) + , m_xBaseSize(m_xBuilder->weld_metric_spin_button(u"spinB_baseSize"_ustr, FieldUnit::POINT)) + , m_xTextSize(m_xBuilder->weld_metric_spin_button(u"spinB_text"_ustr, FieldUnit::PERCENT)) + , m_xIndexSize(m_xBuilder->weld_metric_spin_button(u"spinB_index"_ustr, FieldUnit::PERCENT)) + , m_xFunctionSize(m_xBuilder->weld_metric_spin_button(u"spinB_function"_ustr, FieldUnit::PERCENT)) + , m_xOperatorSize(m_xBuilder->weld_metric_spin_button(u"spinB_operator"_ustr, FieldUnit::PERCENT)) + , m_xBorderSize(m_xBuilder->weld_metric_spin_button(u"spinB_limit"_ustr, FieldUnit::PERCENT)) + , m_xDefaultButton(m_xBuilder->weld_button(u"default"_ustr)) { m_xDefaultButton->connect_clicked(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl)); } @@ -582,18 +582,18 @@ IMPL_LINK_NOARG(SmFontTypeDialog, DefaultButtonClickHdl, weld::Button&, void) } SmFontTypeDialog::SmFontTypeDialog(weld::Window* pParent, OutputDevice *pFntListDevice) - : GenericDialogController(pParent, "modules/smath/ui/fonttypedialog.ui", "FontsDialog") + : GenericDialogController(pParent, u"modules/smath/ui/fonttypedialog.ui"_ustr, u"FontsDialog"_ustr) , pFontListDev(pFntListDevice) - , m_xMathFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("mathCB"))) - , m_xVariableFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("variableCB"))) - , m_xFunctionFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("functionCB"))) - , m_xNumberFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("numberCB"))) - , m_xTextFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("textCB"))) - , m_xSerifFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("serifCB"))) - , m_xSansFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("sansCB"))) - , m_xFixedFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("fixedCB"))) - , m_xMenuButton(m_xBuilder->weld_menu_button("modify")) - , m_xDefaultButton(m_xBuilder->weld_button("default")) + , m_xMathFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"mathCB"_ustr))) + , m_xVariableFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"variableCB"_ustr))) + , m_xFunctionFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"functionCB"_ustr))) + , m_xNumberFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"numberCB"_ustr))) + , m_xTextFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"textCB"_ustr))) + , m_xSerifFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"serifCB"_ustr))) + , m_xSansFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"sansCB"_ustr))) + , m_xFixedFont(new SmFontPickListBox(m_xBuilder->weld_combo_box(u"fixedCB"_ustr))) + , m_xMenuButton(m_xBuilder->weld_menu_button(u"modify"_ustr)) + , m_xDefaultButton(m_xBuilder->weld_button(u"default"_ustr)) { m_xDefaultButton->connect_clicked(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl)); m_xMenuButton->connect_selected(LINK(this, SmFontTypeDialog, MenuSelectHdl)); @@ -889,20 +889,20 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) } SmDistanceDialog::SmDistanceDialog(weld::Window *pParent) - : GenericDialogController(pParent, "modules/smath/ui/spacingdialog.ui", "SpacingDialog") - , m_xFrame(m_xBuilder->weld_frame("template")) - , m_xFixedText1(m_xBuilder->weld_label("label1")) - , m_xMetricField1(m_xBuilder->weld_metric_spin_button("spinbutton1", FieldUnit::CM)) - , m_xFixedText2(m_xBuilder->weld_label("label2")) - , m_xMetricField2(m_xBuilder->weld_metric_spin_button("spinbutton2", FieldUnit::CM)) - , m_xFixedText3(m_xBuilder->weld_label("label3")) - , m_xMetricField3(m_xBuilder->weld_metric_spin_button("spinbutton3", FieldUnit::CM)) - , m_xCheckBox1(m_xBuilder->weld_check_button("checkbutton")) - , m_xFixedText4(m_xBuilder->weld_label("label4")) - , m_xMetricField4(m_xBuilder->weld_metric_spin_button("spinbutton4", FieldUnit::CM)) - , m_xMenuButton(m_xBuilder->weld_menu_button("category")) - , m_xDefaultButton(m_xBuilder->weld_button("default")) - , m_xBitmap(m_xBuilder->weld_widget("image")) + : GenericDialogController(pParent, u"modules/smath/ui/spacingdialog.ui"_ustr, u"SpacingDialog"_ustr) + , m_xFrame(m_xBuilder->weld_frame(u"template"_ustr)) + , m_xFixedText1(m_xBuilder->weld_label(u"label1"_ustr)) + , m_xMetricField1(m_xBuilder->weld_metric_spin_button(u"spinbutton1"_ustr, FieldUnit::CM)) + , m_xFixedText2(m_xBuilder->weld_label(u"label2"_ustr)) + , m_xMetricField2(m_xBuilder->weld_metric_spin_button(u"spinbutton2"_ustr, FieldUnit::CM)) + , m_xFixedText3(m_xBuilder->weld_label(u"label3"_ustr)) + , m_xMetricField3(m_xBuilder->weld_metric_spin_button(u"spinbutton3"_ustr, FieldUnit::CM)) + , m_xCheckBox1(m_xBuilder->weld_check_button(u"checkbutton"_ustr)) + , m_xFixedText4(m_xBuilder->weld_label(u"label4"_ustr)) + , m_xMetricField4(m_xBuilder->weld_metric_spin_button(u"spinbutton4"_ustr, FieldUnit::CM)) + , m_xMenuButton(m_xBuilder->weld_menu_button(u"category"_ustr)) + , m_xDefaultButton(m_xBuilder->weld_button(u"default"_ustr)) + , m_xBitmap(m_xBuilder->weld_widget(u"image"_ustr)) , m_pCurrentImage(m_xBitmap.get()) { for (sal_uInt16 i = 0; i < NOCATEGORIES; ++i) @@ -1011,11 +1011,11 @@ IMPL_LINK_NOARG( SmAlignDialog, DefaultButtonClickHdl, weld::Button&, void ) } SmAlignDialog::SmAlignDialog(weld::Window* pParent) - : GenericDialogController(pParent, "modules/smath/ui/alignmentdialog.ui", "AlignmentDialog") - , m_xLeft(m_xBuilder->weld_radio_button("left")) - , m_xCenter(m_xBuilder->weld_radio_button("center")) - , m_xRight(m_xBuilder->weld_radio_button("right")) - , m_xDefaultButton(m_xBuilder->weld_button("default")) + : GenericDialogController(pParent, u"modules/smath/ui/alignmentdialog.ui"_ustr, u"AlignmentDialog"_ustr) + , m_xLeft(m_xBuilder->weld_radio_button(u"left"_ustr)) + , m_xCenter(m_xBuilder->weld_radio_button(u"center"_ustr)) + , m_xRight(m_xBuilder->weld_radio_button(u"right"_ustr)) + , m_xDefaultButton(m_xBuilder->weld_button(u"default"_ustr)) { m_xDefaultButton->connect_clicked(LINK(this, SmAlignDialog, DefaultButtonClickHdl)); } @@ -1413,18 +1413,18 @@ IMPL_LINK_NOARG(SmSymbolDialog, GetClickHdl, weld::Button&, void) SmSymbolDialog::SmSymbolDialog(weld::Window *pParent, OutputDevice *pFntListDevice, SmSymbolManager &rMgr, SmViewShell &rViewShell) - : GenericDialogController(pParent, "modules/smath/ui/catalogdialog.ui", "CatalogDialog") + : GenericDialogController(pParent, u"modules/smath/ui/catalogdialog.ui"_ustr, u"CatalogDialog"_ustr) , rViewSh(rViewShell) , rSymbolMgr(rMgr) , pFontListDev(pFntListDevice) , m_aSymbolDisplay(rViewShell) - , m_xSymbolSets(m_xBuilder->weld_combo_box("symbolset")) - , m_xSymbolSetDisplay(new SmShowSymbolSet(m_xBuilder->weld_scrolled_window("scrolledwindow", true), rViewShell)) - , m_xSymbolSetDisplayArea(new weld::CustomWeld(*m_xBuilder, "symbolsetdisplay", *m_xSymbolSetDisplay)) - , m_xSymbolName(m_xBuilder->weld_label("symbolname")) - , m_xSymbolDisplay(new weld::CustomWeld(*m_xBuilder, "preview", m_aSymbolDisplay)) - , m_xGetBtn(m_xBuilder->weld_button("ok")) - , m_xEditBtn(m_xBuilder->weld_button("edit")) + , m_xSymbolSets(m_xBuilder->weld_combo_box(u"symbolset"_ustr)) + , m_xSymbolSetDisplay(new SmShowSymbolSet(m_xBuilder->weld_scrolled_window(u"scrolledwindow"_ustr, true), rViewShell)) + , m_xSymbolSetDisplayArea(new weld::CustomWeld(*m_xBuilder, u"symbolsetdisplay"_ustr, *m_xSymbolSetDisplay)) + , m_xSymbolName(m_xBuilder->weld_label(u"symbolname"_ustr)) + , m_xSymbolDisplay(new weld::CustomWeld(*m_xBuilder, u"preview"_ustr, m_aSymbolDisplay)) + , m_xGetBtn(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xEditBtn(m_xBuilder->weld_button(u"edit"_ustr)) { m_xSymbolSets->make_sorted(); @@ -1715,7 +1715,7 @@ IMPL_LINK_NOARG(SmSymDefineDialog, CharHighlightHdl, SvxShowCharSet*, void) // display Unicode position as symbol name while iterating over characters const OUString aHex(OUString::number(cChar, 16).toAsciiUpperCase()); - const OUString aPattern( (aHex.getLength() > 4) ? OUString("Ux000000") : OUString("Ux0000") ); + const OUString aPattern( (aHex.getLength() > 4) ? u"Ux000000"_ustr : u"Ux0000"_ustr ); OUString aUnicodePos = aPattern.subView( 0, aPattern.getLength() - aHex.getLength() ) + aHex; m_xSymbols->set_entry_text(aUnicodePos); @@ -1844,28 +1844,28 @@ void SmSymDefineDialog::UpdateButtons() } SmSymDefineDialog::SmSymDefineDialog(weld::Window* pParent, OutputDevice *pFntListDevice, SmSymbolManager &rMgr) - : GenericDialogController(pParent, "modules/smath/ui/symdefinedialog.ui", "EditSymbols") + : GenericDialogController(pParent, u"modules/smath/ui/symdefinedialog.ui"_ustr, u"EditSymbols"_ustr) , m_xVirDev(VclPtr<VirtualDevice>::Create()) , m_rSymbolMgr(rMgr) , m_xFontList(new FontList(pFntListDevice)) - , m_xOldSymbols(m_xBuilder->weld_combo_box("oldSymbols")) - , m_xOldSymbolSets(m_xBuilder->weld_combo_box("oldSymbolSets")) - , m_xSymbols(m_xBuilder->weld_combo_box("symbols")) - , m_xSymbolSets(m_xBuilder->weld_combo_box("symbolSets")) - , m_xFonts(m_xBuilder->weld_combo_box("fonts")) - , m_xFontsSubsetLB(m_xBuilder->weld_combo_box("fontsSubsetLB")) - , m_xStyles(m_xBuilder->weld_combo_box("styles")) - , m_xOldSymbolName(m_xBuilder->weld_label("oldSymbolName")) - , m_xOldSymbolSetName(m_xBuilder->weld_label("oldSymbolSetName")) - , m_xSymbolName(m_xBuilder->weld_label("symbolName")) - , m_xSymbolSetName(m_xBuilder->weld_label("symbolSetName")) - , m_xAddBtn(m_xBuilder->weld_button("add")) - , m_xChangeBtn(m_xBuilder->weld_button("modify")) - , m_xDeleteBtn(m_xBuilder->weld_button("delete")) - , m_xOldSymbolDisplay(new weld::CustomWeld(*m_xBuilder, "oldSymbolDisplay", m_aOldSymbolDisplay)) - , m_xSymbolDisplay(new weld::CustomWeld(*m_xBuilder, "symbolDisplay", m_aSymbolDisplay)) - , m_xCharsetDisplay(new SvxShowCharSet(m_xBuilder->weld_scrolled_window("showscroll", true), m_xVirDev)) - , m_xCharsetDisplayArea(new weld::CustomWeld(*m_xBuilder, "charsetDisplay", *m_xCharsetDisplay)) + , m_xOldSymbols(m_xBuilder->weld_combo_box(u"oldSymbols"_ustr)) + , m_xOldSymbolSets(m_xBuilder->weld_combo_box(u"oldSymbolSets"_ustr)) + , m_xSymbols(m_xBuilder->weld_combo_box(u"symbols"_ustr)) + , m_xSymbolSets(m_xBuilder->weld_combo_box(u"symbolSets"_ustr)) + , m_xFonts(m_xBuilder->weld_combo_box(u"fonts"_ustr)) + , m_xFontsSubsetLB(m_xBuilder->weld_combo_box(u"fontsSubsetLB"_ustr)) + , m_xStyles(m_xBuilder->weld_combo_box(u"styles"_ustr)) + , m_xOldSymbolName(m_xBuilder->weld_label(u"oldSymbolName"_ustr)) + , m_xOldSymbolSetName(m_xBuilder->weld_label(u"oldSymbolSetName"_ustr)) + , m_xSymbolName(m_xBuilder->weld_label(u"symbolName"_ustr)) + , m_xSymbolSetName(m_xBuilder->weld_label(u"symbolSetName"_ustr)) + , m_xAddBtn(m_xBuilder->weld_button(u"add"_ustr)) + , m_xChangeBtn(m_xBuilder->weld_button(u"modify"_ustr)) + , m_xDeleteBtn(m_xBuilder->weld_button(u"delete"_ustr)) + , m_xOldSymbolDisplay(new weld::CustomWeld(*m_xBuilder, u"oldSymbolDisplay"_ustr, m_aOldSymbolDisplay)) + , m_xSymbolDisplay(new weld::CustomWeld(*m_xBuilder, u"symbolDisplay"_ustr, m_aSymbolDisplay)) + , m_xCharsetDisplay(new SvxShowCharSet(m_xBuilder->weld_scrolled_window(u"showscroll"_ustr, true), m_xVirDev)) + , m_xCharsetDisplayArea(new weld::CustomWeld(*m_xBuilder, u"charsetDisplay"_ustr, *m_xCharsetDisplay)) { // auto completion is troublesome since that symbols character also gets automatically selected in the // display and if the user previously selected a character to define/redefine that one this is bad diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 0f15e6049015..2c5334b89d49 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -97,7 +97,7 @@ SFX_IMPL_SUPERCLASS_INTERFACE(SmDocShell, SfxObjectShell) void SmDocShell::InitInterface_Impl() { - GetStaticInterface()->RegisterPopupMenu("view"); + GetStaticInterface()->RegisterPopupMenu(u"view"_ustr); } void SmDocShell::SetSmSyntaxVersion(sal_Int16 nSmSyntaxVersion) @@ -106,7 +106,7 @@ void SmDocShell::SetSmSyntaxVersion(sal_Int16 nSmSyntaxVersion) maParser.reset(starmathdatabase::GetVersionSmParser(mnSmSyntaxVersion)); } -SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), "smath" ) +SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), u"smath"_ustr ) void SmDocShell::Notify(SfxBroadcaster&, const SfxHint& rHint) { @@ -639,7 +639,7 @@ bool SmDocShell::ConvertFrom(SfxMedium &rMedium) if ( SotStorage::IsStorageFile( pStream ) ) { rtl::Reference<SotStorage> aStorage = new SotStorage(pStream, false); - if ( aStorage->IsStream("Equation Native") ) + if ( aStorage->IsStream(u"Equation Native"_ustr) ) { // is this a MathType Storage? OUStringBuffer aBuffer; @@ -684,7 +684,7 @@ bool SmDocShell::Load( SfxMedium& rMedium ) if( SfxObjectShell::Load( rMedium )) { uno::Reference < embed::XStorage > xStorage = GetMedium()->GetStorage(); - if (xStorage->hasByName("content.xml") && xStorage->isStreamElement("content.xml")) + if (xStorage->hasByName(u"content.xml"_ustr) && xStorage->isStreamElement(u"content.xml"_ustr)) { // is this a fabulous math package ? rtl::Reference<SmModel> xModel(dynamic_cast<SmModel*>(GetModel().get())); diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 464498262b2f..d0f25259f3a6 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -134,7 +134,7 @@ void SmEditTextWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) SmEditWindow::SmEditWindow(SmCmdBoxWindow &rMyCmdBoxWin, weld::Builder& rBuilder) : rCmdBox(rMyCmdBoxWin) - , mxScrolledWindow(rBuilder.weld_scrolled_window("scrolledwindow", true)) + , mxScrolledWindow(rBuilder.weld_scrolled_window(u"scrolledwindow"_ustr, true)) { mxScrolledWindow->connect_vadjustment_changed(LINK(this, SmEditWindow, ScrollHdl)); @@ -201,7 +201,7 @@ void SmEditTextWindow::StyleUpdated() pDoc->UpdateEditEngineDefaultFonts(); pEditEngine->SetBackgroundColor(rStyleSettings.GetFieldColor()); - pEditEngine->SetDefTab(sal_uInt16(GetTextWidth("XXXX"))); + pEditEngine->SetDefTab(sal_uInt16(GetTextWidth(u"XXXX"_ustr))); // forces new settings to be used // unfortunately this resets the whole edit engine @@ -424,7 +424,7 @@ void SmEditWindow::CreateEditView(weld::Builder& rBuilder) return; mxTextControl.reset(new SmEditTextWindow(*this)); - mxTextControlWin.reset(new weld::CustomWeld(rBuilder, "editview", *mxTextControl)); + mxTextControlWin.reset(new weld::CustomWeld(rBuilder, u"editview"_ustr, *mxTextControl)); SetScrollBarRanges(); } diff --git a/starmath/source/eqnolefilehdr.cxx b/starmath/source/eqnolefilehdr.cxx index d178e3d072c0..074fde684f0c 100644 --- a/starmath/source/eqnolefilehdr.cxx +++ b/starmath/source/eqnolefilehdr.cxx @@ -30,7 +30,7 @@ bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion ) // code snippet copied from MathType::Parse rtl::Reference<SotStorageStream> xSrc = pStor->OpenSotStream( - "Equation Native", + u"Equation Native"_ustr, StreamMode::STD_READ); if ( (!xSrc.is()) || (ERRCODE_NONE != xSrc->GetError())) return bSuccess; diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx index 60328c89dabf..30926f590831 100644 --- a/starmath/source/mathml/export.cxx +++ b/starmath/source/mathml/export.cxx @@ -121,20 +121,20 @@ bool SmMLExportWrapper::Export(SfxMedium& rMedium) // create XPropertySet with three properties for status indicator static const comphelper::PropertyMapEntry aInfoMap[]{ - { OUString("UsePrettyPrinting"), 0, cppu::UnoType<bool>::get(), + { u"UsePrettyPrinting"_ustr, 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(), + { u"BaseURI"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, + 0 }, + { u"StreamRelPath"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("StreamRelPath"), 0, ::cppu::UnoType<OUString>::get(), - beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("StreamName"), 0, ::cppu::UnoType<OUString>::get(), + { u"StreamName"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 } }; uno::Reference<beans::XPropertySet> xInfoSet( comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(aInfoMap))); // Always print pretty - xInfoSet->setPropertyValue("UsePrettyPrinting", Any(true)); + xInfoSet->setPropertyValue(u"UsePrettyPrinting"_ustr, Any(true)); // Set base URI xInfoSet->setPropertyValue(u"BaseURI"_ustr, Any(rMedium.GetBaseURL(true))); @@ -158,7 +158,7 @@ bool SmMLExportWrapper::Export(SfxMedium& rMedium) { OUString aName = pDocHierarchItem->GetValue(); if (!aName.isEmpty()) - xInfoSet->setPropertyValue("StreamRelPath", Any(aName)); + xInfoSet->setPropertyValue(u"StreamRelPath"_ustr, Any(aName)); } } else @@ -256,20 +256,20 @@ OUString SmMLExportWrapper::Export(SmMlElement* pElementTree) // create XPropertySet with three properties for status indicator static const comphelper::PropertyMapEntry aInfoMap[]{ - { OUString("UsePrettyPrinting"), 0, cppu::UnoType<bool>::get(), - beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(), + { u"UsePrettyPrinting"_ustr, 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("StreamRelPath"), 0, ::cppu::UnoType<OUString>::get(), + { u"BaseURI"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, + 0 }, + { u"StreamRelPath"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 }, - { OUString("StreamName"), 0, ::cppu::UnoType<OUString>::get(), + { u"StreamName"_ustr, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 } }; uno::Reference<beans::XPropertySet> xInfoSet( comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(aInfoMap))); // Always print pretty - xInfoSet->setPropertyValue("UsePrettyPrinting", Any(true)); + xInfoSet->setPropertyValue(u"UsePrettyPrinting"_ustr, Any(true)); // Fetch mathml tree m_pElementTree = pElementTree; @@ -382,13 +382,13 @@ bool SmMLExportWrapper::WriteThroughComponentS(const Reference<embed::XStorage>& // Set stream as text / xml uno::Reference<beans::XPropertySet> xSet(xStream, uno::UNO_QUERY); - xSet->setPropertyValue("MediaType", Any(u"text/xml"_ustr)); + xSet->setPropertyValue(u"MediaType"_ustr, Any(u"text/xml"_ustr)); // all streams must be encrypted in encrypted document - xSet->setPropertyValue("UseCommonStoragePasswordEncryption", Any(true)); + xSet->setPropertyValue(u"UseCommonStoragePasswordEncryption"_ustr, Any(true)); // set Base URL - rPropSet->setPropertyValue("StreamName", Any(OUString(pStreamName))); + rPropSet->setPropertyValue(u"StreamName"_ustr, Any(OUString(pStreamName))); // write the stuff // Note: export through an XML exporter component (output stream version) @@ -412,7 +412,7 @@ SmMLExportWrapper::WriteThroughComponentMS(const Reference<XComponent>& xCompone // Set the stream as text uno::Reference<beans::XPropertySet> xSet(xStream, uno::UNO_QUERY); - xSet->setPropertyValue("MediaType", Any(OUString("text/xml"))); + xSet->setPropertyValue(u"MediaType"_ustr, Any(u"text/xml"_ustr)); // write the stuff // Note: export through an XML exporter component (output stream version) @@ -436,7 +436,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_MLExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmMLExport(context, "com.sun.star.comp.Math.XMLExporter", + return cppu::acquire(new SmMLExport(context, u"com.sun.star.comp.Math.XMLExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::ALL)); } @@ -444,7 +444,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_MLOasisMetaExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmMLExport(context, "com.sun.star.comp.Math.XMLOasisMetaExporter", + return cppu::acquire(new SmMLExport(context, + u"com.sun.star.comp.Math.XMLOasisMetaExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::META)); } @@ -452,7 +453,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_MLOasisSettingsExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmMLExport(context, "com.sun.star.comp.Math.XMLOasisSettingsExporter", + return cppu::acquire(new SmMLExport(context, + u"com.sun.star.comp.Math.XMLOasisSettingsExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::SETTINGS)); } @@ -460,7 +462,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_MLContentExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmMLExport(context, "com.sun.star.comp.Math.XMLContentExporter", + return cppu::acquire(new SmMLExport(context, u"com.sun.star.comp.Math.XMLContentExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::CONTENT)); } @@ -762,7 +764,7 @@ void SmMLExport::exportMlAttributes(const SmMlElement* pMlElement) switch (aAttributeValue->m_aMathbackground) { case SmMlAttributeValueMathbackground::MlTransparent: - addAttribute(XML_MATHBACKGROUND, "transparent"); + addAttribute(XML_MATHBACKGROUND, u"transparent"_ustr); break; case SmMlAttributeValueMathbackground::MlRgb: { @@ -812,58 +814,58 @@ void SmMLExport::exportMlAttributes(const SmMlElement* pMlElement) switch (aAttributeValue->m_aMathvariant) { case SmMlAttributeValueMathvariant::normal: - addAttribute(XML_MATHVARIANT, "normal"); + addAttribute(XML_MATHVARIANT, u"normal"_ustr); break; case SmMlAttributeValueMathvariant::bold: - addAttribute(XML_MATHVARIANT, "bold"); + addAttribute(XML_MATHVARIANT, u"bold"_ustr); break; case SmMlAttributeValueMathvariant::italic: - addAttribute(XML_MATHVARIANT, "italic"); + addAttribute(XML_MATHVARIANT, u"italic"_ustr); break; case SmMlAttributeValueMathvariant::double_struck: - addAttribute(XML_MATHVARIANT, "double-struck"); + addAttribute(XML_MATHVARIANT, u"double-struck"_ustr); break; case SmMlAttributeValueMathvariant::script: - addAttribute(XML_MATHVARIANT, "script"); + addAttribute(XML_MATHVARIANT, u"script"_ustr); break; case SmMlAttributeValueMathvariant::fraktur: - addAttribute(XML_MATHVARIANT, "fraktur"); + addAttribute(XML_MATHVARIANT, u"fraktur"_ustr); break; case SmMlAttributeValueMathvariant::sans_serif: - addAttribute(XML_MATHVARIANT, "sans-serif"); + addAttribute(XML_MATHVARIANT, u"sans-serif"_ustr); break; case SmMlAttributeValueMathvariant::monospace: - addAttribute(XML_MATHVARIANT, "monospace"); + addAttribute(XML_MATHVARIANT, u"monospace"_ustr); break; case SmMlAttributeValueMathvariant::bold_italic: - addAttribute(XML_MATHVARIANT, "bold-italic"); + addAttribute(XML_MATHVARIANT, u"bold-italic"_ustr); break; case SmMlAttributeValueMathvariant::bold_fraktur: - addAttribute(XML_MATHVARIANT, "bold-fracktur"); + addAttribute(XML_MATHVARIANT, u"bold-fracktur"_ustr); break; case SmMlAttributeValueMathvariant::bold_script: - addAttribute(XML_MATHVARIANT, "bold-script"); + addAttribute(XML_MATHVARIANT, u"bold-script"_ustr); break; case SmMlAttributeValueMathvariant::bold_sans_serif: - addAttribute(XML_MATHVARIANT, "bold-sans-serif"); + addAttribute(XML_MATHVARIANT, u"bold-sans-serif"_ustr); break; case SmMlAttributeValueMathvariant::sans_serif_italic: - addAttribute(XML_MATHVARIANT, "sans-serif-italic"); + addAttribute(XML_MATHVARIANT, u"sans-serif-italic"_ustr); break; case SmMlAttributeValueMathvariant::sans_serif_bold_italic: - addAttribute(XML_MATHVARIANT, "sans-serif-bold-italic"); + addAttribute(XML_MATHVARIANT, u"sans-serif-bold-italic"_ustr); break; case SmMlAttributeValueMathvariant::initial: - addAttribute(XML_MATHVARIANT, "initial"); + addAttribute(XML_MATHVARIANT, u"initial"_ustr); break; case SmMlAttributeValueMathvariant::tailed: - addAttribute(XML_MATHVARIANT, "tailed"); + addAttribute(XML_MATHVARIANT, u"tailed"_ustr); break; case SmMlAttributeValueMathvariant::looped: - addAttribute(XML_MATHVARIANT, "looped"); + addAttribute(XML_MATHVARIANT, u"looped"_ustr); break; case SmMlAttributeValueMathvariant::stretched: - addAttribute(XML_MATHVARIANT, "stretched"); + addAttribute(XML_MATHVARIANT, u"stretched"_ustr); break; default: declareMlError(); diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx index 31d92a355cc7..8c057066ad00 100644 --- a/starmath/source/mathml/import.cxx +++ b/starmath/source/mathml/import.cxx @@ -142,7 +142,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium) // Set base URI // needed for relative URLs; but it's OK to import e.g. MathML from the clipboard without one SAL_INFO_IF(rMedium.GetBaseURL().isEmpty(), "starmath", "SmMLImportWrapper: no base URL"); - xInfoSet->setPropertyValue("BaseURI", Any(rMedium.GetBaseURL())); + xInfoSet->setPropertyValue(u"BaseURI"_ustr, Any(rMedium.GetBaseURL())); // Fetch progress range sal_Int32 nProgressRange(rMedium.IsStorage() ? 3 : 1); @@ -165,7 +165,7 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium) aName = pDocHierarchItem->GetValue(); if (!aName.isEmpty()) - xInfoSet->setPropertyValue("StreamRelPath", Any(aName)); + xInfoSet->setPropertyValue(u"StreamRelPath"_ustr, Any(aName)); } // Check if use OASIS ( new document format ) @@ -513,12 +513,12 @@ ErrCode SmMLImportWrapper::ReadThroughComponentS(const uno::Reference<embed::XSt // Determine if stream is encrypted or not uno::Reference<beans::XPropertySet> xProps(xEventsStream, uno::UNO_QUERY); - Any aAny = xProps->getPropertyValue("Encrypted"); + Any aAny = xProps->getPropertyValue(u"Encrypted"_ustr); bool bEncrypted = false; aAny >>= bEncrypted; // Set base URL and open stream - rPropSet->setPropertyValue("StreamName", Any(OUString(pStreamName))); + rPropSet->setPropertyValue(u"StreamName"_ustr, Any(OUString(pStreamName))); Reference<io::XInputStream> xStream = xEventsStream->getInputStream(); // Execute read @@ -592,14 +592,14 @@ Math_MLImporter_get_implementation(uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/) { return cppu::acquire( - new SmMLImport(pCtx, "com.sun.star.comp.Math.XMLImporter", SvXMLImportFlags::ALL)); + new SmMLImport(pCtx, u"com.sun.star.comp.Math.XMLImporter"_ustr, SvXMLImportFlags::ALL)); } extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* Math_MLOasisMetaImporter_get_implementation(uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/) { - return cppu::acquire(new SmMLImport(pCtx, "com.sun.star.comp.Math.XMLOasisMetaImporter", + return cppu::acquire(new SmMLImport(pCtx, u"com.sun.star.comp.Math.XMLOasisMetaImporter"_ustr, SvXMLImportFlags::META)); } @@ -607,8 +607,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* Math_MLOasisSettingsImporter_get_implementation(uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/) { - return cppu::acquire(new SmMLImport(pCtx, "com.sun.star.comp.Math.XMLOasisSettingsImporter", - SvXMLImportFlags::SETTINGS)); + return cppu::acquire(new SmMLImport( + pCtx, u"com.sun.star.comp.Math.XMLOasisSettingsImporter"_ustr, SvXMLImportFlags::SETTINGS)); } // SmMLImportContext diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index 1c18e716e7d6..9044c8ee0c90 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -298,7 +298,7 @@ bool SmXMLExportWrapper::WriteThroughComponent(const Reference<embed::XStorage>& // set Base URL if (rPropSet.is()) { - rPropSet->setPropertyValue("StreamName", Any(sStreamName)); + rPropSet->setPropertyValue(u"StreamName"_ustr, Any(sStreamName)); } // write the stuff @@ -320,7 +320,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmXMLExport(context, "com.sun.star.comp.Math.XMLExporter", + return cppu::acquire(new SmXMLExport(context, u"com.sun.star.comp.Math.XMLExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::ALL)); } @@ -328,15 +328,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLMetaExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire( - new SmXMLExport(context, "com.sun.star.comp.Math.XMLMetaExporter", SvXMLExportFlags::META)); + return cppu::acquire(new SmXMLExport(context, u"com.sun.star.comp.Math.XMLMetaExporter"_ustr, + SvXMLExportFlags::META)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLOasisMetaExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmXMLExport(context, "com.sun.star.comp.Math.XMLOasisMetaExporter", + return cppu::acquire(new SmXMLExport(context, + u"com.sun.star.comp.Math.XMLOasisMetaExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::META)); } @@ -344,15 +345,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLSettingsExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmXMLExport(context, "com.sun.star.comp.Math.XMLSettingsExporter", - SvXMLExportFlags::SETTINGS)); + return cppu::acquire(new SmXMLExport( + context, u"com.sun.star.comp.Math.XMLSettingsExporter"_ustr, SvXMLExportFlags::SETTINGS)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLOasisSettingsExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmXMLExport(context, "com.sun.star.comp.Math.XMLOasisSettingsExporter", + return cppu::acquire(new SmXMLExport(context, + u"com.sun.star.comp.Math.XMLOasisSettingsExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::SETTINGS)); } @@ -360,7 +362,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLContentExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new SmXMLExport(context, "com.sun.star.comp.Math.XMLContentExporter", + return cppu::acquire(new SmXMLExport(context, u"com.sun.star.comp.Math.XMLContentExporter"_ustr, SvXMLExportFlags::OASIS | SvXMLExportFlags::CONTENT)); } -e ... etc. - the rest is truncated
