diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-13 15:16:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-14 10:13:45 +0200 |
commit | b56ca52cef77d4d1f99bc3edd89b2557e5cb2cfb (patch) | |
tree | daf96725c04bcde4538a4861132967d634966601 /starmath/qa/cppunit | |
parent | 1d83ac544dcd2fbfb0aa19065e16ed82c40d0c86 (diff) |
loplugin:ostr in starmath
Change-Id: Ied15eb71ae3ae2d80ba839a6c99ea3cf620ca52f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167598
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'starmath/qa/cppunit')
-rw-r--r-- | starmath/qa/cppunit/test_cursor.cxx | 16 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_import.cxx | 2 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_node.cxx | 32 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_nodetotextvisitors.cxx | 24 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_parse.cxx | 10 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_starmath.cxx | 52 |
6 files changed, 68 insertions, 68 deletions
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(); |