diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-06 09:42:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-07 00:47:20 +0200 |
commit | e0c33ec15f53a01fa3ee07489871bbe09bb5c9c3 (patch) | |
tree | 1afe391a2b4bf9eda13de043658941060cb401c2 /sw/qa | |
parent | 9e3da252c361b3e2b04a2df7a3ae2a5177b37713 (diff) |
loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
47 files changed, 266 insertions, 267 deletions
diff --git a/sw/qa/core/crsr/crsr.cxx b/sw/qa/core/crsr/crsr.cxx index bf2a504b3304..72d271638d09 100644 --- a/sw/qa/core/crsr/crsr.cxx +++ b/sw/qa/core/crsr/crsr.cxx @@ -48,7 +48,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testFindReplace) xText->insertString(xText->getEnd(), "foo xxx", /*bAbsorb=*/false); xText->insertControlCharacter(xText->getEnd(), text::ControlCharacter::PARAGRAPH_BREAK, /*bAbsorb=*/false); - xText->insertString(xText->getEnd(), OUString(u"foo xxx \xad after"), /*bAbsorb=*/false); + xText->insertString(xText->getEnd(), u"foo xxx \xad after"_ustr, /*bAbsorb=*/false); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); @@ -150,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testContentControlReadOnly) uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); - xText->insertString(xCursor, u"☐", /*bAbsorb=*/false); + xText->insertString(xCursor, u"☐"_ustr, /*bAbsorb=*/false); xCursor->gotoStart(/*bExpand=*/false); xCursor->gotoEnd(/*bExpand=*/true); uno::Reference<text::XTextContent> xContentControl( diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 45198e0aaa9a..16aa73cd9823 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -1475,18 +1475,20 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testScriptinfosurrogatePairs) // Without the fix it fails with: // - Expected: 11 // - Actual : 11◌ - assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); + assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", + u"11"_ustr); assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", - u"\u25CC\U00010A01"); + u"\u25CC\U00010A01"_ustr); // Without the fix this would crash because we got a lone surrogate that // can’t be converted to UTF-8, but if it were not for that it might fail // with something like: // - Expected: 11 // - Actual : 11𝐀 - assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); + assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", + u"11"_ustr); assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", - u"\U0001D400\u064E"); + u"\U0001D400\u064E"_ustr); } CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594) @@ -1500,9 +1502,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594) // - Expected: 11 // - Actual : 11\u202F // (U+020F is a space, so might not be visible) - assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); + assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"_ustr); assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", - u"\u202F\u1824"); + u"\u202F\u1824"_ustr); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx index fc9ed7be9abe..4be895dd3f06 100644 --- a/sw/qa/core/theme/ThemeTest.cxx +++ b/sw/qa/core/theme/ThemeTest.cxx @@ -339,11 +339,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsDOCX) CPPUNIT_ASSERT(pModel); auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"Orange"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(model::ThemeColorType::Accent1)); CPPUNIT_ASSERT_EQUAL(Color(0xBD582C), pTheme->GetColor(model::ThemeColorType::Accent2)); @@ -357,18 +357,16 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsDOCX) CPPUNIT_ASSERT_EQUAL(Color(0xCCDDEA), pTheme->GetColor(model::ThemeColorType::Light2)); model::FontScheme const& rFontScheme = pTheme->getFontScheme(); - CPPUNIT_ASSERT_EQUAL(OUString(u"Calibri Light"), rFontScheme.getMajorLatin().maTypeface); - CPPUNIT_ASSERT_EQUAL(OUString(u"Calibri"), rFontScheme.getMinorLatin().maTypeface); + CPPUNIT_ASSERT_EQUAL(u"Calibri Light"_ustr, rFontScheme.getMajorLatin().maTypeface); + CPPUNIT_ASSERT_EQUAL(u"Calibri"_ustr, rFontScheme.getMinorLatin().maTypeface); CPPUNIT_ASSERT_EQUAL(true, rFontScheme.getMajorAsian().maTypeface.isEmpty()); CPPUNIT_ASSERT_EQUAL(true, rFontScheme.getMinorAsian().maTypeface.isEmpty()); CPPUNIT_ASSERT_EQUAL(true, rFontScheme.getMajorComplex().maTypeface.isEmpty()); CPPUNIT_ASSERT_EQUAL(true, rFontScheme.getMinorComplex().maTypeface.isEmpty()); CPPUNIT_ASSERT_EQUAL(size_t(47), rFontScheme.getMajorSupplementalFontList().size()); CPPUNIT_ASSERT_EQUAL(size_t(47), rFontScheme.getMinorSupplementalFontList().size()); - CPPUNIT_ASSERT_EQUAL(OUString(u"Angsana New"), - rFontScheme.findMajorSupplementalTypeface(u"Thai")); - CPPUNIT_ASSERT_EQUAL(OUString(u"Cordia New"), - rFontScheme.findMinorSupplementalTypeface(u"Thai")); + CPPUNIT_ASSERT_EQUAL(u"Angsana New"_ustr, rFontScheme.findMajorSupplementalTypeface(u"Thai")); + CPPUNIT_ASSERT_EQUAL(u"Cordia New"_ustr, rFontScheme.findMinorSupplementalTypeface(u"Thai")); model::FormatScheme const& rFormatScheme = pTheme->getFormatScheme(); checkFillStyles(rFormatScheme.getFillStyleList()); @@ -387,11 +385,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExistsODT) CPPUNIT_ASSERT(pModel); auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"Orange"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(model::ThemeColorType::Accent1)); CPPUNIT_ASSERT_EQUAL(Color(0xBD582C), pTheme->GetColor(model::ThemeColorType::Accent2)); @@ -419,11 +417,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging) { auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"Orange"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(model::ThemeColorType::Accent1)); } @@ -432,7 +430,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging) auto const& rColorSets = svx::ColorSets::get(); auto pNewColorSet = std::make_shared<model::ColorSet>(rColorSets.getColorSet(0)); // check that the theme colors are as expected - CPPUNIT_ASSERT_EQUAL(OUString(u"LibreOffice"), pNewColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pNewColorSet->getName()); sw::ThemeColorChanger aChanger(pDoc->GetDocShell()); aChanger.apply(pNewColorSet); @@ -442,11 +440,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging) { auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"LibreOffice"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0x18A303), pTheme->GetColor(model::ThemeColorType::Accent1)); } @@ -457,11 +455,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging) { auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"Orange"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(model::ThemeColorType::Accent1)); } @@ -472,11 +470,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging) { auto const& pTheme = pModel->getTheme(); CPPUNIT_ASSERT(pTheme); - CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(u"Office Theme"_ustr, pTheme->GetName()); auto pColorSet = pTheme->getColorSet(); CPPUNIT_ASSERT(pColorSet); - CPPUNIT_ASSERT_EQUAL(OUString(u"LibreOffice"), pColorSet->getName()); + CPPUNIT_ASSERT_EQUAL(u"LibreOffice"_ustr, pColorSet->getName()); CPPUNIT_ASSERT_EQUAL(Color(0x18A303), pTheme->GetColor(model::ThemeColorType::Accent1)); } } diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index 8715a4868f30..90970b6f680b 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -466,8 +466,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlCheckbox) // An uncaught exception of type com.sun.star.beans.UnknownPropertyException xContentControlProps->setPropertyValue("Checkbox", uno::Any(true)); xContentControlProps->setPropertyValue("Checked", uno::Any(true)); - xContentControlProps->setPropertyValue("CheckedState", uno::Any(OUString(u"☒"))); - xContentControlProps->setPropertyValue("UncheckedState", uno::Any(OUString(u"☐"))); + xContentControlProps->setPropertyValue("CheckedState", uno::Any(u"☒"_ustr)); + xContentControlProps->setPropertyValue("UncheckedState", uno::Any(u"☐"_ustr)); xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // Then make sure that the specified properties are set: @@ -480,8 +480,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlCheckbox) std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.GetContentControl(); CPPUNIT_ASSERT(pContentControl->GetCheckbox()); CPPUNIT_ASSERT(pContentControl->GetChecked()); - CPPUNIT_ASSERT_EQUAL(OUString(u"☒"), pContentControl->GetCheckedState()); - CPPUNIT_ASSERT_EQUAL(OUString(u"☐"), pContentControl->GetUncheckedState()); + CPPUNIT_ASSERT_EQUAL(u"☒"_ustr, pContentControl->GetCheckedState()); + CPPUNIT_ASSERT_EQUAL(u"☐"_ustr, pContentControl->GetUncheckedState()); } CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlDropdown) diff --git a/sw/qa/extras/accessibility/basics.cxx b/sw/qa/extras/accessibility/basics.cxx index 8a42ae8ce6bc..6bdd992c22d0 100644 --- a/sw/qa/extras/accessibility/basics.cxx +++ b/sw/qa/extras/accessibility/basics.cxx @@ -18,7 +18,7 @@ using namespace css; CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestBasicStructure) { - loadFromSrc(u"/sw/qa/python/testdocuments/xtextcontent.odt"); + loadFromSrc(u"/sw/qa/python/testdocuments/xtextcontent.odt"_ustr); auto xContext = getDocumentAccessibleContext(); CPPUNIT_ASSERT(xContext.is()); @@ -38,7 +38,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestBasicStructure) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestTypeSimple) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto xContext = getDocumentAccessibleContext(); CPPUNIT_ASSERT(xContext.is()); @@ -54,7 +54,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestTypeSimple) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestTypeMultiPara) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto xContext = getDocumentAccessibleContext(); CPPUNIT_ASSERT(xContext.is()); @@ -72,14 +72,14 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestTypeMultiPara) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestMenuInsertPageNumber) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Field", u"Page Number")); CPPUNIT_ASSERT_EQUAL(rtl::OUString("<PARAGRAPH>1</PARAGRAPH>"), collectText()); } CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestMenuInsertPageBreak) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Field", u"Page Number")); CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Page Break")); diff --git a/sw/qa/extras/accessibility/dialogs.cxx b/sw/qa/extras/accessibility/dialogs.cxx index 7fd23ae2247d..a14eed6bdba3 100644 --- a/sw/qa/extras/accessibility/dialogs.cxx +++ b/sw/qa/extras/accessibility/dialogs.cxx @@ -22,7 +22,7 @@ using namespace css; CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Special Characters", [this](Dialog& dialog) { dumpA11YTree(dialog.getAccessible()->getAccessibleContext()); @@ -33,7 +33,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialo getFocusedObject(dialog.getAccessible())); // search for (c) symbol - dialog.postExtTextEventAsync(u"copyright"); + dialog.postExtTextEventAsync(u"copyright"_ustr); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(dialog.tabTo(accessibility::AccessibleRole::TABLE_CELL, u"©")); @@ -54,13 +54,13 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialo CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Special Character...")); CPPUNIT_ASSERT(dialogWaiter->waitEndDialog()); - CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"<PARAGRAPH>©</PARAGRAPH>"), collectText()); + CPPUNIT_ASSERT_EQUAL(u"<PARAGRAPH>©</PARAGRAPH>"_ustr, collectText()); } /* checks for the fix from https://gerrit.libreoffice.org/c/core/+/147660 */ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocus) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Special Characters", [](Dialog& dialog) { CPPUNIT_ASSERT(dialog.tabTo(accessibility::AccessibleRole::TABLE_CELL, u" ")); @@ -86,12 +86,12 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocu CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Special Character...")); CPPUNIT_ASSERT(dialogWaiter->waitEndDialog()); - CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"<PARAGRAPH>!</PARAGRAPH>"), collectText()); + CPPUNIT_ASSERT_EQUAL(u"<PARAGRAPH>!</PARAGRAPH>"_ustr, collectText()); } CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Hyperlink", [this](Dialog& dialog) { dumpA11YTree(dialog.getAccessible()->getAccessibleContext()); @@ -99,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) // Focus the URL box (should be default, but make sure we're on it) CPPUNIT_ASSERT(dialog.tabTo(accessibility::AccessibleRole::COMBO_BOX, u"URL:")); // Fill in an address - dialog.postExtTextEventAsync(u"https://libreoffice.org/"); + dialog.postExtTextEventAsync(u"https://libreoffice.org/"_ustr); // Validate the whole dialog dialog.postKeyEventAsync(0, awt::Key::RETURN); Scheduler::ProcessEventsToIdle(); @@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Bookmark", [this](Dialog& dialog) { dumpA11YTree(dialog.getAccessible()->getAccessibleContext()); @@ -123,7 +123,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) CPPUNIT_ASSERT(dialog.tabTo(accessibility::AccessibleRole::TEXT, u"Name:")); dialog.postKeyEventAsync(0, awt::Key::SELECT_ALL); dialog.postKeyEventAsync(0, awt::Key::DELETE); - dialog.postExtTextEventAsync(u"Test Bookmark 1"); + dialog.postExtTextEventAsync(u"Test Bookmark 1"_ustr); // Validate the whole dialog dialog.postKeyEventAsync(0, awt::Key::RETURN); Scheduler::ProcessEventsToIdle(); @@ -139,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Insert Section", [this](Dialog& dialog) { dumpA11YTree(dialog.getAccessible()->getAccessibleContext()); @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Fontwork Gallery", [this](Dialog& dialog) { dumpA11YTree(dialog.getAccessible()->getAccessibleContext()); @@ -178,7 +178,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFrameDialog) { - load(u"private:factory/swriter"); + load(u"private:factory/swriter"_ustr); auto dialogWaiter = awaitDialog(u"Frame", [](Dialog& dialog) { // Validate the whole dialog diff --git a/sw/qa/extras/accessibility/tdf155705.cxx b/sw/qa/extras/accessibility/tdf155705.cxx index ebaf4600142a..c145c7b2c858 100644 --- a/sw/qa/extras/accessibility/tdf155705.cxx +++ b/sw/qa/extras/accessibility/tdf155705.cxx @@ -24,7 +24,7 @@ using namespace css; /* This test only works if spell checking is available for en_US */ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, tdf155705) { - loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/tdf155705.fodt"); + loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/tdf155705.fodt"_ustr); /* we need to give it a second to fully set up the XAccessibleTextMarkup, otherwise we get a * dysfunctional one that asserts out on m_pTextFrame */ diff --git a/sw/qa/extras/accessibility/unicode.cxx b/sw/qa/extras/accessibility/unicode.cxx index b4b2b5f6fc84..0130ee1dc48f 100644 --- a/sw/qa/extras/accessibility/unicode.cxx +++ b/sw/qa/extras/accessibility/unicode.cxx @@ -19,23 +19,23 @@ using namespace accessibility; // Checks fetching multi-unit characters CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestUnicodeSP) { - loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/unicode.fodf"); + loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/unicode.fodf"_ustr); auto xContext = getDocumentAccessibleContext()->getAccessibleChild(0)->getAccessibleContext(); uno::Reference<XAccessibleText> para(xContext, uno::UNO_QUERY_THROW); auto segment = para->getTextAtIndex(0, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u"\U0001f0a1"), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u"\U0001f0a1"_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), segment.SegmentEnd); segment = para->getTextBeforeIndex(2, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u"\U0001f0a1"), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u"\U0001f0a1"_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), segment.SegmentEnd); segment = para->getTextBehindIndex(0, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u"\U0001f0ae"), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u"\U0001f0ae"_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), segment.SegmentEnd); } @@ -43,7 +43,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestUnicodeSP) // Checks getTextBehindIndex() with multi-unit characters CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestUnicodeSPBehindIndex) { - loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/unicode.fodf"); + loadFromSrc(u"/sw/qa/extras/accessibility/testdocuments/unicode.fodf"_ustr); auto xContext = getDocumentAccessibleContext()->getAccessibleChild(0)->getAccessibleContext(); @@ -57,17 +57,17 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestUnicodeSPBehindIndex) lang::IndexOutOfBoundsException); auto segment = para->getTextBehindIndex(nChCount, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u""), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u""_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentEnd); segment = para->getTextBehindIndex(nChCount - 2, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u""), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u""_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentEnd); segment = para->getTextBehindIndex(nChCount - 4, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u"\U0001f0ab"), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u"\U0001f0ab"_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(8), segment.SegmentEnd); @@ -84,17 +84,17 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestUnicodeSPBehindIndex) lang::IndexOutOfBoundsException); segment = para->getTextBehindIndex(nChCount, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u""), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u""_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentEnd); segment = para->getTextBehindIndex(nChCount - 1, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u""), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u""_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), segment.SegmentEnd); segment = para->getTextBehindIndex(nChCount - 2, AccessibleTextType::CHARACTER); - CPPUNIT_ASSERT_EQUAL(OUString(u"j"), segment.SegmentText); + CPPUNIT_ASSERT_EQUAL(u"j"_ustr, segment.SegmentText); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), segment.SegmentStart); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), segment.SegmentEnd); } diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 3eb328f0b5cc..6928052169e6 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -1305,7 +1305,7 @@ CPPUNIT_TEST_FIXTURE(Test, testListLabelPDFExport) for (int i = 0; i < nChars; i++) aChars[i] = pPdfTextPage->getUnicode(i); OUString aText(aChars.data(), aChars.size()); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u0623\r\n.\r\n\u0623.\u0623\r\n.\r\n\u0623.\u0623.\u0623\r\n."), aText); + CPPUNIT_ASSERT_EQUAL(u"\u0623\r\n.\r\n\u0623.\u0623\r\n.\r\n\u0623.\u0623.\u0623\r\n."_ustr, aText); } // Parse the document again to get its raw content diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index bf6d29e91841..dbdf472ceff9 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -574,7 +574,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf83890, "tdf83890.odt") DECLARE_HTMLEXPORT_TEST(testExtbChars, "extb.html") { - OUString aExpected(u"\U00024b62"); + OUString aExpected(u"\U00024b62"_ustr); // Assert that UTF8 encoded non-BMP Unicode character is correct uno::Reference<text::XTextRange> xTextRange1 = getRun(getParagraph(1), 1); CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange1->getString()); @@ -2208,11 +2208,11 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTab) // - Expected: <nbsp><nbsp><space>first // - Actual : <tab><space>first // i.e. the leading tab was not replaced by 2 nbsps. - assertXPathContent(pXmlDoc, "//reqif-xhtml:p[1]", u"\xa0\xa0 first"); + assertXPathContent(pXmlDoc, "//reqif-xhtml:p[1]", u"\xa0\xa0 first"_ustr); // Test a leading tab that is not at the start of the paragraph: - assertXPathContent(pXmlDoc, "//reqif-xhtml:p[2]", u"\xa0\xa0\xa0\xa0 second"); + assertXPathContent(pXmlDoc, "//reqif-xhtml:p[2]", u"\xa0\xa0\xa0\xa0 second"_ustr); // Test a tab which is not leading: - assertXPathContent(pXmlDoc, "//reqif-xhtml:p[3]", u"thi \t rd"); + assertXPathContent(pXmlDoc, "//reqif-xhtml:p[3]", u"thi \t rd"_ustr); } CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTabHTML) @@ -2238,7 +2238,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testLeadingTabHTML) // - Expected: <newline><nbsp><nbsp><space>test // - Actual : <newline><tab><space>test // i.e. the leading tab was not replaced by 2 nbsps. - assertXPathContent(pHtmlDoc, "/html/body/p", SAL_NEWLINE_STRING u"\xa0\xa0 test"); + assertXPathContent(pHtmlDoc, "/html/body/p", SAL_NEWLINE_STRING u"\xa0\xa0 test"_ustr); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testClearingBreak) diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 34900529ada9..125143d6f581 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -151,7 +151,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testListStyleType) if (rProp.Name == "BulletChar") { // should be 'o'. - CPPUNIT_ASSERT_EQUAL(OUString(u"\uE009"), rProp.Value.get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"\uE009"_ustr, rProp.Value.get<OUString>()); bBulletFound = true; break; } @@ -516,7 +516,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testUTF16_nonBMP) { createSwWebDoc("emojis16BE.html"); // tdf#146173: non-BMP characters' surrogates didn't combine correctly - CPPUNIT_ASSERT_EQUAL(OUString(u"a text with emojis: 🌾 ☀👨🏼🌾🏃🏼♂️🤙🏽🔍"), + CPPUNIT_ASSERT_EQUAL(u"a text with emojis: 🌾 ☀👨🏼🌾🏃🏼♂️🤙🏽🔍"_ustr, getParagraph(1)->getString()); } diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 743b88d350ba..47f2eddbc42d 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3566,7 +3566,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf152413) // - Actual : 2 // - In <>, XPath '/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion' number of nodes is incorrect assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout/SwLinePortion", "portion", - u"صِرَ ٰطَ"); + u"صِرَ ٰطَ"_ustr); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125893) diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 0089601974e6..2b0881850207 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -604,19 +604,19 @@ DECLARE_SHELL_MAILMERGE_TEST(testBookmarkCondition, "bookmarkcondition.fodt", "b // check that conditions on sections and bookmarks are evaluated the same assertXPath(pLayout, "/root/page", 7); assertXPath(pLayout, "/root/page[1]/body/section", 1); - assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."); - assertXPath(pLayout, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend . "); + assertXPath(pLayout, "/root/page[1]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."_ustr); + assertXPath(pLayout, "/root/page[1]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend . "_ustr); assertXPath(pLayout, "/root/page[3]/body/section", 1); - assertXPath(pLayout, "/root/page[3]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."); - assertXPath(pLayout, "/root/page[3]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war schön . "); + assertXPath(pLayout, "/root/page[3]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."_ustr); + assertXPath(pLayout, "/root/page[3]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war schön . "_ustr); assertXPath(pLayout, "/root/page[5]/body/section", 1); assertXPath(pLayout, "/root/page[5]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", "In Paris war es erlebnisreich."); - assertXPath(pLayout, "/root/page[5]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war erlebnisreich . "); + assertXPath(pLayout, "/root/page[5]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war erlebnisreich . "_ustr); assertXPath(pLayout, "/root/page[7]/body/section", 3); - assertXPath(pLayout, "/root/page[7]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."); - assertXPath(pLayout, "/root/page[7]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."); - assertXPath(pLayout, "/root/page[7]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Paris war es erlebnisreich."); - assertXPath(pLayout, "/root/page[7]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend schön erlebnisreich . "); + assertXPath(pLayout, "/root/page[7]/body/section[1]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In den Bergen war es anstrengend."_ustr); + assertXPath(pLayout, "/root/page[7]/body/section[2]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Barcelona war es schön."_ustr); + assertXPath(pLayout, "/root/page[7]/body/section[3]/txt[1]/SwParaPortion/SwLineLayout", "portion", u"In Paris war es erlebnisreich."_ustr); + assertXPath(pLayout, "/root/page[7]/body/txt[5]/SwParaPortion/SwLineLayout", "portion", u"Mein Urlaub war anstrengend schön erlebnisreich . "_ustr); } DECLARE_SHELL_MAILMERGE_TEST_SELECTION(testTdf95292, "linked-labels.odt", "10-testing-addresses.ods", "testing-addresses", 5) diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 1c9d442e073b..48faa5ac5769 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -109,7 +109,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt") // (used from LibreOffice 6.1, and proposed for next ODF) OUString const aFieldTexts[] = { "A 2", "Az Isten", "Az 50-esek", "A 2018-asok", "Az egyebek", "A fejezetek", - u"Az „Őseinket...”", "a 2", + u"Az „Őseinket...”"_ustr, "a 2", "Az v", "az 1", "Az e)", "az 1", "Az (5)", "az 1", "A 2", "az 1" }; uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -219,7 +219,7 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt" { CPPUNIT_ASSERT_EQUAL(1, getPages()); // ordinal indicator, ordinal and cardinal number numbering styles (from LibreOffice 6.1) - OUString const aFieldTexts[] = { "1st", "Erste", "Eins", "1.", "Premier", "Un", u"1ᵉʳ", "First", "One" }; + OUString const aFieldTexts[] = { "1st", "Erste", "Eins", "1.", "Premier", "Un", u"1ᵉʳ"_ustr, "First", "One" }; // fallback for old platforms without std::codecvt and std::regex supports OUString const aFieldTextFallbacks[] = { "Ordinal-number 1", "Ordinal 1", "1" }; uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -572,7 +572,7 @@ DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt") // Without the fix, the text was unseen, with a tabstop width of 64057. It should be 3057 CPPUNIT_ASSERT(nTabStop < 4000); CPPUNIT_ASSERT(3000 < nTabStop); - CPPUNIT_ASSERT_EQUAL(OUString(u"Pečiatka zamestnávateľa"), parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[4]", "portion")); + CPPUNIT_ASSERT_EQUAL(u"Pečiatka zamestnávateľa"_ustr, parseDump("//body/txt[4]/SwParaPortion/SwLineLayout/child::*[4]", "portion")); // tdf#149547: __XXX___invalid CharacterStyles should not be imported/exported CPPUNIT_ASSERT(!getStyles("CharacterStyles")->hasByName("__XXX___invalid")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 4e8d2991d83b..4d5f56969272 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -303,7 +303,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx") CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextField.Database")); OUString sValue; xTextField->getPropertyValue("Content") >>= sValue; - CPPUNIT_ASSERT_EQUAL(OUString(u"«Name»"), sValue); + CPPUNIT_ASSERT_EQUAL(u"«Name»"_ustr, sValue); uno::Reference<beans::XPropertySet> xFiledMaster = xDependent->getTextFieldMaster(); uno::Reference<lang::XServiceInfo> xFiledMasterServiceInfo(xFiledMaster, uno::UNO_QUERY_THROW); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 243bfffb23c2..21e3a97c362e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -894,17 +894,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx") // The runs inside <w:dir> were ignored const OUString sParaText = getParagraph(1)->getString(); CPPUNIT_ASSERT_EQUAL( - OUString(u"عندما يريد العالم أن يتكلّم ، فهو يتحدّث " - u"بلغة " - u"يونيكود. تسجّل الآن لحضور المؤتمر الدولي العاشر " - u"ليونيكود (Unicode Conference)، الذي سيعقد في 10-12 " - u"آذار 1997 بمدينة مَايِنْتْس، ألمانيا. و سيجمع المؤتمر " - u"بين خبراء من كافة قطاعات الصناعة على الشبكة " - u"العالمية انترنيت ويونيكود، حيث ستتم، على الصعيدين " - u"الدولي والمحلي على حد سواء مناقشة سبل استخدام " - u"يونكود في النظم القائمة وفيما يخص التطبيقات " - u"الحاسوبية، الخطوط، تصميم النصوص والحوسبة متعددة " - u"اللغات."), + u"عندما يريد العالم أن يتكلّم ، فهو يتحدّث " + u"بلغة " + u"يونيكود. تسجّل الآن لحضور المؤتمر الدولي العاشر " + u"ليونيكود (Unicode Conference)، الذي سيعقد في 10-12 " + u"آذار 1997 بمدينة مَايِنْتْس، ألمانيا. و سيجمع المؤتمر " + u"بين خبراء من كافة قطاعات الصناعة على الشبكة " + u"العالمية انترنيت ويونيكود، حيث ستتم، على الصعيدين " + u"الدولي والمحلي على حد سواء مناقشة سبل استخدام " + u"يونكود في النظم القائمة وفيما يخص التطبيقات " + u"الحاسوبية، الخطوط، تصميم النصوص والحوسبة متعددة " + u"اللغات."_ustr, sParaText); } @@ -1017,7 +1017,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94628) ->Value.get<OUString>(); // Actually for 'BLACK UPPER RIGHT TRIANGLE' is \u25E5 // But we use Wingdings 3 font here, so code is different - CPPUNIT_ASSERT_EQUAL(OUString(u"\uF07B"), sBulletChar); + CPPUNIT_ASSERT_EQUAL(u"\uF07B"_ustr, sBulletChar); } DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx") @@ -1227,9 +1227,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf145720, "tdf104797.docx") // mandatory authors and dates assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", "author", - u"Tekijä"); + u"Tekijä"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveTo/w:moveToRangeStart", "author", - u"Tekijä"); + u"Tekijä"_ustr); // no date (anonymized change) // This failed, date was exported as w:date="0-00-00T00:00:00Z", and later "1970-01-01T00:00:00Z" assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFrom/w:moveFromRangeStart", diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 80243ba64a2d..eb78d7c470d0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -1171,7 +1171,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx") uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.CheckBox"))); - CPPUNIT_ASSERT_EQUAL(OUString(u"őőőőőőőőőőőűűűű"), getProperty<OUString>(xPropertySet, "Label")); + CPPUNIT_ASSERT_EQUAL(u"őőőőőőőőőőőűűűű"_ustr, getProperty<OUString>(xPropertySet, "Label")); } CPPUNIT_TEST_FIXTURE(Test, testTdf127116) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index eb26ce7763b8..dd0c1a75e48f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -972,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132766) // Ensure that for list=1 and level=0 we wrote correct bullet char and correct font assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:lvlText", - "val", u"\uF0B7"); + "val", u"\uF0B7"_ustr); assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts", "ascii", "Symbol"); assertXPath(pXmlDoc, "//w:numbering/w:abstractNum[@w:abstractNumId='1']/w:lvl[@w:ilvl='0']/w:rPr/w:rFonts", diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index e4eb392faf16..730afb8e5d12 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -1011,9 +1011,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150542) // Ensure that all docvars from input are written back and with correct values. // Order of document variables is not checked. So this can fail at some time if order is changed. assertXPath(pSettingsDoc, - "/w:settings/w:docVars/w:docVar[1]", "name", u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"); + "/w:settings/w:docVars/w:docVar[1]", "name", u"LocalChars\u00C1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0054\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070"_ustr); assertXPath(pSettingsDoc, - "/w:settings/w:docVars/w:docVar[1]", "val", u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"); + "/w:settings/w:docVars/w:docVar[1]", "val", u"Correct value (\u00E1\u0072\u0076\u00ED\u007A\u0074\u0075\u0072\u006F\u0020\u0074\u00FC\u006B\u00F6\u0072\u0066\u00FA\u0072\u00F3\u0067\u00E9\u0070)"_ustr); assertXPath(pSettingsDoc, "/w:settings/w:docVars/w:docVar[2]", "name", "DocVar1"); assertXPath(pSettingsDoc, diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 8473d8c6eb6b..90c3c750c53c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -47,7 +47,7 @@ public: DECLARE_OOXMLEXPORT_TEST(testTdf135164_cancelledNumbering, "tdf135164_cancelledNumbering.docx") { - uno::Reference<beans::XPropertySet> xPara(getParagraph(1, u"TBMM DÖNEMİ"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara(getParagraph(1, u"TBMM DÖNEMİ"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); xPara.set(getParagraph(2, "Numbering explicitly cancelled"), uno::UNO_QUERY); @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport) uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); - xText->insertString(xCursor, OUString(u"☐"), /*bAbsorb=*/false); + xText->insertString(xCursor, u"☐"_ustr, /*bAbsorb=*/false); xCursor->gotoStart(/*bExpand=*/false); xCursor->gotoEnd(/*bExpand=*/true); uno::Reference<text::XTextContent> xContentControl( @@ -292,8 +292,8 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport) uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY); xContentControlProps->setPropertyValue("Checkbox", uno::Any(true)); xContentControlProps->setPropertyValue("Checked", uno::Any(true)); - xContentControlProps->setPropertyValue("CheckedState", uno::Any(OUString(u"☒"))); - xContentControlProps->setPropertyValue("UncheckedState", uno::Any(OUString(u"☐"))); + xContentControlProps->setPropertyValue("CheckedState", uno::Any(u"☒"_ustr)); + xContentControlProps->setPropertyValue("UncheckedState", uno::Any(u"☐"_ustr)); xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to DOCX: @@ -1008,16 +1008,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146955) CPPUNIT_TEST_FIXTURE(Test, testTdf144668) { loadAndReload("tdf144668.odt"); - uno::Reference<beans::XPropertySet> xPara1(getParagraph(1, u"level1"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara1(getParagraph(1, u"level1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("[0001]"), getProperty<OUString>(xPara1, "ListLabelString")); - uno::Reference<beans::XPropertySet> xPara2(getParagraph(2, u"level2"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara2(getParagraph(2, u"level2"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("[001]"), getProperty<OUString>(xPara2, "ListLabelString")); } DECLARE_OOXMLEXPORT_TEST(testTdf148455_1, "tdf148455_1.docx") { - uno::Reference<beans::XPropertySet> xPara2(getParagraph(3, u"1.1.1"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara2(getParagraph(3, u"1.1.1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("1.1.1."), getProperty<OUString>(xPara2, "ListLabelString")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index bbcc40dde073..c25a9369bd94 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -386,42 +386,42 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153964_topMarginAfterBreak14, "tdf153964_topMarg uno::Reference<beans::XPropertySet> xPara(getParagraph(2, "a w:br at the start of the document. Does it use 60 point top margin?"), uno::UNO_QUERY); //CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); - xPara.set(getParagraph(3, u"60 pt spacing before"), uno::UNO_QUERY); + xPara.set(getParagraph(3, u"60 pt spacing before"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfbe4d5), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was applied to paragraph 3, so it shouldn't apply here - xPara.set(getParagraph(4, u"column break1"), uno::UNO_QUERY); + xPara.set(getParagraph(4, u"column break1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfbe4d5), getProperty<Color>(xPara, "ParaBackColor")); - xPara.set(getParagraph(5, u"60 pt followed by page break"), uno::UNO_QUERY); + xPara.set(getParagraph(5, u"60 pt followed by page break"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xdeeaf6), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was applied to paragraph 5, so it shouldn't apply here - xPara.set(getParagraph(6, u"page break1"), uno::UNO_QUERY); + xPara.set(getParagraph(6, u"page break1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xdeeaf6), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was not applied yet, so with compat14 it should apply here. - xPara.set(getParagraph(7, u"column break2"), uno::UNO_QUERY); + xPara.set(getParagraph(7, u"column break2"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xe2efd9), getProperty<Color>(xPara, "ParaBackColor")); // In an odd twist, the w:br was actually at the end of the previous w:p, so in that case // we ignore the top margin definition this time. - xPara.set(getParagraph(9, u"page break2"), uno::UNO_QUERY); + xPara.set(getParagraph(9, u"page break2"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); // The top margin was not applied before the column break, so with compat14 it should apply here - xPara.set(getParagraph(10, u""), uno::UNO_QUERY); // after column break + xPara.set(getParagraph(10, u""_ustr), uno::UNO_QUERY); // after column break CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfff2cc), getProperty<Color>(xPara, "ParaBackColor")); // In an odd twist, the w:br was actually at the end of the previous w:p, so in that case // we ignore the top margin definition this time. - xPara.set(getParagraph(12, u""), uno::UNO_QUERY); // after page break + xPara.set(getParagraph(12, u""_ustr), uno::UNO_QUERY); // after page break CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); } @@ -432,40 +432,40 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153964_topMarginAfterBreak15, "tdf153964_topMarg uno::Reference<beans::XPropertySet> xPara(getParagraph(2, "a w:br at the start of the document. Does it use 60 point top margin?"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); - xPara.set(getParagraph(3, u"60 pt spacing before"), uno::UNO_QUERY); + xPara.set(getParagraph(3, u"60 pt spacing before"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfbe4d5), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was applied to paragraph 3, so it shouldn't apply here - xPara.set(getParagraph(4, u"column break1"), uno::UNO_QUERY); + xPara.set(getParagraph(4, u"column break1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfbe4d5), getProperty<Color>(xPara, "ParaBackColor")); - xPara.set(getParagraph(5, u"60 pt followed by page break"), uno::UNO_QUERY); + xPara.set(getParagraph(5, u"60 pt followed by page break"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2117), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xdeeaf6), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was applied to paragraph 5, so it shouldn't apply here - xPara.set(getParagraph(6, u"page break1"), uno::UNO_QUERY); + xPara.set(getParagraph(6, u"page break1"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xdeeaf6), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was not applied to paragraph 6, and with compat15 it shouldn't apply here. - xPara.set(getParagraph(7, u"column break2"), uno::UNO_QUERY); + xPara.set(getParagraph(7, u"column break2"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xe2efd9), getProperty<Color>(xPara, "ParaBackColor")); // The top margin not was applied to paragraph 8, and with compat15 it shouldn't apply here. - xPara.set(getParagraph(9, u"page break2"), uno::UNO_QUERY); + xPara.set(getParagraph(9, u"page break2"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); // The top margin was not applied to paragraph 9, and with compat15 it shouldn't apply here. - xPara.set(getParagraph(10, u""), uno::UNO_QUERY); // after column break + xPara.set(getParagraph(10, u""_ustr), uno::UNO_QUERY); // after column break CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(Color(0xfff2cc), getProperty<Color>(xPara, "ParaBackColor")); // The top margin was not applied to paragraph 11, and with compat15 it shouldn't apply here. - xPara.set(getParagraph(12, u""), uno::UNO_QUERY); // after page break + xPara.set(getParagraph(12, u""_ustr), uno::UNO_QUERY); // after page break CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaTopMargin")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 960e29566d7e..eab98f97b2f7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -132,7 +132,7 @@ DECLARE_OOXMLEXPORT_TEST(testUTF8CustomProperties, "tdf127864.docx") = xDocumentPropertiesSupplier->getDocumentProperties(); uno::Reference<beans::XPropertySet> xPropertySet( xDocumentProperties->getUserDefinedProperties(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"первый"), getProperty<OUString>(xPropertySet, u"первый")); + CPPUNIT_ASSERT_EQUAL(u"первый"_ustr, getProperty<OUString>(xPropertySet, u"первый"_ustr)); } DECLARE_OOXMLEXPORT_TEST(testKeywords, "tdf143175.docx") @@ -303,12 +303,12 @@ DECLARE_OOXMLEXPORT_TEST(testMathD, "math-d.docx") DECLARE_OOXMLEXPORT_TEST(testMathEscaping, "math-escaping.docx") { - CHECK_FORMULA( u"\u2212 \u221E < x < \u221E", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( u"\u2212 \u221E < x < \u221E"_ustr, getFormula( getRun( getParagraph( 1 ), 1 ))); } DECLARE_OOXMLEXPORT_TEST(testMathLim, "math-lim.docx") { - CHECK_FORMULA( u"lim from {x \u2192 1} {x}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( u"lim from {x \u2192 1} {x}"_ustr, getFormula( getRun( getParagraph( 1 ), 1 ))); } DECLARE_OOXMLEXPORT_TEST(testMathMatrix, "math-matrix.docx") @@ -319,32 +319,32 @@ DECLARE_OOXMLEXPORT_TEST(testMathMatrix, "math-matrix.docx") CPPUNIT_TEST_FIXTURE(Test, testMathMso2k7) { loadAndReload("math-mso2k7.docx"); - CHECK_FORMULA( u"A = \u03C0 {r} ^ {2}", getFormula( getRun( getParagraph( 1 ), 1 ))); + CHECK_FORMULA( u"A = \u03C0 {r} ^ {2}"_ustr, getFormula( getRun( getParagraph( 1 ), 1 ))); // TODO check the stack/binom difference // CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (binom {n} {k} right ) {x} ^ {k} {a} ^ {n-k}}", CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (stack {n # k} right ) {x} ^ {k} {a} ^ {n-k}}", getFormula( getRun( getParagraph( 2 ), 1 ))); - CHECK_FORMULA( u"{left (1+x right )} ^ {n} =1+ {nx} over {1!} + {n left (n-1 right ) {x} ^ {2}} over {2!} +\u2026", + CHECK_FORMULA( u"{left (1+x right )} ^ {n} =1+ {nx} over {1!} + {n left (n-1 right ) {x} ^ {2}} over {2!} +\u2026"_ustr, getFormula( getRun( getParagraph( 3 ), 1 ))); // TODO check (cos/sin miss {}) // CHECK_FORMULA( "f left (x right ) = {a} rsub {0} + sum from {n=1} to {\xe2\x88\x9e} {left ({a} rsub {n} cos {{n\xcf\x80x} over {L}} + {b} rsub {n} sin {{n\xcf\x80x} over {L}} right )}", - CHECK_FORMULA( u"f left (x right ) = {a} rsub {0} + sum from {n=1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} over {L} right )}", + CHECK_FORMULA( u"f left (x right ) = {a} rsub {0} + sum from {n=1} to {\u221E} {left ({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} over {L} right )}"_ustr, getFormula( getRun( getParagraph( 4 ), 1 ))); CHECK_FORMULA( "{a} ^ {2} + {b} ^ {2} = {c} ^ {2}", getFormula( getRun( getParagraph( 5 ), 1 ))); - CHECK_FORMULA( u"x = {- b \u00B1 sqrt {{b} ^ {2} -4 ac}} over {2 a}", + CHECK_FORMULA( u"x = {- b \u00B1 sqrt {{b} ^ {2} -4 ac}} over {2 a}"_ustr, getFormula( getRun( getParagraph( 6 ), 1 ))); CHECK_FORMULA( - u"{e} ^ {x} =1+ {x} over {1!} + {{x} ^ {2}} over {2!} + {{x} ^ {3}} over {3!} +\u2026, -\u221E<x<\u221E", + u"{e} ^ {x} =1+ {x} over {1!} + {{x} ^ {2}} over {2!} + {{x} ^ {3}} over {3!} +\u2026, -\u221E<x<\u221E"_ustr, getFormula( getRun( getParagraph( 7 ), 1 ))); CHECK_FORMULA( // "sin {\xce\xb1} \xc2\xb1 sin {\xce\xb2} =2 sin {{1} over {2} left (\xce\xb1\xc2\xb1\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1\xe2\x88\x93\xce\xb2 right )}", // TODO check (cos/in miss {}) - u"sin \u03B1 \u00B1 sin \u03B2 =2 sin {1} over {2} left (\u03B1\u00B1\u03B2 right ) cos {1} over {2} left (\u03B1\u2213\u03B2 right )", + u"sin \u03B1 \u00B1 sin \u03B2 =2 sin {1} over {2} left (\u03B1\u00B1\u03B2 right ) cos {1} over {2} left (\u03B1\u2213\u03B2 right )"_ustr, getFormula( getRun( getParagraph( 8 ), 1 ))); CHECK_FORMULA( // "cos {\xce\xb1} + cos {\xce\xb2} =2 cos {{1} over {2} left (\xce\xb1+\xce\xb2 right )} cos {{1} over {2} left (\xce\xb1-\xce\xb2 right )}", // TODO check (cos/sin miss {}) - u"cos \u03B1 + cos \u03B2 =2 cos {1} over {2} left (\u03B1+\u03B2 right ) cos {1} over {2} left (\u03B1-\u03B2 right )", + u"cos \u03B1 + cos \u03B2 =2 cos {1} over {2} left (\u03B1+\u03B2 right ) cos {1} over {2} left (\u03B1-\u03B2 right )"_ustr, getFormula( getRun( getParagraph( 9 ), 1 ))); } @@ -641,7 +641,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStylerPrSz, "table-style-rPr-sz.docx") DECLARE_OOXMLEXPORT_TEST(testMathLiteral, "math-literal.docx") { - CHECK_FORMULA( u"iiint from {V} to <?> {\"div\" \"F\"} dV= llint from {S} to <?> {\"F\" \u2219 \"n \" dS}", + CHECK_FORMULA( u"iiint from {V} to <?> {\"div\" \"F\"} dV= llint from {S} to <?> {\"F\" \u2219 \"n \" dS}"_ustr, getFormula( getRun( getParagraph( 1 ), 1 ))); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index db2abe3513a7..ae1aa909d5fe 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1026,7 +1026,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFileOpenInputOutputError) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal"); // let's also assert that the formula was exported properly - assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t", u"\u03C3"); + assertXPathContent(pXmlDoc, "//w:tbl/w:tr/w:tc[2]/w:p/m:oMathPara/m:oMath/m:sSubSup/m:e/m:r/m:t", u"\u03C3"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testSingleCellTableBorders) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index a9742f1a3736..ce1645007d85 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -636,7 +636,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateControl) assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date", "fullDate", "2014-03-05T00:00:00Z"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:dateFormat", "val", "dddd, dd' de 'MMMM' de 'yyyy"); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:date/w:lid", "val", "es-ES"); - assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"); + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", u"mi\u00E9rcoles, 05 de marzo de 2014"_ustr); } CPPUNIT_TEST_FIXTURE(Test, test_Tdf115030) @@ -894,7 +894,7 @@ CPPUNIT_TEST_FIXTURE(Test, test_ClosingBrace) assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/m:oMath[1]/m:d[2]/m:dPr[1]/m:endChr[1]","val",""); // tdf#154371 paragraph style Подзаголовок ур3 inherits from Heading 3 (includes list level and list id) - uno::Reference<beans::XPropertySet> xParaStyle(getStyles("ParagraphStyles")->getByName(u"Подзаголовок ур3"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xParaStyle(getStyles("ParagraphStyles")->getByName(u"Подзаголовок ур3"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xParaStyle, "NumberingLevel")); CPPUNIT_ASSERT(!getProperty<OUString>(xParaStyle, "NumberingStyleName").isEmpty()); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index d97fd7c237d0..872c3055cb39 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -1380,7 +1380,7 @@ DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, "nonbmpchar.docx") { // Assert that UTF8 encoded non-BMP Unicode character is correct uno::Reference<text::XTextRange> xTextRange1 = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"\U00024b62"), xTextRange1->getString()); + CPPUNIT_ASSERT_EQUAL(u"\U00024b62"_ustr, xTextRange1->getString()); } CPPUNIT_TEST_FIXTURE(Test, testSpacingGroupShapeText) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 253c76c13818..39badeb658ca 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -525,7 +525,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo74357, "fdo74357.docx") DECLARE_OOXMLEXPORT_TEST(testFdo55187, "fdo55187.docx") { // 0x010d was imported as a newline. - getParagraph(1, OUString(u"lup\u010Dka")); + getParagraph(1, u"lup\u010Dka"_ustr); } DECLARE_OOXMLEXPORT_TEST(testN780563, "n780563.docx") @@ -814,7 +814,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo59638, "fdo59638.docx") if (rProp.Name == "BulletChar") { // Was '*', should be 'o'. - CPPUNIT_ASSERT_EQUAL(OUString(u"\uF0B7"), rProp.Value.get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"\uF0B7"_ustr, rProp.Value.get<OUString>()); return; } } diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index e31dc1222e52..21922f19e3f1 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -963,13 +963,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133647_unicode) xFields->nextElement(); uno::Reference<text::XTextField> xEnumerationAccess1(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"defined(預期結果)"), xEnumerationAccess1->getPresentation(true).trim()); + CPPUNIT_ASSERT_EQUAL(u"defined(預期結果)"_ustr, xEnumerationAccess1->getPresentation(true).trim()); uno::Reference<text::XTextField> xEnumerationAccess2(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"defined(نتيجةمتوقعة)"), xEnumerationAccess2->getPresentation(true).trim()); + CPPUNIT_ASSERT_EQUAL(u"defined(نتيجةمتوقعة)"_ustr, xEnumerationAccess2->getPresentation(true).trim()); uno::Reference<text::XTextField> xEnumerationAccess3(xFields->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"defined(ExpectedResult)"), xEnumerationAccess3->getPresentation(true).trim()); + CPPUNIT_ASSERT_EQUAL(u"defined(ExpectedResult)"_ustr, xEnumerationAccess3->getPresentation(true).trim()); } CPPUNIT_TEST_FIXTURE(Test, testTdf123389) diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 6edd873dc7ed..76210cd2ef20 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -694,13 +694,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf119200) createSwDoc("tdf119200.docx"); auto xPara = getParagraph(1); // Check that we import MathType functional symbols as symbols, not functions with missing args - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2208 } {}"), getFormula(getRun(xPara, 1))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2209 } {}"), getFormula(getRun(xPara, 2))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2282 } {}"), getFormula(getRun(xPara, 3))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2283 } {}"), getFormula(getRun(xPara, 4))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2284 } {}"), getFormula(getRun(xPara, 5))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2286 } {}"), getFormula(getRun(xPara, 6))); - CPPUNIT_ASSERT_EQUAL(OUString(u" size 12{ func \u2287 } {}"), getFormula(getRun(xPara, 7))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2208 } {}"_ustr, getFormula(getRun(xPara, 1))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2209 } {}"_ustr, getFormula(getRun(xPara, 2))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2282 } {}"_ustr, getFormula(getRun(xPara, 3))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2283 } {}"_ustr, getFormula(getRun(xPara, 4))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2284 } {}"_ustr, getFormula(getRun(xPara, 5))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2286 } {}"_ustr, getFormula(getRun(xPara, 6))); + CPPUNIT_ASSERT_EQUAL(u" size 12{ func \u2287 } {}"_ustr, getFormula(getRun(xPara, 7))); } CPPUNIT_TEST_FIXTURE(Test, testTdf115094) diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 66f2ad157bed..3759697475b1 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -211,14 +211,14 @@ CPPUNIT_TEST_FIXTURE(Test, testMathEscaping) { loadAndReload("math-escaping.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u00E1 \\{"), aActual); + CPPUNIT_ASSERT_EQUAL(u"\u00E1 \\{"_ustr, aActual); } CPPUNIT_TEST_FIXTURE(Test, testMathLim) { loadAndReload("math-lim.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"lim from {x \u2192 1} {x}"), aActual); + CPPUNIT_ASSERT_EQUAL(u"lim from {x \u2192 1} {x}"_ustr, aActual); } DECLARE_RTFEXPORT_TEST(testMathMatrix, "math-matrix.rtf") @@ -237,23 +237,23 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMso2007) { loadAndReload("math-mso2007.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); - OUString aExpected(u"A = \u03C0 {r} ^ {2}"); + OUString aExpected(u"A = \u03C0 {r} ^ {2}"_ustr); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(2), 1)); - aExpected = OUString(u"{left (x + a right )} ^ {n} = sum from {k = 0} to {n} {left (stack { n " - u"# k } right ) {x} ^ {k} {a} ^ {n \u2212 k}}"); + aExpected = u"{left (x + a right )} ^ {n} = sum from {k = 0} to {n} {left (stack { n " + u"# k } right ) {x} ^ {k} {a} ^ {n \u2212 k}}"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(3), 1)); - aExpected = OUString(u"{left (1 + x right )} ^ {n} = 1 + {nx} over {1 !} + {n left (n \u2212 1 " - u"right ) {x} ^ {2}} over {2 !} + \u2026"); + aExpected = u"{left (1 + x right )} ^ {n} = 1 + {nx} over {1 !} + {n left (n \u2212 1 " + u"right ) {x} ^ {2}} over {2 !} + \u2026"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(4), 1)); - aExpected = OUString(u"f left (x right ) = {a} rsub {0} + sum from {n = 1} to {\u221E} {left " - u"({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} " - u"over {L} right )}"); + aExpected = u"f left (x right ) = {a} rsub {0} + sum from {n = 1} to {\u221E} {left " + u"({a} rsub {n} cos {n\u03C0x} over {L} + {b} rsub {n} sin {n\u03C0x} " + u"over {L} right )}"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(5), 1)); @@ -261,22 +261,22 @@ CPPUNIT_TEST_FIXTURE(Test, testMathMso2007) CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(6), 1)); - aExpected = OUString(u"x = {\u2212 b \u00B1 sqrt {{b} ^ {2} \u2212 4 ac}} over {2 a}"); + aExpected = u"x = {\u2212 b \u00B1 sqrt {{b} ^ {2} \u2212 4 ac}} over {2 a}"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(7), 1)); - aExpected = OUString(u"{e} ^ {x} = 1 + {x} over {1 !} + {{x} ^ {2}} over {2 !} + {{x} ^ {3}} " - u"over {3 !} + \u2026 , \u2212 \u221E < x < \u221E"); + aExpected = u"{e} ^ {x} = 1 + {x} over {1 !} + {{x} ^ {2}} over {2 !} + {{x} ^ {3}} " + u"over {3 !} + \u2026 , \u2212 \u221E < x < \u221E"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(8), 1)); - aExpected = OUString(u"sin \u03B1 \u00B1 sin \u03B2 = 2 sin {1} over {2} left (\u03B1 \u00B1 " - u"\u03B2 right ) cos {1} over {2} left (\u03B1 \u2213 \u03B2 right )"); + aExpected = u"sin \u03B1 \u00B1 sin \u03B2 = 2 sin {1} over {2} left (\u03B1 \u00B1 " + u"\u03B2 right ) cos {1} over {2} left (\u03B1 \u2213 \u03B2 right )"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); aActual = getFormula(getRun(getParagraph(9), 1)); - aExpected = OUString(u"cos \u03B1 + cos \u03B2 = 2 cos {1} over {2} left (\u03B1 + \u03B2 " - u"right ) cos {1} over {2} left (\u03B1 \u2212 \u03B2 right )"); + aExpected = u"cos \u03B1 + cos \u03B2 = 2 cos {1} over {2} left (\u03B1 + \u03B2 " + u"right ) cos {1} over {2} left (\u03B1 \u2212 \u03B2 right )"_ustr; CPPUNIT_ASSERT_EQUAL(aExpected, aActual); } @@ -379,7 +379,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo77979) loadAndReload("fdo77979.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); // font name is encoded with \fcharset of font - CPPUNIT_ASSERT_EQUAL(OUString(u"\u5FAE\u8F6F\u96C5\u9ED1"), + CPPUNIT_ASSERT_EQUAL(u"\u5FAE\u8F6F\u96C5\u9ED1"_ustr, getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); } @@ -480,8 +480,7 @@ DECLARE_RTFEXPORT_TEST(testFdo61507, "fdo61507.rtf") mxComponent, uno::UNO_QUERY); uno::Reference<document::XDocumentProperties> xDocumentProperties( xDocumentPropertiesSupplier->getDocumentProperties()); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u00C9\u00C1\u0150\u0170\u222D"), - xDocumentProperties->getTitle()); + CPPUNIT_ASSERT_EQUAL(u"\u00C9\u00C1\u0150\u0170\u222D"_ustr, xDocumentProperties->getTitle()); // Only "Hello.", no additional characters. CPPUNIT_ASSERT_EQUAL(6, getLength()); @@ -514,8 +513,7 @@ DECLARE_RTFEXPORT_TEST(testMnor, "mnor.rtf") // \mnor wasn't handled, leading to missing quotes around "divF" and so on. OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL( - OUString( - u"iiint from {V} to <?> {\"divF\"} dV = llint from {S} to <?> {\"F\" \u2219 \"n\" dS}"), + u"iiint from {V} to <?> {\"divF\"} dV = llint from {S} to <?> {\"F\" \u2219 \"n\" dS}"_ustr, aActual); } diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 1998262deca4..6d5812abf47a 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -178,7 +178,7 @@ DECLARE_RTFEXPORT_TEST(testFdo79384, "fdo79384.rtf") { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"Маркеры спискамЫ"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"Маркеры спискамЫ"_ustr, xTextRange->getString()); } DECLARE_RTFEXPORT_TEST(testFdo47326, "fdo47326.rtf") @@ -227,7 +227,7 @@ DECLARE_RTFEXPORT_TEST(testFdo45394, "fdo45394.rtf") getStyles("PageStyles")->getByName("Standard"), "HeaderText"); OUString aActual = xHeaderText->getString(); // Encoding in the header was wrong. - CPPUNIT_ASSERT_EQUAL(OUString(u"\u041F\u041A \u0420\u0418\u041A"), aActual); + CPPUNIT_ASSERT_EQUAL(u"\u041F\u041A \u0420\u0418\u041A"_ustr, aActual); uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), @@ -295,7 +295,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo48023) // Implicit encoding detection based on locale was missing CPPUNIT_ASSERT_EQUAL( - OUString(u"\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0438\u0441\u0442"), + u"\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0438\u0441\u0442"_ustr, xTextRange->getString()); }; @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44211) auto verify = [this]() { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u0105\u010D\u0119"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u0105\u010D\u0119"_ustr, xTextRange->getString()); }; AllSettings aSavedSettings = Application::GetSettings(); @@ -513,7 +513,10 @@ DECLARE_RTFEXPORT_TEST(testFdo36089, "fdo36089.rtf") getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement")); } -DECLARE_RTFEXPORT_TEST(testFdo48446, "fdo48446.rtf") { getParagraph(1, u"\u0418\u043C\u044F"); } +DECLARE_RTFEXPORT_TEST(testFdo48446, "fdo48446.rtf") +{ + getParagraph(1, u"\u0418\u043C\u044F"_ustr); +} DECLARE_RTFEXPORT_TEST(testFdo47495, "fdo47495.rtf") { @@ -715,7 +718,7 @@ DECLARE_RTFEXPORT_TEST(testFdo56512, "fdo56512.rtf") uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference<text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u05E2\u05D5\u05E1\u05E7 \u05DE\u05D5\u05E8\u05E9\u05D4 "), + CPPUNIT_ASSERT_EQUAL(u"\u05E2\u05D5\u05E1\u05E7 \u05DE\u05D5\u05E8\u05E9\u05D4 "_ustr, xTextRange->getString()); } @@ -872,7 +875,7 @@ DECLARE_RTFEXPORT_TEST(testFdo59638, "fdo59638.rtf") if (rProp.Name == "BulletChar") { // Was '*', should be 'o'. - CPPUNIT_ASSERT_EQUAL(OUString(u"\uF0B7"), rProp.Value.get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"\uF0B7"_ustr, rProp.Value.get<OUString>()); return; } } diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 56ff343487ef..9547734711ea 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -119,7 +119,7 @@ DECLARE_RTFEXPORT_TEST(test148518, "FORMDROPDOWN.rtf") DECLARE_RTFEXPORT_TEST(test150269, "hidden-linebreaks.rtf") { - uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, u"\n\n\n"); + uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, u"\n\n\n"_ustr); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xRun, "CharHidden")); } @@ -633,37 +633,37 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreak) DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") { uno::Reference<text::XTextRange> xRun2 - = getRun(getParagraph(2), 1, u"\u0104\u012e\u0100\u0106\u00c4"); + = getRun(getParagraph(2), 1, u"\u0104\u012e\u0100\u0106\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun2, "CharFontName")); uno::Reference<text::XTextRange> xRun3 - = getRun(getParagraph(3), 1, u"\u0154\u00c1\u00c2\u0102\u00c4"); + = getRun(getParagraph(3), 1, u"\u0154\u00c1\u00c2\u0102\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun3, "CharFontName")); uno::Reference<text::XTextRange> xRun4 - = getRun(getParagraph(4), 1, u"\u0410\u0411\u0412\u0413\u0414"); + = getRun(getParagraph(4), 1, u"\u0410\u0411\u0412\u0413\u0414"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun4, "CharFontName")); uno::Reference<text::XTextRange> xRun5 - = getRun(getParagraph(5), 1, u"\u0390\u0391\u0392\u0393\u0394"); + = getRun(getParagraph(5), 1, u"\u0390\u0391\u0392\u0393\u0394"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun5, "CharFontName")); uno::Reference<text::XTextRange> xRun6 - = getRun(getParagraph(6), 1, u"\u00c0\u00c1\u00c2\u00c3\u00c4"); + = getRun(getParagraph(6), 1, u"\u00c0\u00c1\u00c2\u00c3\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun6, "CharFontName")); uno::Reference<text::XTextRange> xRun7 - = getRun(getParagraph(7), 1, u"\u05b0\u05b1\u05b2\u05b3\u05b4"); + = getRun(getParagraph(7), 1, u"\u05b0\u05b1\u05b2\u05b3\u05b4"_ustr); // Do not check font for Hebrew: it can be substituted by smth able to handle these chars //CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun7, "CharFontName")); uno::Reference<text::XTextRange> xRun8 - = getRun(getParagraph(8), 1, u"\u06c1\u0621\u0622\u0623\u0624"); + = getRun(getParagraph(8), 1, u"\u06c1\u0621\u0622\u0623\u0624"_ustr); // Do not check font for Arabic: it can be substituted by smth able to handle these chars //CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun8, "CharFontName")); uno::Reference<text::XTextRange> xRun9 - = getRun(getParagraph(9), 1, u"\u00c0\u00c1\u00c2\u0102\u00c4"); + = getRun(getParagraph(9), 1, u"\u00c0\u00c1\u00c2\u0102\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun9, "CharFontName")); // Ensure strange font remains strange. No reason to check content: in this case it can vary on locale @@ -672,22 +672,22 @@ DECLARE_RTFEXPORT_TEST(testTdf95706, "tdf95706.rtf") getProperty<OUString>(xRun10, "CharFontName")); uno::Reference<text::XTextRange> xRun12 - = getRun(getParagraph(12), 1, u"\u0390\u0391\u0392\u0393\u0394"); + = getRun(getParagraph(12), 1, u"\u0390\u0391\u0392\u0393\u0394"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun12, "CharFontName")); uno::Reference<text::XTextRange> xRun13 - = getRun(getParagraph(13), 1, u"\u0390\u0391\u0392\u0393\u0394"); + = getRun(getParagraph(13), 1, u"\u0390\u0391\u0392\u0393\u0394"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun13, "CharFontName")); uno::Reference<text::XTextRange> xRun14 = getRun(getParagraph(14), 1); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun14, "CharFontName")); uno::Reference<text::XTextRange> xRun15 - = getRun(getParagraph(15), 1, u"\u0104\u012e\u0100\u0106\u00c4"); + = getRun(getParagraph(15), 1, u"\u0104\u012e\u0100\u0106\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun15, "CharFontName")); uno::Reference<text::XTextRange> xRun16 - = getRun(getParagraph(16), 1, u"\u0104\u012e\u0100\u0106\u00c4"); + = getRun(getParagraph(16), 1, u"\u0104\u012e\u0100\u0106\u00c4"_ustr); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun16, "CharFontName")); } diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index c8b9ac0dc206..72efeee7ca76 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -64,7 +64,7 @@ DECLARE_RTFEXPORT_TEST(testFdo42109, "fdo42109.rtf") DECLARE_RTFEXPORT_TEST(testFdo62977, "fdo62977.rtf") { // The middle character was imported as '?' instead of the proper unicode value. - getRun(getParagraph(1), 1, OUString(u"\u5E74\uFF14\u6708")); + getRun(getParagraph(1), 1, u"\u5E74\uFF14\u6708"_ustr); } DECLARE_RTFEXPORT_TEST(testN818997, "n818997.rtf") @@ -146,7 +146,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153613_inlineAfterPgBreak2, "tdf153613_inlineAfter DECLARE_RTFEXPORT_TEST(testFdo64671, "fdo64671.rtf") { // Additional '}' was inserted before the special character. - getRun(getParagraph(1), 1, OUString(u"\u017D")); + getRun(getParagraph(1), 1, u"\u017D"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testFdo62044) @@ -283,7 +283,7 @@ DECLARE_RTFEXPORT_TEST(testFdo77996, "fdo77996.rtf") uno::Reference<document::XDocumentProperties> xProps( xDocumentPropertiesSupplier->getDocumentProperties()); CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); - OUString aTitle(u"\u53A6\u95E8\u94A8\u4E1A\u80A1\u4EFD\u6709\u9650\u516C\u53F8"); + OUString aTitle(u"\u53A6\u95E8\u94A8\u4E1A\u80A1\u4EFD\u6709\u9650\u516C\u53F8"_ustr); CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle()); uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); @@ -356,7 +356,7 @@ DECLARE_RTFEXPORT_TEST(testFdo44715, "fdo44715.rtf") DECLARE_RTFEXPORT_TEST(testFdo68076, "fdo68076.rtf") { // Encoding of the last char was wrong (more 'o' than 'y'). - getParagraph(1, u"\u041E\u0431\u044A\u0435\u043A\u0442 \u2013 \u0443"); + getParagraph(1, u"\u041E\u0431\u044A\u0435\u043A\u0442 \u2013 \u0443"_ustr); } DECLARE_RTFEXPORT_TEST(testFdo70221, "fdo70221.rtf") @@ -615,13 +615,14 @@ DECLARE_RTFEXPORT_TEST(testDprectAnchor, "dprect-anchor.rtf") DECLARE_RTFEXPORT_TEST(testFdo76628, "fdo76628.rtf") { // Should be 'SAMPLE' in Russian, was garbage. - getParagraph(1, u"\u041E\u0411\u0420\u0410\u0417\u0415\u0426"); + getParagraph(1, u"\u041E\u0411\u0420\u0410\u0417\u0415\u0426"_ustr); uno::Reference<text::XText> xHeaderText = getProperty<uno::Reference<text::XText>>( getStyles("PageStyles")->getByName("Standard"), "HeaderText"); // Should be 'prepared' in Russian, was garbage. - getParagraphOfText(1, xHeaderText, - u"\u041F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u043B\u0435\u043D\u043E"); + getParagraphOfText( + 1, xHeaderText, + u"\u041F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u043B\u0435\u043D\u043E"_ustr); } DECLARE_RTFEXPORT_TEST(testFdo77267, "fdo77267.rtf") diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx b/sw/qa/extras/rtfexport/rtfexport6.cxx index 13afa440cd2d..985dfd5ce4a9 100644 --- a/sw/qa/extras/rtfexport/rtfexport6.cxx +++ b/sw/qa/extras/rtfexport/rtfexport6.cxx @@ -49,27 +49,27 @@ DECLARE_RTFEXPORT_TEST(testFdo85889pc, "fdo85889-pc.rtf") { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u00B1\u2265\u2264"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2265\u2264"_ustr, xTextRange->getString()); } DECLARE_RTFEXPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf") { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u00B1\u2017\u00BE"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2017\u00BE"_ustr, xTextRange->getString()); } DECLARE_RTFEXPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf") { uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u00D2\u00DA\u00DB"), xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u00D2\u00DA\u00DB"_ustr, xTextRange->getString()); } CPPUNIT_TEST_FIXTURE(Test, testFdo72031) { auto verify = [this]() { - CPPUNIT_ASSERT_EQUAL(OUString(u"\uF0C5"), getRun(getParagraph(1), 1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"\uF0C5"_ustr, getRun(getParagraph(1), 1)->getString()); }; AllSettings aSavedSettings = Application::GetSettings(); @@ -179,14 +179,13 @@ DECLARE_RTFEXPORT_TEST(testTdf151370, "tdf151370.rtf") // Here we try to read/write docvar having non-ascii name and value. So it is encoded in Unicode OUString sFieldName(u"com.sun.star.text.fieldmaster.User." "LocalChars\u00c1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0054" - "\u00fc\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"); + "\u00fc\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"_ustr); CPPUNIT_ASSERT_EQUAL(sal_True, xTextFieldMasters->hasByName(sFieldName)); auto xFieldMaster = xTextFieldMasters->getByName(sFieldName); - CPPUNIT_ASSERT_EQUAL( - OUString(u"\u00e1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0074\u00fc" - "\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"), - getProperty<OUString>(xFieldMaster, "Content")); + CPPUNIT_ASSERT_EQUAL(u"\u00e1\u0072\u0076\u00ed\u007a\u0074\u0075\u0072\u006f\u0074\u00fc" + "\u006b\u00f6\u0072\u0066\u00fa\u0072\u00f3\u0067\u00e9\u0070"_ustr, + getProperty<OUString>(xFieldMaster, "Content")); } DECLARE_RTFEXPORT_TEST(testTdf108416, "tdf108416.rtf") @@ -657,7 +656,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf144437) DECLARE_RTFEXPORT_TEST(testTdf131234, "tdf131234.rtf") { - uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, OUString(u"Hello")); + uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, u"Hello"_ustr); // Ensure that text has default font attrs in spite of style referenced // E.g. 12pt, Times New Roman, black, no bold, no italic, no underline diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index d115dc4c75b1..78409762e827 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -269,8 +269,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo45182) uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes(); uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); // Encoding in the footnote was wrong. - CPPUNIT_ASSERT_EQUAL(OUString(u"\u017Eivnost\u00ED" SAL_NEWLINE_STRING), - xTextRange->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u017Eivnost\u00ED" SAL_NEWLINE_STRING ""_ustr, xTextRange->getString()); } CPPUNIT_TEST_FIXTURE(Test, testFdo85812) @@ -850,7 +849,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf105511) DefaultLocale::set("ru-RU", batch); batch->commit(); createSwDoc("tdf105511.rtf"); - getParagraph(1, u"\u0418\u043C\u044F"); + getParagraph(1, u"\u0418\u043C\u044F"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testContSectionPageBreak) diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 57d146edee3e..13a882b7f82f 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -1755,7 +1755,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testThemeViewSeparation) aValue.bIsVisible = true; aValue.nColor = aDarkColor; aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue); - aColorConfig.AddScheme(u"Dark"); + aColorConfig.AddScheme(u"Dark"_ustr); } // Add a minimal light scheme { @@ -1764,7 +1764,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testThemeViewSeparation) aValue.bIsVisible = true; aValue.nColor = COL_WHITE; aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue); - aColorConfig.AddScheme(u"Light"); + aColorConfig.AddScheme(u"Light"_ustr); } SwXTextDocument* pXTextDocument = createDoc(); int nFirstViewId = SfxLokHelper::getView(); diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx index 338af339884e..673e29ef62df 100644 --- a/sw/qa/extras/txtexport/txtexport.cxx +++ b/sw/qa/extras/txtexport/txtexport.cxx @@ -89,7 +89,7 @@ DECLARE_TXTEXPORT_TEST(testTdf120574_utf16lebom, "UTF16LEBOMCRLF.txt") { std::vector<sal_Unicode> aMemStream = readMemoryStream<sal_Unicode>(); OUString aData(aMemStream.data(), aMemStream.size()); - CPPUNIT_ASSERT_EQUAL(OUString(u"\uFEFFフー\r\nバー\r\n"), aData); + CPPUNIT_ASSERT_EQUAL(u"\uFEFFフー\r\nバー\r\n"_ustr, aData); } DECLARE_TXTEXPORT_TEST(testTdf142669_utf8, "UTF8CRLF.txt") @@ -103,7 +103,7 @@ DECLARE_TXTEXPORT_TEST(testTdf142669_utf16le, "UTF16LECRLF.txt") { std::vector<sal_Unicode> aMemStream = readMemoryStream<sal_Unicode>(); OUString aData(aMemStream.data(), aMemStream.size()); - CPPUNIT_ASSERT_EQUAL(OUString(u"フー\r\nバー\r\n"), aData); + CPPUNIT_ASSERT_EQUAL(u"フー\r\nバー\r\n"_ustr, aData); } CPPUNIT_TEST_FIXTURE(TxtExportTest, testClearingBreakExport) diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx index 410a9311621b..87bf86274b53 100644 --- a/sw/qa/extras/txtimport/txtimport.cxx +++ b/sw/qa/extras/txtimport/txtimport.cxx @@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withoutbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withbom) @@ -101,7 +101,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithoutbom) @@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithoutbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithbom) @@ -127,7 +127,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf92161_gb18030) @@ -140,7 +140,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf92161_gb18030) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"盖闻天地之数,有十二万九千六百岁为一元。"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"盖闻天地之数,有十二万九千六百岁为一元。"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithoutbom) @@ -153,7 +153,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithoutbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithbom) @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithbom) uno::Reference<text::XTextRange> xPara(getParagraph(1)); - CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(u"漢a'"_ustr, xPara->getString()); } CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf115088) diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 6d4e90ddad22..c7ed440795ac 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -416,7 +416,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFormulaNumberWithGroupSeparator) CPPUNIT_ASSERT_EQUAL(OUString("5000*10%"), pField->GetFormula()); CPPUNIT_ASSERT_EQUAL(OUString("500"), pField->ExpandField(true, nullptr)); pWrtShell->Down(false); - CPPUNIT_ASSERT_EQUAL(OUString(u"-100,00 €"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); + CPPUNIT_ASSERT_EQUAL(u"-100,00 €"_ustr, pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); pWrtShell->GoNextCell(); // tdf#42518 the problem was that this was 1.900,00 € CPPUNIT_ASSERT_EQUAL(OUString("** Expression is faulty **"), pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); @@ -557,7 +557,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf147220) SwDoc* pDoc = getSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Insert(u"él"); + pWrtShell->Insert(u"él"_ustr); // hide and enable dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -572,21 +572,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf147220) pWrtShell->GoEndSentence(); // this did not remove the original text from the layout - pWrtShell->Replace(u"Él", false); + pWrtShell->Replace(u"Él"_ustr, false); // currently the deleted text is before the replacement text, not sure if // that is really required - CPPUNIT_ASSERT_EQUAL(OUString(u"élÉl"), + CPPUNIT_ASSERT_EQUAL(u"élÉl"_ustr, pWrtShell->GetCursor()->GetPoint()->GetNode().GetTextNode()->GetText()); - CPPUNIT_ASSERT_EQUAL(OUString(u"Él"), + CPPUNIT_ASSERT_EQUAL(u"Él"_ustr, static_cast<SwTextFrame const*>(pWrtShell->GetCursor()->GetPoint()->GetNode().GetTextNode()->getLayoutFrame(nullptr))->GetText()); SwRedlineTable const& rRedlines(pDoc->getIDocumentRedlineAccess().GetRedlineTable()); CPPUNIT_ASSERT_EQUAL(SwRedlineTable::size_type(2), rRedlines.size()); CPPUNIT_ASSERT_EQUAL(RedlineType::Delete, rRedlines[0]->GetType()); - CPPUNIT_ASSERT_EQUAL(OUString(u"él"), rRedlines[0]->GetText()); + CPPUNIT_ASSERT_EQUAL(u"él"_ustr, rRedlines[0]->GetText()); CPPUNIT_ASSERT_EQUAL(RedlineType::Insert, rRedlines[1]->GetType()); - CPPUNIT_ASSERT_EQUAL(OUString(u"Él"), rRedlines[1]->GetText()); + CPPUNIT_ASSERT_EQUAL(u"Él"_ustr, rRedlines[1]->GetText()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf135978) diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index fad17768fec2..a32890dffcf0 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -217,7 +217,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineMoveInsertInDelete) CPPUNIT_ASSERT_EQUAL(OUString(" "), pWrtShell->GetCursor()->GetPoint()->GetNode().GetTextNode()->GetText()); pWrtShell->SetRedlineFlags(mode); // show again - CPPUNIT_ASSERT_EQUAL(OUString(u"\u0001 foo"), + CPPUNIT_ASSERT_EQUAL(u"\u0001 foo"_ustr, pWrtShell->GetCursor()->GetPoint()->GetNode().GetTextNode()->GetText()); } diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index a02ebf08c6a0..74221022bd6d 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -1855,7 +1855,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testRedlineAutoCorrect2) // Continue it: emulateTyping(*pTextDoc, u"Lorem,... "); - sReplaced = u"Lorem,... Lorem,… "; + sReplaced = u"Lorem,... Lorem,… "_ustr; CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); } @@ -1872,7 +1872,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testEmojiAutoCorrect) // without change tracking CPPUNIT_ASSERT(!(pWrtShell->GetRedlineFlags() & RedlineFlags::On)); emulateTyping(*pTextDoc, u":snowman:"); - OUString sReplaced = u"☃Lorem,"; + OUString sReplaced = u"☃Lorem,"_ustr; CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // with change tracking (showing redlines) @@ -1883,7 +1883,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testEmojiAutoCorrect) CPPUNIT_ASSERT(nMode & RedlineFlags::ShowDelete); emulateTyping(*pTextDoc, u":snowman:"); - sReplaced = u"☃☃Lorem,"; + sReplaced = u"☃☃Lorem,"_ustr; // tdf#140674 This was ":snowman:" instead of autocorrect CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); @@ -1899,7 +1899,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108423) // testing autocorrect of i' -> I' on start of first paragraph emulateTyping(*pTextDoc, u"i'"); // The word "i" should be capitalized due to autocorrect, followed by a typographical apostrophe - OUString sIApostrophe(u"I\u2019"); + OUString sIApostrophe(u"I\u2019"_ustr); CPPUNIT_ASSERT_EQUAL(sIApostrophe, getParagraph(1)->getString()); emulateTyping(*pTextDoc, u" i'"); OUString sText(sIApostrophe + u" " + sIApostrophe); @@ -1938,7 +1938,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf106164) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // testing autocorrect of we're -> We're on start of first paragraph emulateTyping(*pTextDoc, u"we're "); - CPPUNIT_ASSERT_EQUAL(OUString(u"We\u2019re "), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"We\u2019re "_ustr, getParagraph(1)->getString()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf54409) @@ -1950,7 +1950,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf54409) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // testing autocorrect of "tset -> "test with typographical double quotation mark U+201C emulateTyping(*pTextDoc, u"\"test "); - OUString sReplaced(u"\u201Ctest "); + OUString sReplaced(u"\u201Ctest "_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // testing autocorrect of test" -> test" with typographical double quotation mark U+201D emulateTyping(*pTextDoc, u"and tset\" "); @@ -1971,7 +1971,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf38394) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // testing autocorrect of French l'" -> l'« (instead of l'») emulateTyping(*pTextDoc, u"l'\""); - OUString sReplaced(u"l\u2019« "); + OUString sReplaced(u"l\u2019« "_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // tdf#132301 autocorrect of qu'« emulateTyping(*pTextDoc, u" qu'\""); @@ -1988,7 +1988,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf59666) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // testing missing autocorrect of single Greek letters emulateTyping(*pTextDoc, u"π "); - CPPUNIT_ASSERT_EQUAL(OUString(u"\u03C0 "), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"\u03C0 "_ustr, getParagraph(1)->getString()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524) @@ -2001,7 +2001,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524) // 1. Testing autocorrect of >> and << // Example: »word« emulateTyping(*pTextDoc, u">>"); - OUString sReplaced(u"»"); + OUString sReplaced(u"»"_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // << emulateTyping(*pTextDoc, u"word<<"); @@ -2061,7 +2061,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133524_Romanian) // Example: „Sentence and «word».” // opening primary level quote emulateTyping(*pTextDoc, u"\""); - OUString sReplaced(u"„"); + OUString sReplaced(u"„"_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // opening second level quote emulateTyping(*pTextDoc, u"Sentence and \""); @@ -2094,7 +2094,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf128860) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // Second level ending quote: ‚word' -> ,word‘ emulateTyping(*pTextDoc, u",word'"); - OUString sReplaced(u",word\u2019"); + OUString sReplaced(u",word\u2019"_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // Us apostrophe without preceding starting quote: word' -> word’ emulateTyping(*pTextDoc, u" word'"); @@ -2123,7 +2123,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf123786) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // Second level ending quote: „word' -> „word“ emulateTyping(*pTextDoc, u"„слово'"); - OUString sReplaced(u"„слово“"); + OUString sReplaced(u"„слово“"_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // Us apostrophe without preceding starting quote: word' -> word’ emulateTyping(*pTextDoc, u" слово'"); @@ -2145,7 +2145,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf133589) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // translitere words to Old Hungarian emulateTyping(*pTextDoc, u"székely "); - OUString sReplaced(u"𐳥𐳋𐳓𐳉𐳗 "); + OUString sReplaced(u"𐳥𐳋𐳓𐳉𐳗 "_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // disambiguate consonants: asszony -> asz|szony emulateTyping(*pTextDoc, u"asszony "); @@ -2383,11 +2383,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf143176) dispatchCommand(mxComponent, ".uno:AutoFormatApply", {}); // This was the original "Lorem ipsum..." - CPPUNIT_ASSERT_EQUAL(OUString(u"𐲖𐳛𐳢𐳉𐳘 𐳐𐳠𐳤𐳪𐳘 𐳇𐳛𐳖𐳛𐳢 " - u"𐳤𐳐𐳦 𐳀𐳘𐳉𐳦⹁"), + CPPUNIT_ASSERT_EQUAL(u"𐲖𐳛𐳢𐳉𐳘 𐳐𐳠𐳤𐳪𐳘 𐳇𐳛𐳖𐳛𐳢 " + u"𐳤𐳐𐳦 𐳀𐳘𐳉𐳦⹁"_ustr, getParagraph(1)->getString()); - CPPUNIT_ASSERT_EQUAL(OUString(u"𐳄𐳛𐳙𐳤𐳉𐳄𐳦𐳉𐳦𐳪𐳢 " - u"𐳀𐳇𐳐𐳠𐳐𐳤𐳄𐳐𐳙𐳍 𐳉𐳖𐳐𐳦."), + CPPUNIT_ASSERT_EQUAL(u"𐳄𐳛𐳙𐳤𐳉𐳄𐳦𐳉𐳦𐳪𐳢 " + u"𐳀𐳇𐳐𐳠𐳐𐳤𐳄𐳐𐳙𐳍 𐳉𐳖𐳐𐳦."_ustr, getParagraph(2)->getString()); } @@ -2713,7 +2713,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) // Without the fix in place, this would fail with // - Expected: Foo – 11’—’22 // - Actual : Foo – 11’--’22 - CPPUNIT_ASSERT_EQUAL(OUString(u"Foo – 11’—’22 "), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"Foo – 11’—’22 "_ustr, getParagraph(1)->getString()); } dispatchCommand(mxComponent, ".uno:SelectAll", {}); // start again @@ -2723,7 +2723,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) // Without the fix in place, this would fail with // - Expected: Bar – 111–222 // - Actual : Bar – 111-–22 - CPPUNIT_ASSERT_EQUAL(OUString(u"Bar – 111–222 "), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"Bar – 111–222 "_ustr, getParagraph(1)->getString()); } } diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 9185f58bec56..f29e75e8c65e 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -154,7 +154,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf79236) SwDoc* pDoc = getSwDoc(); sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); //Getting some paragraph style - SwTextFormatColl* pTextFormat = pDoc->FindTextFormatCollByName(u"Body Text"); + SwTextFormatColl* pTextFormat = pDoc->FindTextFormatCollByName(u"Body Text"_ustr); const SwAttrSet& rAttrSet = pTextFormat->GetAttrSet(); std::unique_ptr<SfxItemSet> pNewSet = rAttrSet.Clone(); sal_uInt16 initialCount = pNewSet->Count(); @@ -175,7 +175,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf79236) //Setting the updated item set on the style pDoc->ChgFormat(*pTextFormat, *pNewSet); //Checking the Changes - SwTextFormatColl* pTextFormat2 = pDoc->FindTextFormatCollByName(u"Body Text"); + SwTextFormatColl* pTextFormat2 = pDoc->FindTextFormatCollByName(u"Body Text"_ustr); const SwAttrSet& rAttrSet2 = pTextFormat2->GetAttrSet(); const SvxAdjustItem& rAdjustItem2 = rAttrSet2.GetAdjust(); SvxAdjust Adjust2 = rAdjustItem2.GetAdjust(); @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf79236) CPPUNIT_ASSERT_EQUAL(SvxAdjust::Right, Adjust2); //Undo the changes rUndoManager.Undo(); - SwTextFormatColl* pTextFormat3 = pDoc->FindTextFormatCollByName(u"Body Text"); + SwTextFormatColl* pTextFormat3 = pDoc->FindTextFormatCollByName(u"Body Text"_ustr); const SwAttrSet& rAttrSet3 = pTextFormat3->GetAttrSet(); const SvxAdjustItem& rAdjustItem3 = rAttrSet3.GetAdjust(); SvxAdjust Adjust3 = rAdjustItem3.GetAdjust(); @@ -191,7 +191,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf79236) CPPUNIT_ASSERT_EQUAL(SvxAdjust::Left, Adjust3); //Redo the changes rUndoManager.Redo(); - SwTextFormatColl* pTextFormat4 = pDoc->FindTextFormatCollByName(u"Body Text"); + SwTextFormatColl* pTextFormat4 = pDoc->FindTextFormatCollByName(u"Body Text"_ustr); const SwAttrSet& rAttrSet4 = pTextFormat4->GetAttrSet(); const SvxAdjustItem& rAdjustItem4 = rAttrSet4.GetAdjust(); SvxAdjust Adjust4 = rAdjustItem4.GetAdjust(); @@ -199,7 +199,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf79236) CPPUNIT_ASSERT_EQUAL(SvxAdjust::Right, Adjust4); //Undo the changes rUndoManager.Undo(); - SwTextFormatColl* pTextFormat5 = pDoc->FindTextFormatCollByName(u"Body Text"); + SwTextFormatColl* pTextFormat5 = pDoc->FindTextFormatCollByName(u"Body Text"_ustr); const SwAttrSet& rAttrSet5 = pTextFormat5->GetAttrSet(); const SvxAdjustItem& rAdjustItem5 = rAttrSet5.GetAdjust(); SvxAdjust Adjust5 = rAdjustItem5.GetAdjust(); @@ -2076,7 +2076,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf86639) createSwDoc("tdf86639.rtf"); SwDoc* pDoc = getSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - SwTextFormatColl* pColl = pDoc->FindTextFormatCollByName(u"Heading"); + SwTextFormatColl* pColl = pDoc->FindTextFormatCollByName(u"Heading"_ustr); pWrtShell->SetTextFormatColl(pColl); OUString aExpected = pColl->GetAttrSet().GetFont().GetFamilyName(); // This was Calibri, should be Liberation Sans. @@ -2414,8 +2414,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89954) SwNodeIndex aNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1); // Placeholder character for the comment anchor was ^A (CH_TXTATR_BREAKWORD), not <fff9> (CH_TXTATR_INWORD). // As a result, autocorrect did not turn the 't' input into 'T'. - CPPUNIT_ASSERT_EQUAL(OUString(u"Tes\uFFF9t. Test."), - aNodeIndex.GetNode().GetTextNode()->GetText()); + CPPUNIT_ASSERT_EQUAL(u"Tes\uFFF9t. Test."_ustr, aNodeIndex.GetNode().GetTextNode()->GetText()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf89720) diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index b4dbaa771593..d61bbf289663 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2625,7 +2625,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151801) SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); // Single starting quote: 'word -> ›word emulateTyping(*pTextDoc, u"'word"); - OUString sReplaced(u"\u203Aword"); + OUString sReplaced(u"\u203Aword"_ustr); CPPUNIT_ASSERT_EQUAL(sReplaced, getParagraph(1)->getString()); // Single ending quote: ›word' -> ›word‹ emulateTyping(*pTextDoc, u"'"); diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 51544b956abe..ef2142114872 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -617,7 +617,7 @@ DECLARE_WW8EXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.doc") CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextField.Database")); OUString sValue; xTextField->getPropertyValue("Content") >>= sValue; - CPPUNIT_ASSERT_EQUAL(OUString(u"«Name»"), sValue); + CPPUNIT_ASSERT_EQUAL(u"«Name»"_ustr, sValue); uno::Reference<beans::XPropertySet> xFiledMaster = xDependent->getTextFieldMaster(); uno::Reference<lang::XServiceInfo> xFiledMasterServiceInfo(xFiledMaster, uno::UNO_QUERY_THROW); diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 3f80ff8dcc9d..749297cf3049 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -879,7 +879,7 @@ CPPUNIT_TEST_FIXTURE(Test, testRtlGutter) DECLARE_WW8EXPORT_TEST(testTdf94326_notOutlineNumbering, "tdf94326_notOutlineNumbering.doc") { // The directly applied numbering list must not be lost. - uno::Reference<beans::XPropertySet> xPara(getParagraph(2, u"ОБЩИЕ ПОЛОЖЕНИЯ"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara(getParagraph(2, u"ОБЩИЕ ПОЛОЖЕНИЯ"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); } diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index 0d101f818acf..837f65c2e5ae 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -105,7 +105,7 @@ DECLARE_WW8EXPORT_TEST(testTdf90408B, "tdf90408B.doc") uno::Reference<beans::XPropertySet> xRun(getRun(xPara, 1), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("checkbox is 28pt", 28.f, getProperty<float>(xRun, "CharHeight")); - xRun.set(getRun(xPara, 2, u" Κατάψυξη, "), uno::UNO_QUERY_THROW); + xRun.set(getRun(xPara, 2, u" Κατάψυξη, "_ustr), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL_MESSAGE("text is 10pt", 10.f, getProperty<float>(xRun, "CharHeight")); } diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index ebd4e3d38d36..03c922a4c3f4 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -183,7 +183,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxSymbolFontExport) uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); - xText->insertString(xCursor, u"", true); + xText->insertString(xCursor, u""_ustr, true); uno::Reference<text::XTextRange> xRange = xCursor; uno::Reference<beans::XPropertySet> xTextProps(xRange, uno::UNO_QUERY); diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx index a2d9fdc37514..125a80584026 100644 --- a/sw/qa/uibase/wrtsh/wrtsh.cxx +++ b/sw/qa/uibase/wrtsh/wrtsh.cxx @@ -104,7 +104,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTickCheckboxContentControl) uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); - xText->insertString(xCursor, OUString(u"☒"), /*bAbsorb=*/false); + xText->insertString(xCursor, u"☒"_ustr, /*bAbsorb=*/false); xCursor->gotoStart(/*bExpand=*/false); xCursor->gotoEnd(/*bExpand=*/true); uno::Reference<text::XTextContent> xContentControl( @@ -112,8 +112,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTickCheckboxContentControl) uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY); xContentControlProps->setPropertyValue("Checkbox", uno::Any(true)); xContentControlProps->setPropertyValue("Checked", uno::Any(true)); - xContentControlProps->setPropertyValue("CheckedState", uno::Any(OUString(u"☒"))); - xContentControlProps->setPropertyValue("UncheckedState", uno::Any(OUString(u"☐"))); + xContentControlProps->setPropertyValue("CheckedState", uno::Any(u"☒"_ustr)); + xContentControlProps->setPropertyValue("UncheckedState", uno::Any(u"☐"_ustr)); xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When clicking on that content control: @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTickCheckboxContentControl) // - Expected: ☐ // - Actual : ☒ // i.e. the text node's text was "Ballot Box with X", not just "Ballot Box". - CPPUNIT_ASSERT_EQUAL(OUString(u"☐"), pTextNode->GetExpandText(pWrtShell->GetLayout())); + CPPUNIT_ASSERT_EQUAL(u"☐"_ustr, pTextNode->GetExpandText(pWrtShell->GetLayout())); } CPPUNIT_TEST_FIXTURE(Test, testInsertContentControl) |