include/svl/sigstruct.hxx | 4 svl/qa/unit/items/stylepool.cxx | 22 +- svl/qa/unit/items/test_IndexedStyleSheets.cxx | 28 +-- svl/qa/unit/lockfiles/test_lockfiles.cxx | 89 +++++------ svl/qa/unit/svl.cxx | 138 ++++++++--------- svl/qa/unit/test_INetContentType.cxx | 12 - svl/qa/unit/test_SvAddressParser.cxx | 34 ++-- svl/qa/unit/test_URIHelper.cxx | 24 +-- svl/qa/unit/test_lngmisc.cxx | 48 +++--- svl/source/config/asiancfg.cxx | 12 - svl/source/config/ctloptions.cxx | 14 - svl/source/crypto/cryptosign.cxx | 14 - svl/source/fsstor/fsfactory.cxx | 16 +- svl/source/fsstor/fsstorage.cxx | 24 +-- svl/source/items/cenumitm.cxx | 2 svl/source/items/itemprop.cxx | 2 svl/source/misc/documentlockfile.cxx | 6 svl/source/misc/fstathelper.cxx | 2 svl/source/misc/inettype.cxx | 162 ++++++++++----------- svl/source/misc/sharecontrolfile.cxx | 4 svl/source/misc/urihelper.cxx | 2 svl/source/numbers/numfmuno.cxx | 16 +- svl/source/numbers/supservs.cxx | 4 svl/source/numbers/zforfind.cxx | 10 - svl/source/numbers/zforlist.cxx | 10 - svl/source/numbers/zformat.cxx | 4 svl/source/numbers/zforscan.cxx | 106 ++++++------- svl/source/passwordcontainer/passwordcontainer.cxx | 40 ++--- svl/source/passwordcontainer/syscreds.cxx | 8 - svl/source/uno/pathservice.cxx | 4 30 files changed, 429 insertions(+), 432 deletions(-)
New commits: commit 320555963d69cbe19570a555a476d0ae757fef98 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 13 14:50:11 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 14 09:03:47 2024 +0200 loplugin:ostr in svl Change-Id: Idae670a53d6d9aab0ec7132077f3e7b7f6fa5287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167595 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 20cb0ebd2d0a..5b1609f7f9c1 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -53,9 +53,7 @@ struct SignatureReferenceInformation SignatureReferenceInformation() : nType(SignatureReferenceType::SAMEDOCUMENT), - ouURI(""), - nDigestID(css::xml::crypto::DigestID::SHA1), - ouDigestValue("") + nDigestID(css::xml::crypto::DigestID::SHA1) { } diff --git a/svl/qa/unit/items/stylepool.cxx b/svl/qa/unit/items/stylepool.cxx index 8ba33c1931de..ec82dbd72852 100644 --- a/svl/qa/unit/items/stylepool.cxx +++ b/svl/qa/unit/items/stylepool.cxx @@ -51,59 +51,59 @@ ItemInfoPackage& getItemInfoPackageTest() CPPUNIT_TEST_FIXTURE(StylePoolTest, testIterationOrder) { // Set up a style pool with multiple parents. - rtl::Reference<SfxItemPool> pPool = new SfxItemPool("test"); + rtl::Reference<SfxItemPool> pPool = new SfxItemPool(u"test"_ustr); pPool->registerItemInfoPackage(getItemInfoPackageTest()); { // Set up parents in mixed order to make sure we do not sort by pointer address. SfxItemSet aParent1(*pPool, svl::Items<1, 1>); SfxItemSet aChild1(*pPool, svl::Items<1, 1>); aChild1.SetParent(&aParent1); - SfxStringItem aItem1(1, "Item1"); + SfxStringItem aItem1(1, u"Item1"_ustr); aChild1.Put(aItem1); SfxItemSet aParent3(*pPool, svl::Items<1, 1>); SfxItemSet aChild3(*pPool, svl::Items<1, 1>); aChild3.SetParent(&aParent3); - SfxStringItem aItem3(1, "Item3"); + SfxStringItem aItem3(1, u"Item3"_ustr); aChild3.Put(aItem3); SfxItemSet aParent2(*pPool, svl::Items<1, 1>); SfxItemSet aChild2(*pPool, svl::Items<1, 1>); aChild2.SetParent(&aParent2); - SfxStringItem aItem2(1, "Item2"); + SfxStringItem aItem2(1, u"Item2"_ustr); aChild2.Put(aItem2); // Insert item sets in alphabetical order. StylePool aStylePool; - OUString aChild1Name("Child1"); + OUString aChild1Name(u"Child1"_ustr); aStylePool.insertItemSet(aChild1, &aChild1Name); - OUString aChild3Name("Child3"); + OUString aChild3Name(u"Child3"_ustr); aStylePool.insertItemSet(aChild3, &aChild3Name); - OUString aChild2Name("Child2"); + OUString aChild2Name(u"Child2"_ustr); aStylePool.insertItemSet(aChild2, &aChild2Name); std::unique_ptr<IStylePoolIteratorAccess> pIter = aStylePool.createIterator(); std::shared_ptr<SfxItemSet> pStyle1 = pIter->getNext(); CPPUNIT_ASSERT(pStyle1); const SfxStringItem* pItem1 = static_cast<const SfxStringItem*>(pStyle1->GetItem(1)); - CPPUNIT_ASSERT_EQUAL(OUString("Item1"), pItem1->GetValue()); + CPPUNIT_ASSERT_EQUAL(u"Item1"_ustr, pItem1->GetValue()); std::shared_ptr<SfxItemSet> pStyle2 = pIter->getNext(); CPPUNIT_ASSERT(pStyle2); const SfxStringItem* pItem2 = static_cast<const SfxStringItem*>(pStyle2->GetItem(1)); // Without the accompanying fix in place, this test would have failed with 'Expected: Item2; // Actual: Item3'. The iteration order depended on the pointer address on the pointer // address of the parents. - CPPUNIT_ASSERT_EQUAL(OUString("Item2"), pItem2->GetValue()); + CPPUNIT_ASSERT_EQUAL(u"Item2"_ustr, pItem2->GetValue()); std::shared_ptr<SfxItemSet> pStyle3 = pIter->getNext(); CPPUNIT_ASSERT(pStyle3); const SfxStringItem* pItem3 = static_cast<const SfxStringItem*>(pStyle3->GetItem(1)); - CPPUNIT_ASSERT_EQUAL(OUString("Item3"), pItem3->GetValue()); + CPPUNIT_ASSERT_EQUAL(u"Item3"_ustr, pItem3->GetValue()); CPPUNIT_ASSERT(!pIter->getNext()); } } CPPUNIT_TEST_FIXTURE(StylePoolTest, testFixedItemSet) { - rtl::Reference<SfxItemPool> pPool = new SfxItemPool("test"); + rtl::Reference<SfxItemPool> pPool = new SfxItemPool(u"test"_ustr); pPool->registerItemInfoPackage(getItemInfoPackageTest()); SfxItemSetFixed<1, 2> aItemSet1(*pPool); diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index 314ce263ecd7..37e741709558 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -76,8 +76,8 @@ void IndexedStyleSheetsTest::InstantiationWorks() void IndexedStyleSheetsTest::AddedStylesheetsCanBeFoundAndRetrievedByPosition() { - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1")); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2")); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(u"name1"_ustr)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(u"name2"_ustr)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); iss.AddStyleSheet(sheet2); @@ -88,7 +88,7 @@ void IndexedStyleSheetsTest::AddedStylesheetsCanBeFoundAndRetrievedByPosition() void IndexedStyleSheetsTest::AddingSameStylesheetTwiceHasNoEffect() { - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("sheet1")); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(u"sheet1"_ustr)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), iss.GetNumberOfStyleSheets()); @@ -98,8 +98,8 @@ void IndexedStyleSheetsTest::AddingSameStylesheetTwiceHasNoEffect() void IndexedStyleSheetsTest::RemovedStyleSheetIsNotFound() { - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1")); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2")); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(u"name1"_ustr)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(u"name2"_ustr)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); iss.AddStyleSheet(sheet2); @@ -110,8 +110,8 @@ void IndexedStyleSheetsTest::RemovedStyleSheetIsNotFound() void IndexedStyleSheetsTest::RemovingStyleSheetWhichIsNotAvailableHasNoEffect() { - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("sheet1")); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("sheet2")); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(u"sheet1"_ustr)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(u"sheet2"_ustr)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), iss.GetNumberOfStyleSheets()); @@ -121,8 +121,8 @@ void IndexedStyleSheetsTest::RemovingStyleSheetWhichIsNotAvailableHasNoEffect() void IndexedStyleSheetsTest::StyleSheetsCanBeRetrievedByTheirName() { - OUString name1("name1"); - OUString name2("name2"); + OUString name1(u"name1"_ustr); + OUString name2(u"name2"_ustr); rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1)); rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2)); rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name1)); @@ -149,7 +149,7 @@ void IndexedStyleSheetsTest::KnowsThatItStoresAStyleSheet() static constexpr OUString name1(u"name1"_ustr); rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1)); rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name1)); - rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet("name2")); + rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(u"name2"_ustr)); rtl::Reference<SfxStyleSheetBase> sheet4(new MockedStyleSheet(name1)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); @@ -167,9 +167,9 @@ void IndexedStyleSheetsTest::KnowsThatItStoresAStyleSheet() void IndexedStyleSheetsTest::PositionCanBeQueriedByFamily() { - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet("name1", SfxStyleFamily::Char)); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet("name2", SfxStyleFamily::Para)); - rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet("name3", SfxStyleFamily::Char)); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(u"name1"_ustr, SfxStyleFamily::Char)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(u"name2"_ustr, SfxStyleFamily::Para)); + rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(u"name3"_ustr, SfxStyleFamily::Char)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); @@ -185,7 +185,7 @@ void IndexedStyleSheetsTest::PositionCanBeQueriedByFamily() void IndexedStyleSheetsTest::OnlyOneStyleSheetIsReturnedWhenReturnFirstIsUsed() { - OUString name("name1"); + OUString name(u"name1"_ustr); rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name, SfxStyleFamily::Char)); rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name, SfxStyleFamily::Para)); rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name, SfxStyleFamily::Char)); diff --git a/svl/qa/unit/lockfiles/test_lockfiles.cxx b/svl/qa/unit/lockfiles/test_lockfiles.cxx index d66c301be4e7..7a55c731b203 100644 --- a/svl/qa/unit/lockfiles/test_lockfiles.cxx +++ b/svl/qa/unit/lockfiles/test_lockfiles.cxx @@ -107,7 +107,7 @@ void LockfileTest::testLOLockFileURL() OUString aTestODT = generateTestURL(u"testLOLockFileURL.odt"); svt::DocumentLockFile aLockFile(aTestODT); - CPPUNIT_ASSERT_EQUAL(OUString(".~lock.testLOLockFileURL.odt%23"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u".~lock.testLOLockFileURL.odt%23"_ustr, GetLockFileName(aLockFile)); } void LockfileTest::testLOLockFileContent() @@ -117,8 +117,8 @@ void LockfileTest::testLOLockFileContent() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and check the content svt::DocumentLockFile aLockFile(aTestODT); @@ -166,8 +166,8 @@ void LockfileTest::testLOLockFileRT() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::DocumentLockFile aLockFile(aTestODT); @@ -222,16 +222,16 @@ void LockfileTest::testLOLockFileOverwrite() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::DocumentLockFile aLockFile(aTestODT); aLockFile.CreateOwnLockFile(); // Change user name - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile2"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile2"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Overwrite lockfile svt::DocumentLockFile aLockFile2(aTestODT); @@ -261,56 +261,56 @@ void LockfileTest::testWordLockFileURL() { OUString aTestFile = generateTestURL(u"testWordLockFileURL.docx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$stWordLockFileURL.docx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$stWordLockFileURL.docx"_ustr, GetLockFileName(aLockFile)); } // Eight character file name (cuts two characters) { OUString aTestFile = generateTestURL(u"12345678.docx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$345678.docx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$345678.docx"_ustr, GetLockFileName(aLockFile)); } // Seven character file name (cuts one character) { OUString aTestFile = generateTestURL(u"1234567.docx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$234567.docx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$234567.docx"_ustr, GetLockFileName(aLockFile)); } // Six character file name (cuts no character) { OUString aTestFile = generateTestURL(u"123456.docx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$123456.docx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$123456.docx"_ustr, GetLockFileName(aLockFile)); } // One character file name { OUString aTestFile = generateTestURL(u"1.docx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$1.docx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$1.docx"_ustr, GetLockFileName(aLockFile)); } // Test for ODT format { OUString aTestFile = generateTestURL(u"12345678.odt"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$345678.odt"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$345678.odt"_ustr, GetLockFileName(aLockFile)); } // Test for DOC format { OUString aTestFile = generateTestURL(u"12345678.doc"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$345678.doc"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$345678.doc"_ustr, GetLockFileName(aLockFile)); } // Test for RTF format { OUString aTestFile = generateTestURL(u"12345678.rtf"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$345678.rtf"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$345678.rtf"_ustr, GetLockFileName(aLockFile)); } } @@ -320,28 +320,28 @@ void LockfileTest::testExcelLockFileURL() { OUString aTestFile = generateTestURL(u"testExcelLockFileURL.xlsx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$testExcelLockFileURL.xlsx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$testExcelLockFileURL.xlsx"_ustr, GetLockFileName(aLockFile)); } // Eight character file name { OUString aTestFile = generateTestURL(u"12345678.xlsx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$12345678.xlsx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$12345678.xlsx"_ustr, GetLockFileName(aLockFile)); } // One character file name { OUString aTestFile = generateTestURL(u"1.xlsx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$1.xlsx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$1.xlsx"_ustr, GetLockFileName(aLockFile)); } // Test for ODS format { OUString aTestFile = generateTestURL(u"12345678.ods"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$12345678.ods"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$12345678.ods"_ustr, GetLockFileName(aLockFile)); } } @@ -351,36 +351,35 @@ void LockfileTest::testPowerPointLockFileURL() { OUString aTestFile = generateTestURL(u"testPowerPointLockFileURL.pptx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$testPowerPointLockFileURL.pptx"), - GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$testPowerPointLockFileURL.pptx"_ustr, GetLockFileName(aLockFile)); } // Eight character file name { OUString aTestFile = generateTestURL(u"12345678.pptx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$12345678.pptx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$12345678.pptx"_ustr, GetLockFileName(aLockFile)); } // One character file name { OUString aTestFile = generateTestURL(u"1.pptx"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$1.pptx"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$1.pptx"_ustr, GetLockFileName(aLockFile)); } // Test for PPT format { OUString aTestFile = generateTestURL(u"12345678.ppt"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$12345678.ppt"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$12345678.ppt"_ustr, GetLockFileName(aLockFile)); } // Test for ODP format { OUString aTestFile = generateTestURL(u"/12345678.odp"); svt::MSODocumentLockFile aLockFile(aTestFile); - CPPUNIT_ASSERT_EQUAL(OUString("~$12345678.odp"), GetLockFileName(aLockFile)); + CPPUNIT_ASSERT_EQUAL(u"~$12345678.odp"_ustr, GetLockFileName(aLockFile)); } } @@ -391,8 +390,8 @@ void LockfileTest::testWordLockFileContent() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and check the content svt::MSODocumentLockFile aLockFile(aTestFile); @@ -443,8 +442,8 @@ void LockfileTest::testExcelLockFileContent() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and check the content svt::MSODocumentLockFile aLockFile(aTestFile); @@ -500,8 +499,8 @@ void LockfileTest::testPowerPointLockFileContent() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and check the content svt::MSODocumentLockFile aLockFile(aTestFile); @@ -558,8 +557,8 @@ void LockfileTest::testWordLockFileRT() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::MSODocumentLockFile aLockFile(aTestODT); @@ -579,8 +578,8 @@ void LockfileTest::testExcelLockFileRT() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::MSODocumentLockFile aLockFile(aTestODT); @@ -600,8 +599,8 @@ void LockfileTest::testPowerPointLockFileRT() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::MSODocumentLockFile aLockFile(aTestODT); @@ -622,9 +621,9 @@ void LockfileTest::testMSOLockFileLongUserName() // Set user name SvtUserOptions aUserOpt; aUserOpt.SetToken(UserOptToken::FirstName, - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + u"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"_ustr); aUserOpt.SetToken(UserOptToken::LastName, - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + u"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"_ustr); // Write the lock file and read it back svt::MSODocumentLockFile aLockFile(aTestODT); @@ -673,16 +672,16 @@ void LockfileTest::testMSOLockFileOverwrite() // Set user name SvtUserOptions aUserOpt; - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Write the lock file and read it back svt::MSODocumentLockFile aLockFile(aTestODT); aLockFile.CreateOwnLockFile(); // Change user name - aUserOpt.SetToken(UserOptToken::FirstName, "LockFile2"); - aUserOpt.SetToken(UserOptToken::LastName, "Test"); + aUserOpt.SetToken(UserOptToken::FirstName, u"LockFile2"_ustr); + aUserOpt.SetToken(UserOptToken::LastName, u"Test"_ustr); // Overwrite lockfile svt::MSODocumentLockFile aLockFile2(aTestODT); diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 28ef860ba74d..389195ec1728 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -325,9 +325,9 @@ void Test::testNumberFormat() void Test::testSharedString() { // Use shared string as normal, non-shared string, which is allowed. - SharedString aSS1("Test"), aSS2("Test"); + SharedString aSS1(u"Test"_ustr), aSS2(u"Test"_ustr); CPPUNIT_ASSERT_MESSAGE("Equality check should return true.", bool(aSS1 == aSS2)); - SharedString aSS3("test"); + SharedString aSS3(u"test"_ustr); CPPUNIT_ASSERT_MESSAGE("Equality check is case sensitive.", aSS1 != aSS3); } @@ -337,15 +337,15 @@ void Test::testSharedStringPool() svl::SharedStringPool aPool(aSysLocale.GetCharClass()); svl::SharedString p1, p2; - p1 = aPool.intern("Andy"); - p2 = aPool.intern("Andy"); + p1 = aPool.intern(u"Andy"_ustr); + p2 = aPool.intern(u"Andy"_ustr); CPPUNIT_ASSERT_EQUAL(p1.getData(), p2.getData()); - p2 = aPool.intern("Bruce"); + p2 = aPool.intern(u"Bruce"_ustr); CPPUNIT_ASSERT_MESSAGE("They must differ.", p1.getData() != p2.getData()); - OUString aAndy("Andy"); - p1 = aPool.intern("Andy"); + OUString aAndy(u"Andy"_ustr); + p1 = aPool.intern(u"Andy"_ustr); p2 = aPool.intern(aAndy); CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be NULL.", p1.getData()); CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be NULL.", p2.getData()); @@ -353,12 +353,12 @@ void Test::testSharedStringPool() // Test case insensitive string ID's. p1 = aPool.intern(aAndy); - p2 = aPool.intern("andy"); + p2 = aPool.intern(u"andy"_ustr); CPPUNIT_ASSERT_MESSAGE("Failed to intern strings.", p1.getData()); CPPUNIT_ASSERT_MESSAGE("Failed to intern strings.", p2.getData()); CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData()); CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase()); - p2 = aPool.intern("ANDY"); + p2 = aPool.intern(u"ANDY"_ustr); CPPUNIT_ASSERT_MESSAGE("Failed to intern string.", p2.getData()); CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData()); CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase()); @@ -443,8 +443,8 @@ void Test::testSharedStringPoolEmptyString() // Make sure SharedString::getEmptyString() is in the pool and matches empty strings. SvtSysLocale aSysLocale; svl::SharedStringPool aPool(aSysLocale.GetCharClass()); - aPool.intern(""); - CPPUNIT_ASSERT_EQUAL(SharedString::getEmptyString(), aPool.intern("")); + aPool.intern(u""_ustr); + CPPUNIT_ASSERT_EQUAL(SharedString::getEmptyString(), aPool.intern(u""_ustr)); CPPUNIT_ASSERT_EQUAL(SharedString::getEmptyString(), aPool.intern(SharedString::EMPTY_STRING)); // And it should still work even after purging. aPool.purge(); @@ -1836,58 +1836,58 @@ void Test::testNfEnglishKeywordsIntegrity() CPPUNIT_ASSERT_EQUAL( sKeywords[i], rEnglishKeywords[i] ); } // Check the order of sEnglishKeyword - CPPUNIT_ASSERT_EQUAL( OUString("E"), rEnglishKeywords[NF_KEY_E] ); - CPPUNIT_ASSERT_EQUAL( OUString("AM/PM"), rEnglishKeywords[NF_KEY_AMPM] ); - CPPUNIT_ASSERT_EQUAL( OUString("A/P"), rEnglishKeywords[NF_KEY_AP] ); - CPPUNIT_ASSERT_EQUAL( OUString("M"), rEnglishKeywords[NF_KEY_MI] ); - CPPUNIT_ASSERT_EQUAL( OUString("MM"), rEnglishKeywords[NF_KEY_MMI] ); - CPPUNIT_ASSERT_EQUAL( OUString("M"), rEnglishKeywords[NF_KEY_M] ); - CPPUNIT_ASSERT_EQUAL( OUString("MM"), rEnglishKeywords[NF_KEY_MM] ); - CPPUNIT_ASSERT_EQUAL( OUString("MMM"), rEnglishKeywords[NF_KEY_MMM] ); - CPPUNIT_ASSERT_EQUAL( OUString("MMMM"), rEnglishKeywords[NF_KEY_MMMM] ); - CPPUNIT_ASSERT_EQUAL( OUString("H"), rEnglishKeywords[NF_KEY_H] ); - CPPUNIT_ASSERT_EQUAL( OUString("HH"), rEnglishKeywords[NF_KEY_HH] ); - CPPUNIT_ASSERT_EQUAL( OUString("S"), rEnglishKeywords[NF_KEY_S] ); - CPPUNIT_ASSERT_EQUAL( OUString("SS"), rEnglishKeywords[NF_KEY_SS] ); - CPPUNIT_ASSERT_EQUAL( OUString("Q"), rEnglishKeywords[NF_KEY_Q] ); - CPPUNIT_ASSERT_EQUAL( OUString("QQ"), rEnglishKeywords[NF_KEY_QQ] ); - CPPUNIT_ASSERT_EQUAL( OUString("D"), rEnglishKeywords[NF_KEY_D] ); - CPPUNIT_ASSERT_EQUAL( OUString("DD"), rEnglishKeywords[NF_KEY_DD] ); - CPPUNIT_ASSERT_EQUAL( OUString("DDD"), rEnglishKeywords[NF_KEY_DDD] ); - CPPUNIT_ASSERT_EQUAL( OUString("DDDD"), rEnglishKeywords[NF_KEY_DDDD] ); - CPPUNIT_ASSERT_EQUAL( OUString("YY"), rEnglishKeywords[NF_KEY_YY] ); - CPPUNIT_ASSERT_EQUAL( OUString("YYYY"), rEnglishKeywords[NF_KEY_YYYY] ); - CPPUNIT_ASSERT_EQUAL( OUString("NN"), rEnglishKeywords[NF_KEY_NN] ); - CPPUNIT_ASSERT_EQUAL( OUString("NNNN"), rEnglishKeywords[NF_KEY_NNNN] ); - CPPUNIT_ASSERT_EQUAL( OUString("CCC"), rEnglishKeywords[NF_KEY_CCC] ); - CPPUNIT_ASSERT_EQUAL( OUString("GENERAL"), rEnglishKeywords[NF_KEY_GENERAL] ); - CPPUNIT_ASSERT_EQUAL( OUString("NNN"), rEnglishKeywords[NF_KEY_NNN] ); - CPPUNIT_ASSERT_EQUAL( OUString("WW"), rEnglishKeywords[NF_KEY_WW] ); - CPPUNIT_ASSERT_EQUAL( OUString("MMMMM"), rEnglishKeywords[NF_KEY_MMMMM] ); - CPPUNIT_ASSERT_EQUAL( OUString("TRUE"), rEnglishKeywords[NF_KEY_TRUE] ); - CPPUNIT_ASSERT_EQUAL( OUString("FALSE"), rEnglishKeywords[NF_KEY_FALSE] ); - CPPUNIT_ASSERT_EQUAL( OUString("BOOLEAN"), rEnglishKeywords[NF_KEY_BOOLEAN] ); - CPPUNIT_ASSERT_EQUAL( OUString("COLOR"), rEnglishKeywords[NF_KEY_COLOR] ); - CPPUNIT_ASSERT_EQUAL( OUString("BLACK"), rEnglishKeywords[NF_KEY_BLACK] ); - CPPUNIT_ASSERT_EQUAL( OUString("BLUE"), rEnglishKeywords[NF_KEY_BLUE] ); - CPPUNIT_ASSERT_EQUAL( OUString("GREEN"), rEnglishKeywords[NF_KEY_GREEN] ); - CPPUNIT_ASSERT_EQUAL( OUString("CYAN"), rEnglishKeywords[NF_KEY_CYAN] ); - CPPUNIT_ASSERT_EQUAL( OUString("RED"), rEnglishKeywords[NF_KEY_RED] ); - CPPUNIT_ASSERT_EQUAL( OUString("MAGENTA"), rEnglishKeywords[NF_KEY_MAGENTA] ); - CPPUNIT_ASSERT_EQUAL( OUString("BROWN"), rEnglishKeywords[NF_KEY_BROWN] ); - CPPUNIT_ASSERT_EQUAL( OUString("GREY"), rEnglishKeywords[NF_KEY_GREY] ); - CPPUNIT_ASSERT_EQUAL( OUString("YELLOW"), rEnglishKeywords[NF_KEY_YELLOW] ); - CPPUNIT_ASSERT_EQUAL( OUString("WHITE"), rEnglishKeywords[NF_KEY_WHITE] ); - CPPUNIT_ASSERT_EQUAL( OUString("AAA"), rEnglishKeywords[NF_KEY_AAA]); - CPPUNIT_ASSERT_EQUAL( OUString("AAAA"), rEnglishKeywords[NF_KEY_AAAA] ); - CPPUNIT_ASSERT_EQUAL( OUString("E"), rEnglishKeywords[NF_KEY_EC] ); - CPPUNIT_ASSERT_EQUAL( OUString("EE"), rEnglishKeywords[NF_KEY_EEC] ); - CPPUNIT_ASSERT_EQUAL( OUString("G"), rEnglishKeywords[NF_KEY_G] ); - CPPUNIT_ASSERT_EQUAL( OUString("GG"), rEnglishKeywords[NF_KEY_GG] ); - CPPUNIT_ASSERT_EQUAL( OUString("GGG"), rEnglishKeywords[NF_KEY_GGG] ); - CPPUNIT_ASSERT_EQUAL( OUString("R"), rEnglishKeywords[NF_KEY_R] ); - CPPUNIT_ASSERT_EQUAL( OUString("RR"), rEnglishKeywords[NF_KEY_RR] ); - CPPUNIT_ASSERT_EQUAL( OUString("t"), rEnglishKeywords[NF_KEY_THAI_T] ); + CPPUNIT_ASSERT_EQUAL( u"E"_ustr, rEnglishKeywords[NF_KEY_E] ); + CPPUNIT_ASSERT_EQUAL( u"AM/PM"_ustr, rEnglishKeywords[NF_KEY_AMPM] ); + CPPUNIT_ASSERT_EQUAL( u"A/P"_ustr, rEnglishKeywords[NF_KEY_AP] ); + CPPUNIT_ASSERT_EQUAL( u"M"_ustr, rEnglishKeywords[NF_KEY_MI] ); + CPPUNIT_ASSERT_EQUAL( u"MM"_ustr, rEnglishKeywords[NF_KEY_MMI] ); + CPPUNIT_ASSERT_EQUAL( u"M"_ustr, rEnglishKeywords[NF_KEY_M] ); + CPPUNIT_ASSERT_EQUAL( u"MM"_ustr, rEnglishKeywords[NF_KEY_MM] ); + CPPUNIT_ASSERT_EQUAL( u"MMM"_ustr, rEnglishKeywords[NF_KEY_MMM] ); + CPPUNIT_ASSERT_EQUAL( u"MMMM"_ustr, rEnglishKeywords[NF_KEY_MMMM] ); + CPPUNIT_ASSERT_EQUAL( u"H"_ustr, rEnglishKeywords[NF_KEY_H] ); + CPPUNIT_ASSERT_EQUAL( u"HH"_ustr, rEnglishKeywords[NF_KEY_HH] ); + CPPUNIT_ASSERT_EQUAL( u"S"_ustr, rEnglishKeywords[NF_KEY_S] ); + CPPUNIT_ASSERT_EQUAL( u"SS"_ustr, rEnglishKeywords[NF_KEY_SS] ); + CPPUNIT_ASSERT_EQUAL( u"Q"_ustr, rEnglishKeywords[NF_KEY_Q] ); + CPPUNIT_ASSERT_EQUAL( u"QQ"_ustr, rEnglishKeywords[NF_KEY_QQ] ); + CPPUNIT_ASSERT_EQUAL( u"D"_ustr, rEnglishKeywords[NF_KEY_D] ); + CPPUNIT_ASSERT_EQUAL( u"DD"_ustr, rEnglishKeywords[NF_KEY_DD] ); + CPPUNIT_ASSERT_EQUAL( u"DDD"_ustr, rEnglishKeywords[NF_KEY_DDD] ); + CPPUNIT_ASSERT_EQUAL( u"DDDD"_ustr, rEnglishKeywords[NF_KEY_DDDD] ); + CPPUNIT_ASSERT_EQUAL( u"YY"_ustr, rEnglishKeywords[NF_KEY_YY] ); + CPPUNIT_ASSERT_EQUAL( u"YYYY"_ustr, rEnglishKeywords[NF_KEY_YYYY] ); + CPPUNIT_ASSERT_EQUAL( u"NN"_ustr, rEnglishKeywords[NF_KEY_NN] ); + CPPUNIT_ASSERT_EQUAL( u"NNNN"_ustr, rEnglishKeywords[NF_KEY_NNNN] ); + CPPUNIT_ASSERT_EQUAL( u"CCC"_ustr, rEnglishKeywords[NF_KEY_CCC] ); + CPPUNIT_ASSERT_EQUAL( u"GENERAL"_ustr, rEnglishKeywords[NF_KEY_GENERAL] ); + CPPUNIT_ASSERT_EQUAL( u"NNN"_ustr, rEnglishKeywords[NF_KEY_NNN] ); + CPPUNIT_ASSERT_EQUAL( u"WW"_ustr, rEnglishKeywords[NF_KEY_WW] ); + CPPUNIT_ASSERT_EQUAL( u"MMMMM"_ustr, rEnglishKeywords[NF_KEY_MMMMM] ); + CPPUNIT_ASSERT_EQUAL( u"TRUE"_ustr, rEnglishKeywords[NF_KEY_TRUE] ); + CPPUNIT_ASSERT_EQUAL( u"FALSE"_ustr, rEnglishKeywords[NF_KEY_FALSE] ); + CPPUNIT_ASSERT_EQUAL( u"BOOLEAN"_ustr, rEnglishKeywords[NF_KEY_BOOLEAN] ); + CPPUNIT_ASSERT_EQUAL( u"COLOR"_ustr, rEnglishKeywords[NF_KEY_COLOR] ); + CPPUNIT_ASSERT_EQUAL( u"BLACK"_ustr, rEnglishKeywords[NF_KEY_BLACK] ); + CPPUNIT_ASSERT_EQUAL( u"BLUE"_ustr, rEnglishKeywords[NF_KEY_BLUE] ); + CPPUNIT_ASSERT_EQUAL( u"GREEN"_ustr, rEnglishKeywords[NF_KEY_GREEN] ); + CPPUNIT_ASSERT_EQUAL( u"CYAN"_ustr, rEnglishKeywords[NF_KEY_CYAN] ); + CPPUNIT_ASSERT_EQUAL( u"RED"_ustr, rEnglishKeywords[NF_KEY_RED] ); + CPPUNIT_ASSERT_EQUAL( u"MAGENTA"_ustr, rEnglishKeywords[NF_KEY_MAGENTA] ); + CPPUNIT_ASSERT_EQUAL( u"BROWN"_ustr, rEnglishKeywords[NF_KEY_BROWN] ); + CPPUNIT_ASSERT_EQUAL( u"GREY"_ustr, rEnglishKeywords[NF_KEY_GREY] ); + CPPUNIT_ASSERT_EQUAL( u"YELLOW"_ustr, rEnglishKeywords[NF_KEY_YELLOW] ); + CPPUNIT_ASSERT_EQUAL( u"WHITE"_ustr, rEnglishKeywords[NF_KEY_WHITE] ); + CPPUNIT_ASSERT_EQUAL( u"AAA"_ustr, rEnglishKeywords[NF_KEY_AAA]); + CPPUNIT_ASSERT_EQUAL( u"AAAA"_ustr, rEnglishKeywords[NF_KEY_AAAA] ); + CPPUNIT_ASSERT_EQUAL( u"E"_ustr, rEnglishKeywords[NF_KEY_EC] ); + CPPUNIT_ASSERT_EQUAL( u"EE"_ustr, rEnglishKeywords[NF_KEY_EEC] ); + CPPUNIT_ASSERT_EQUAL( u"G"_ustr, rEnglishKeywords[NF_KEY_G] ); + CPPUNIT_ASSERT_EQUAL( u"GG"_ustr, rEnglishKeywords[NF_KEY_GG] ); + CPPUNIT_ASSERT_EQUAL( u"GGG"_ustr, rEnglishKeywords[NF_KEY_GGG] ); + CPPUNIT_ASSERT_EQUAL( u"R"_ustr, rEnglishKeywords[NF_KEY_R] ); + CPPUNIT_ASSERT_EQUAL( u"RR"_ustr, rEnglishKeywords[NF_KEY_RR] ); + CPPUNIT_ASSERT_EQUAL( u"t"_ustr, rEnglishKeywords[NF_KEY_THAI_T] ); } void Test::testStandardColorIntegrity() @@ -1923,8 +1923,8 @@ void Test::testColorNamesConversion() aGermanKeywords[i] = rKeywords[i]; // Check that we actually have German and English keywords. - CPPUNIT_ASSERT_EQUAL( OUString("FARBE"), aGermanKeywords[NF_KEY_COLOR]); - CPPUNIT_ASSERT_EQUAL( OUString("COLOR"), rEnglishKeywords[NF_KEY_COLOR]); + CPPUNIT_ASSERT_EQUAL( u"FARBE"_ustr, aGermanKeywords[NF_KEY_COLOR]); + CPPUNIT_ASSERT_EQUAL( u"COLOR"_ustr, rEnglishKeywords[NF_KEY_COLOR]); // Test each color conversion. // [FARBE1] -> [COLOR1] can't be tested because we have no color table link @@ -1976,11 +1976,11 @@ void Test::testExcelExportFormats() aCode = aFormatter.GetFormatStringForExcel( nKey1, aKeywords, aTempFormatter); // Test that LCID is prepended. - CPPUNIT_ASSERT_EQUAL( OUString("[$-1C09]00.00"), aCode); + CPPUNIT_ASSERT_EQUAL( u"[$-1C09]00.00"_ustr, aCode); aCode = aFormatter.GetFormatStringForExcel( nKey2, aKeywords, aTempFormatter); // Test that LCID is not prepended. Note that literal characters are escaped. - CPPUNIT_ASSERT_EQUAL( OUString("[$R-1C09]\ #,##0.0;[$R-1C09]\-#,##0.0"), aCode); + CPPUNIT_ASSERT_EQUAL( u"[$R-1C09]\ #,##0.0;[$R-1C09]\-#,##0.0"_ustr, aCode); } CPPUNIT_TEST_FIXTURE(Test, testLanguageNone) @@ -1988,12 +1988,12 @@ CPPUNIT_TEST_FIXTURE(Test, testLanguageNone) SvNumberFormatter aFormatter(m_xContext, LANGUAGE_ENGLISH_US); NfKeywordTable keywords; aFormatter.FillKeywordTableForExcel(keywords); - OUString code("TT.MM.JJJJ"); + OUString code(u"TT.MM.JJJJ"_ustr); sal_uInt32 nKey = aFormatter.GetEntryKey(code, LANGUAGE_GERMAN); CPPUNIT_ASSERT(nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); SvNumberformat const*const pFormat = aFormatter.GetEntry(nKey); LocaleDataWrapper ldw(m_xContext, LanguageTag(pFormat->GetLanguage())); - CPPUNIT_ASSERT_EQUAL(OUString("dd.mm.yyyy"), pFormat->GetMappedFormatstring(keywords, ldw)); + CPPUNIT_ASSERT_EQUAL(u"dd.mm.yyyy"_ustr, pFormat->GetMappedFormatstring(keywords, ldw)); } CPPUNIT_TEST_FIXTURE(Test, testTdf160306) diff --git a/svl/qa/unit/test_INetContentType.cxx b/svl/qa/unit/test_INetContentType.cxx index 288cfe919008..f305b8c839b9 100644 --- a/svl/qa/unit/test_INetContentType.cxx +++ b/svl/qa/unit/test_INetContentType.cxx @@ -37,7 +37,7 @@ public: }; void Test::testBad() { - OUString in("foo=bar"); + OUString in(u"foo=bar"_ustr); CPPUNIT_ASSERT_EQUAL( static_cast<void const *>(nullptr), static_cast<void const *>(INetMIME::scanContentType(in))); @@ -51,7 +51,7 @@ void Test::testBad() { } void Test::testFull() { - OUString in("foo/bar;baz=boz"); + OUString in(u"foo/bar;baz=boz"_ustr); CPPUNIT_ASSERT_EQUAL( static_cast<void const *>(in.getStr() + in.getLength()), static_cast<void const *>(INetMIME::scanContentType(in))); @@ -59,15 +59,15 @@ void Test::testFull() { OUString s; INetContentTypeParameterList ps; CPPUNIT_ASSERT(INetContentTypes::parse(in, t, s, &ps)); - CPPUNIT_ASSERT_EQUAL(OUString("foo"), t); - CPPUNIT_ASSERT_EQUAL(OUString("bar"), s); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, t); + CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, s); auto iter = ps.find("baz"_ostr); CPPUNIT_ASSERT(iter != ps.end()); - CPPUNIT_ASSERT_EQUAL(OUString("boz"), iter->second.m_sValue); + CPPUNIT_ASSERT_EQUAL(u"boz"_ustr, iter->second.m_sValue); } void Test::testFollow() { - OUString in("foo/bar;baz=boz;base64,"); + OUString in(u"foo/bar;baz=boz;base64,"_ustr); CPPUNIT_ASSERT_EQUAL( static_cast<void const *>(in.getStr() + std::strlen("foo/bar;baz=boz")), static_cast<void const *>(INetMIME::scanContentType(in))); diff --git a/svl/qa/unit/test_SvAddressParser.cxx b/svl/qa/unit/test_SvAddressParser.cxx index b015f9a1b389..ac368d450078 100644 --- a/svl/qa/unit/test_SvAddressParser.cxx +++ b/svl/qa/unit/test_SvAddressParser.cxx @@ -27,40 +27,40 @@ class Test : public CppUnit::TestFixture // <https://tools.ietf.org/html/rfc822> "Standard for the Format of ARPA Internet Text // Messages": { - SvAddressParser p("Alfred Neuman <Neuman@BBN-TENEXA>"); + SvAddressParser p(u"Alfred Neuman <Neuman@BBN-TENEXA>"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), p.Count()); - CPPUNIT_ASSERT_EQUAL(OUString("Neuman@BBN-TENEXA"), p.GetEmailAddress(0)); + CPPUNIT_ASSERT_EQUAL(u"Neuman@BBN-TENEXA"_ustr, p.GetEmailAddress(0)); } { - SvAddressParser p("Neuman@BBN-TENEXA"); + SvAddressParser p(u"Neuman@BBN-TENEXA"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), p.Count()); - CPPUNIT_ASSERT_EQUAL(OUString("Neuman@BBN-TENEXA"), p.GetEmailAddress(0)); + CPPUNIT_ASSERT_EQUAL(u"Neuman@BBN-TENEXA"_ustr, p.GetEmailAddress(0)); } { - SvAddressParser p("\"George, Ted\" <Shared@Group.Arpanet>"); + SvAddressParser p(u"\"George, Ted\" <Shared@Group.Arpanet>"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), p.Count()); - CPPUNIT_ASSERT_EQUAL(OUString("Shared@Group.Arpanet"), p.GetEmailAddress(0)); + CPPUNIT_ASSERT_EQUAL(u"Shared@Group.Arpanet"_ustr, p.GetEmailAddress(0)); } { - SvAddressParser p("Wilt . (the Stilt) chamberl...@nba.us"); + SvAddressParser p(u"Wilt . (the Stilt) chamberl...@nba.us"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), p.Count()); - CPPUNIT_ASSERT_EQUAL(OUString("wilt.chamberl...@nba.us"), p.GetEmailAddress(0)); + CPPUNIT_ASSERT_EQUAL(u"wilt.chamberl...@nba.us"_ustr, p.GetEmailAddress(0)); } { - SvAddressParser p("Gourmets: Pompous Person <WhoZiWhatZit@Cordon-Bleu>, " + SvAddressParser p(u"Gourmets: Pompous Person <WhoZiWhatZit@Cordon-Bleu>, " " Childs@WGBH.Boston, Galloping Gourmet@ " " ANT.Down-Under (Australian National Television), " " Cheapie@Discount-Liquors;, " " Cruisers: Port@Portugal, Jones@SEA;, " - " Another@Somewhere.SomeOrg"); + " Another@Somewhere.SomeOrg"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(7), p.Count()); - CPPUNIT_ASSERT_EQUAL(OUString("WhoZiWhatZit@Cordon-Bleu"), p.GetEmailAddress(0)); - CPPUNIT_ASSERT_EQUAL(OUString("Childs@WGBH.Boston"), p.GetEmailAddress(1)); - CPPUNIT_ASSERT_EQUAL(OUString("gour...@ant.down-Under"), p.GetEmailAddress(2)); - CPPUNIT_ASSERT_EQUAL(OUString("Cheapie@Discount-Liquors"), p.GetEmailAddress(3)); - CPPUNIT_ASSERT_EQUAL(OUString("Port@Portugal"), p.GetEmailAddress(4)); - CPPUNIT_ASSERT_EQUAL(OUString("Jones@SEA"), p.GetEmailAddress(5)); - CPPUNIT_ASSERT_EQUAL(OUString("Another@Somewhere.SomeOrg"), p.GetEmailAddress(6)); + CPPUNIT_ASSERT_EQUAL(u"WhoZiWhatZit@Cordon-Bleu"_ustr, p.GetEmailAddress(0)); + CPPUNIT_ASSERT_EQUAL(u"Childs@WGBH.Boston"_ustr, p.GetEmailAddress(1)); + CPPUNIT_ASSERT_EQUAL(u"gour...@ant.down-Under"_ustr, p.GetEmailAddress(2)); + CPPUNIT_ASSERT_EQUAL(u"Cheapie@Discount-Liquors"_ustr, p.GetEmailAddress(3)); + CPPUNIT_ASSERT_EQUAL(u"Port@Portugal"_ustr, p.GetEmailAddress(4)); + CPPUNIT_ASSERT_EQUAL(u"Jones@SEA"_ustr, p.GetEmailAddress(5)); + CPPUNIT_ASSERT_EQUAL(u"Another@Somewhere.SomeOrg"_ustr, p.GetEmailAddress(6)); } } diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx index 516f4eb4fd04..ea1f12d5855a 100644 --- a/svl/qa/unit/test_URIHelper.cxx +++ b/svl/qa/unit/test_URIHelper.cxx @@ -214,13 +214,13 @@ void Test::finish() { void Test::testNormalizedMakeRelative() { auto ucb(css::ucb::UniversalContentBroker::create(m_context)); - ucb->registerContentProvider(new Provider, "test", true); + ucb->registerContentProvider(new Provider, u"test"_ustr, true); ucb->registerContentProvider( css::uno::Reference<css::ucb::XContentProvider>( m_context->getServiceManager()->createInstanceWithContext( - "com.sun.star.comp.ucb.FileProvider", m_context), + u"com.sun.star.comp.ucb.FileProvider"_ustr, m_context), css::uno::UNO_QUERY_THROW), - "file", true); + u"file"_ustr, true); struct Data { char const * base; char const * absolute; @@ -369,7 +369,7 @@ void Test::testFindFirstURLInText() { { "generic:path", nullptr, 0, 0 }, { "wfs:", nullptr, 0, 0 } }; - CharClass charClass( m_context, LanguageTag( css::lang::Locale("en", "US", ""))); + CharClass charClass( m_context, LanguageTag( css::lang::Locale(u"en"_ustr, u"US"_ustr, u""_ustr))); for (auto const[pInput, pResult, nBegin, nEnd] : tests) { OUString input(OUString::createFromAscii(pInput)); @@ -420,7 +420,7 @@ void Test::testFindFirstDOIInText() { { "doi:10.1093", nullptr, 0, 0 }, // no slash { "doi:11.1093/ajae/aaq063", nullptr, 0, 0 }, // doesn't begin with doi:10. }; - CharClass charClass( m_context, LanguageTag( css::lang::Locale("en", "US", ""))); + CharClass charClass( m_context, LanguageTag( css::lang::Locale(u"en"_ustr, u"US"_ustr, u""_ustr))); for (auto const[pInput, pResult, nBegin, nEnd] : tests) { OUString input(OUString::createFromAscii(pInput)); @@ -492,28 +492,28 @@ void Test::testResolveIdnaHost() { URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen@M\u00FCnchen.de"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://xn--mnchen-3ya.de."), + u"foo://xn--mnchen-3ya.de."_ustr, URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen.de."_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("Foo://b...@xn--mnchen-3ya.de:123/?bar#baz"), + u"Foo://b...@xn--mnchen-3ya.de:123/?bar#baz"_ustr, URIHelper::resolveIdnaHost(u"Foo://bar@M\u00FCnchen.de:123/?bar#baz"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://xn--mnchen-3ya.de"), + u"foo://xn--mnchen-3ya.de"_ustr, URIHelper::resolveIdnaHost(u"foo://Mu\u0308nchen.de"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://example.xn--m-eha"), URIHelper::resolveIdnaHost(u"foo://example.mü"_ustr)); + u"foo://example.xn--m-eha"_ustr, URIHelper::resolveIdnaHost(u"foo://example.mü"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://example.xn--m-eha:0"), URIHelper::resolveIdnaHost(u"foo://example.mü:0"_ustr)); + u"foo://example.xn--m-eha:0"_ustr, URIHelper::resolveIdnaHost(u"foo://example.mü:0"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://xn--e1afmkfd.xn--p1ai"), URIHelper::resolveIdnaHost(u"foo://пример.рф"_ustr)); + u"foo://xn--e1afmkfd.xn--p1ai"_ustr, URIHelper::resolveIdnaHost(u"foo://пример.рф"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://xn--e1afmkfd.xn--p1ai:0"), + u"foo://xn--e1afmkfd.xn--p1ai:0"_ustr, URIHelper::resolveIdnaHost(u"foo://пример.рф:0"_ustr)); } diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx index 2e82deac6339..7330db00b5ef 100644 --- a/svl/qa/unit/test_lngmisc.cxx +++ b/svl/qa/unit/test_lngmisc.cxx @@ -42,13 +42,13 @@ private: void LngMiscTest::testRemoveHyphens() { - OUString str1(""); - OUString str2("a-b--c---"); + OUString str1(u""_ustr); + OUString str2(u"a-b--c---"_ustr); OUString str3 = OUStringChar(SVT_SOFT_HYPHEN) + OUStringChar(SVT_HARD_HYPHEN) + OUStringChar(SVT_HARD_HYPHEN); - OUString str4("asdf"); + OUString str4(u"asdf"_ustr); bool bModified = linguistic::RemoveHyphens(str1); CPPUNIT_ASSERT(!bModified); @@ -57,7 +57,7 @@ void LngMiscTest::testRemoveHyphens() // Note that '-' isn't a hyphen to RemoveHyphens. bModified = linguistic::RemoveHyphens(str2); CPPUNIT_ASSERT(!bModified); - CPPUNIT_ASSERT_EQUAL(OUString("a-b--c---"), str2); + CPPUNIT_ASSERT_EQUAL(u"a-b--c---"_ustr, str2); bModified = linguistic::RemoveHyphens(str3); CPPUNIT_ASSERT(bModified); @@ -65,14 +65,14 @@ void LngMiscTest::testRemoveHyphens() bModified = linguistic::RemoveHyphens(str4); CPPUNIT_ASSERT(!bModified); - CPPUNIT_ASSERT_EQUAL(OUString("asdf"), str4); + CPPUNIT_ASSERT_EQUAL(u"asdf"_ustr, str4); } void LngMiscTest::testRemoveControlChars() { - OUString str1(""); - OUString str2("asdf"); - OUString str3("asdf asdf"); + OUString str1(u""_ustr); + OUString str2(u"asdf"_ustr); + OUString str3(u"asdf asdf"_ustr); OUStringBuffer str4Buf(33); str4Buf.setLength(33); @@ -88,22 +88,22 @@ void LngMiscTest::testRemoveControlChars() bModified = linguistic::RemoveControlChars(str2); CPPUNIT_ASSERT(!bModified); - CPPUNIT_ASSERT_EQUAL(OUString("asdf"), str2); + CPPUNIT_ASSERT_EQUAL(u"asdf"_ustr, str2); bModified = linguistic::RemoveControlChars(str3); CPPUNIT_ASSERT(bModified); - CPPUNIT_ASSERT_EQUAL(OUString("asdfasdf"), str3); + CPPUNIT_ASSERT_EQUAL(u"asdfasdf"_ustr, str3); bModified = linguistic::RemoveControlChars(str4); CPPUNIT_ASSERT(bModified); - CPPUNIT_ASSERT_EQUAL(OUString(" "), str4); + CPPUNIT_ASSERT_EQUAL(u" "_ustr, str4); } void LngMiscTest::testReplaceControlChars() { - OUString str1(""); - OUString str2("asdf"); - OUString str3("asdf asdf"); + OUString str1(u""_ustr); + OUString str2(u"asdf"_ustr); + OUString str3(u"asdf asdf"_ustr); OUStringBuffer str4Buf(33); str4Buf.setLength(33); @@ -119,11 +119,11 @@ void LngMiscTest::testReplaceControlChars() bModified = linguistic::ReplaceControlChars(str2); CPPUNIT_ASSERT(!bModified); - CPPUNIT_ASSERT_EQUAL(OUString("asdf"), str2); + CPPUNIT_ASSERT_EQUAL(u"asdf"_ustr, str2); bModified = linguistic::ReplaceControlChars(str3); CPPUNIT_ASSERT(bModified); - CPPUNIT_ASSERT_EQUAL(OUString("asdf asdf"), str3); + CPPUNIT_ASSERT_EQUAL(u"asdf asdf"_ustr, str3); bModified = linguistic::ReplaceControlChars(str4); CPPUNIT_ASSERT(bModified); @@ -136,28 +136,28 @@ void LngMiscTest::testGetThesaurusReplaceText() { constexpr OUString str2(u"asdf"_ustr); - OUString r = linguistic::GetThesaurusReplaceText(""); + OUString r = linguistic::GetThesaurusReplaceText(u""_ustr); CPPUNIT_ASSERT(r.isEmpty()); r = linguistic::GetThesaurusReplaceText(str2); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText("asdf (abc)"); + r = linguistic::GetThesaurusReplaceText(u"asdf (abc)"_ustr); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText("asdf*"); + r = linguistic::GetThesaurusReplaceText(u"asdf*"_ustr); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText("asdf * "); + r = linguistic::GetThesaurusReplaceText(u"asdf * "_ustr); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText("asdf (abc) *"); + r = linguistic::GetThesaurusReplaceText(u"asdf (abc) *"_ustr); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText("asdf asdf * (abc)"); - CPPUNIT_ASSERT_EQUAL(OUString("asdf asdf"), r); + r = linguistic::GetThesaurusReplaceText(u"asdf asdf * (abc)"_ustr); + CPPUNIT_ASSERT_EQUAL(u"asdf asdf"_ustr, r); - r = linguistic::GetThesaurusReplaceText(" * (abc) asdf *"); + r = linguistic::GetThesaurusReplaceText(u" * (abc) asdf *"_ustr); CPPUNIT_ASSERT(r.isEmpty()); } diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index d1515f6e76f7..a5ccfd74c001 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -121,8 +121,8 @@ bool SvxAsianConfig::GetStartEndChars( css::uno::Reference< css::beans::XPropertySet > el( v.get< css::uno::Reference< css::beans::XPropertySet > >(), css::uno::UNO_SET_THROW); - startChars = el->getPropertyValue("StartCharacters").get< OUString >(); - endChars = el->getPropertyValue("EndCharacters").get< OUString >(); + startChars = el->getPropertyValue(u"StartCharacters"_ustr).get< OUString >(); + endChars = el->getPropertyValue(u"EndCharacters"_ustr).get< OUString >(); return true; } @@ -152,16 +152,16 @@ void SvxAsianConfig::SetStartEndChars( css::uno::Reference< css::beans::XPropertySet > el( v.get< css::uno::Reference< css::beans::XPropertySet > >(), css::uno::UNO_SET_THROW); - el->setPropertyValue("StartCharacters", css::uno::Any(*startChars)); - el->setPropertyValue("EndCharacters", css::uno::Any(*endChars)); + el->setPropertyValue(u"StartCharacters"_ustr, css::uno::Any(*startChars)); + el->setPropertyValue(u"EndCharacters"_ustr, css::uno::Any(*endChars)); } else { css::uno::Reference< css::beans::XPropertySet > el( (css::uno::Reference< css::lang::XSingleServiceFactory >( set, css::uno::UNO_QUERY_THROW)-> createInstance()), css::uno::UNO_QUERY_THROW); - el->setPropertyValue("StartCharacters", css::uno::Any(*startChars)); - el->setPropertyValue("EndCharacters", css::uno::Any(*endChars)); + el->setPropertyValue(u"StartCharacters"_ustr, css::uno::Any(*startChars)); + el->setPropertyValue(u"EndCharacters"_ustr, css::uno::Any(*endChars)); css::uno::Any v2(el); try { set->insertByName(name, v2); diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index fdcd52d01cac..9f151bcb01cb 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -100,7 +100,7 @@ bool SvtCTLOptions_Impl::IsReadOnly(SvtCTLOptions::EOption eOption) const } SvtCTLOptions_Impl::SvtCTLOptions_Impl() : - utl::ConfigItem("Office.Common/I18N/CTL"), + utl::ConfigItem(u"Office.Common/I18N/CTL"_ustr), m_bIsLoaded ( false ), m_bCTLFontEnabled ( true ), @@ -225,12 +225,12 @@ void SvtCTLOptions_Impl::Load() if ( !rPropertyNames.hasElements() ) { rPropertyNames = { - "CTLFont", - "CTLSequenceChecking", - "CTLCursorMovement", - "CTLTextNumerals", - "CTLSequenceCheckingRestricted", - "CTLSequenceCheckingTypeAndReplace" }; + u"CTLFont"_ustr, + u"CTLSequenceChecking"_ustr, + u"CTLCursorMovement"_ustr, + u"CTLTextNumerals"_ustr, + u"CTLSequenceCheckingRestricted"_ustr, + u"CTLSequenceCheckingTypeAndReplace"_ustr }; EnableNotification( rPropertyNames ); } Sequence< Any > aValues = GetProperties( rPropertyNames ); diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 3fe6ae90ab34..52f4e4e021b2 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -349,19 +349,19 @@ OUString PKIStatusToString(int n) { switch (n) { - case 0: return "granted"; - case 1: return "grantedWithMods"; - case 2: return "rejection"; - case 3: return "waiting"; - case 4: return "revocationWarning"; - case 5: return "revocationNotification"; + case 0: return u"granted"_ustr; + case 1: return u"grantedWithMods"_ustr; + case 2: return u"rejection"_ustr; + case 3: return u"waiting"_ustr; + case 4: return u"revocationWarning"_ustr; + case 5: return u"revocationNotification"_ustr; default: return "unknown (" + OUString::number(n) + ")"; } } OUString PKIStatusInfoToString(const PKIStatusInfo& rStatusInfo) { - OUString result = "{status="; + OUString result = u"{status="_ustr; if (rStatusInfo.status.len == 1) result += PKIStatusToString(rStatusInfo.status.data[0]); else diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index ed88fe789b72..64989a9b32db 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -39,7 +39,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance() { OUString aTempURL = ::utl::CreateTempURL( nullptr, true ); if ( aTempURL.isEmpty() ) - throw uno::RuntimeException("Cannot create tempfile."); + throw uno::RuntimeException(u"Cannot create tempfile."_ustr); ::ucbhelper::Content aResultContent( aTempURL, uno::Reference< ucb::XCommandEnvironment >(), @@ -74,9 +74,9 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA if( !( aArguments[1] >>= nStorageMode ) ) { throw lang::IllegalArgumentException( - ("second argument to css.embed.FileSystemStorageFactory." + (u"second argument to css.embed.FileSystemStorageFactory." "createInstanceWithArguments must be a" - " css.embed.ElementModes"), + " css.embed.ElementModes"_ustr), getXWeak(), -1); } // it's always possible to read written storage in this implementation @@ -89,9 +89,9 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA if ( !( aArguments[0] >>= aURL ) || aURL.isEmpty() ) { throw lang::IllegalArgumentException( - ("first argument to" + (u"first argument to" " css.embed.FileSystemStorageFactory.createInstanceWithArguments" - " must be a (non-empty) URL"), + " must be a (non-empty) URL"_ustr), getXWeak(), -1); } @@ -129,7 +129,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA OUString SAL_CALL FSStorageFactory::getImplementationName() { - return "com.sun.star.comp.embed.FileSystemStorageFactory"; + return u"com.sun.star.comp.embed.FileSystemStorageFactory"_ustr; } sal_Bool SAL_CALL FSStorageFactory::supportsService( const OUString& ServiceName ) @@ -139,8 +139,8 @@ sal_Bool SAL_CALL FSStorageFactory::supportsService( const OUString& ServiceName uno::Sequence< OUString > SAL_CALL FSStorageFactory::getSupportedServiceNames() { - return { "com.sun.star.embed.FileSystemStorageFactory", - "com.sun.star.comp.embed.FileSystemStorageFactory" }; + return { u"com.sun.star.embed.FileSystemStorageFactory"_ustr, + u"com.sun.star.comp.embed.FileSystemStorageFactory"_ustr }; } diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index e2af002f150d..74895d153536 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -276,7 +276,7 @@ void SAL_CALL FSStorage::copyToStorage( const uno::Reference< embed::XStorage >& catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -372,7 +372,7 @@ uno::Reference< io::XStream > FSStorage::openStreamElementImpl( catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -462,7 +462,7 @@ uno::Reference< embed::XStorage > FSStorage::openStorageElementImpl( catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -519,7 +519,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::cloneStreamElement( const OUSt catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -642,7 +642,7 @@ void SAL_CALL FSStorage::renameElement( const OUString& aElementName, const OUSt catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -713,7 +713,7 @@ void SAL_CALL FSStorage::copyElementTo( const OUString& aElementName, catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } @@ -774,7 +774,7 @@ uno::Any SAL_CALL FSStorage::getByName( const OUString& aName ) catch (const uno::Exception&) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( "Can not open element!", + throw lang::WrappedTargetException( u"Can not open element!"_ustr, getXWeak(), aCaught ); } @@ -791,7 +791,7 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() try { - uno::Sequence<OUString> aProps { "Title" }; + uno::Sequence<OUString> aProps { u"Title"_ustr }; sal_Int32 nSize = 0; uno::Reference<sdbc::XResultSet> xResultSet @@ -814,7 +814,7 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() else { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( "Can not open storage!", + throw lang::WrappedTargetRuntimeException( u"Can not open storage!"_ustr, getXWeak(), aCaught ); } @@ -826,7 +826,7 @@ uno::Sequence< OUString > SAL_CALL FSStorage::getElementNames() catch (const uno::Exception&) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( "Can not open storage!", + throw lang::WrappedTargetRuntimeException( u"Can not open storage!"_ustr, getXWeak(), aCaught ); } @@ -860,7 +860,7 @@ sal_Bool SAL_CALL FSStorage::hasElements() try { - uno::Sequence<OUString> aProps { "TargetURL" }; + uno::Sequence<OUString> aProps { u"TargetURL"_ustr }; uno::Reference<sdbc::XResultSet> xResultSet = m_aContent.createCursor(aProps, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS); @@ -1069,7 +1069,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException("Can't copy raw stream", + throw embed::StorageWrappedTargetException(u"Can't copy raw stream"_ustr, uno::Reference< io::XInputStream >(), aCaught ); } diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index 4bb3dd8bcd70..e5e53e18d0b7 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -234,7 +234,7 @@ SfxBoolItem* SfxBoolItem::Clone(SfxItemPool *) const // virtual OUString SfxBoolItem::GetValueTextByVal(bool bTheValue) const { - return bTheValue ? OUString("TRUE") : OUString("FALSE"); + return bTheValue ? u"TRUE"_ustr : u"FALSE"_ustr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 9595ce62ea55..dec177455d5b 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -130,7 +130,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertyMapEntry& rEntry else if(0 == (rEntry.nFlags & PropertyAttribute::MAYBEVOID)) { throw RuntimeException( - "Property not found in ItemSet but not MAYBEVOID?", nullptr); + u"Property not found in ItemSet but not MAYBEVOID?"_ustr, nullptr); } // convert general SfxEnumItem values to specific values diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx index 31cbd1969324..f3641a5e049d 100644 --- a/svl/source/misc/documentlockfile.cxx +++ b/svl/source/misc/documentlockfile.cxx @@ -95,11 +95,11 @@ bool GenDocumentLockFile::CreateOwnLockFile() aInsertArg.ReplaceExisting = false; uno::Any aCmdArg; aCmdArg <<= aInsertArg; - aTargetContent.executeCommand( "insert", aCmdArg ); + aTargetContent.executeCommand( u"insert"_ustr, aCmdArg ); // try to let the file be hidden if possible try { - aTargetContent.setPropertyValue("IsHidden", uno::Any( true ) ); + aTargetContent.setPropertyValue(u"IsHidden"_ustr, uno::Any( true ) ); } catch( uno::Exception& ) {} } catch( ucb::NameClashException& ) @@ -158,7 +158,7 @@ void GenDocumentLockFile::RemoveFileDirectly() { uno::Reference < css::ucb::XCommandEnvironment > xEnv; ::ucbhelper::Content aCnt(GetURL(), xEnv, comphelper::getProcessComponentContext()); - aCnt.executeCommand("delete", + aCnt.executeCommand(u"delete"_ustr, uno::Any(true)); } diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx index 6530ff724429..e94a0b24a9f0 100644 --- a/svl/source/misc/fstathelper.cxx +++ b/svl/source/misc/fstathelper.cxx @@ -40,7 +40,7 @@ bool FStatHelper::GetModifiedDateTimeOfFile( const OUString& rURL, uno::Reference< XCommandEnvironment > (), comphelper::getProcessComponentContext()); uno::Any aAny = aTestContent.getPropertyValue( - "DateModified" ); + u"DateModified"_ustr ); if( aAny.hasValue() ) { bRet = true; diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index da6c86f5d99b..1eeed4e25b43 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -45,7 +45,7 @@ MediaTypeEntry const * seekEntry(OUString const & rTypeName, name. */ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] - = { { " ", CONTENT_TYPE_UNKNOWN }, + = { { u" "_ustr, CONTENT_TYPE_UNKNOWN }, { CONTENT_TYPE_STR_X_CNT_FSYSBOX, CONTENT_TYPE_X_CNT_FSYSBOX }, { CONTENT_TYPE_STR_X_CNT_FSYSFOLDER, CONTENT_TYPE_X_CNT_FSYSFOLDER }, { CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFOLDER, CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER }, @@ -136,86 +136,86 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] /** A mapping from extensions to type IDs. Sorted by extension. */ MediaTypeEntry const aStaticExtensionMap[] - = { { "aif", CONTENT_TYPE_AUDIO_AIFF }, - { "aiff", CONTENT_TYPE_AUDIO_AIFF }, - { "appt", CONTENT_TYPE_APP_CDE_CALENDAR_APP }, - { "au", CONTENT_TYPE_AUDIO_BASIC }, - { "avi", CONTENT_TYPE_VIDEO_MSVIDEO }, - { "bmp", CONTENT_TYPE_IMAGE_BMP }, - { "cgm", CONTENT_TYPE_IMAGE_GENERIC }, - { "doc", CONTENT_TYPE_APP_MSWORD }, - { "dot", CONTENT_TYPE_APP_MSWORD_TEMPL }, - { "dxf", CONTENT_TYPE_IMAGE_GENERIC }, - { "eps", CONTENT_TYPE_IMAGE_GENERIC }, - { "gal", CONTENT_TYPE_APP_GALLERY }, - { "gif", CONTENT_TYPE_IMAGE_GIF }, - { "htm", CONTENT_TYPE_TEXT_HTML }, - { "html", CONTENT_TYPE_TEXT_HTML }, - { "ics", CONTENT_TYPE_TEXT_ICALENDAR }, - { "jar", CONTENT_TYPE_APP_JAR }, - { "jpeg", CONTENT_TYPE_IMAGE_JPEG }, - { "jpg", CONTENT_TYPE_IMAGE_JPEG }, - { "met", CONTENT_TYPE_IMAGE_GENERIC }, - { "mid", CONTENT_TYPE_AUDIO_MIDI }, - { "midi", CONTENT_TYPE_AUDIO_MIDI }, - { "ogg", CONTENT_TYPE_AUDIO_VORBIS }, - { "pbm", CONTENT_TYPE_IMAGE_GENERIC }, - { "pcd", CONTENT_TYPE_IMAGE_GENERIC }, - { "pct", CONTENT_TYPE_IMAGE_GENERIC }, - { "pcx", CONTENT_TYPE_IMAGE_PCX }, - { "pdf", CONTENT_TYPE_APP_PDF }, - { "pgm", CONTENT_TYPE_IMAGE_GENERIC }, - { "png", CONTENT_TYPE_IMAGE_PNG }, - { "pot", CONTENT_TYPE_APP_MSPPOINT_TEMPL }, - { "ppm", CONTENT_TYPE_IMAGE_GENERIC }, - { "ppt", CONTENT_TYPE_APP_MSPPOINT }, - { "psd", CONTENT_TYPE_IMAGE_GENERIC }, - { "ras", CONTENT_TYPE_IMAGE_GENERIC }, - { "rtf", CONTENT_TYPE_APP_RTF }, - { "sda", CONTENT_TYPE_APP_VND_DRAW }, - { "sdc", CONTENT_TYPE_APP_VND_CALC }, - { "sdd", CONTENT_TYPE_APP_VND_IMPRESS }, - { "sdm", CONTENT_TYPE_APP_VND_MAIL }, - { "sdp", CONTENT_TYPE_APP_VND_IMPRESSPACKED }, - { "sds", CONTENT_TYPE_APP_VND_CHART }, - { "sdw", CONTENT_TYPE_APP_VND_WRITER }, - { "sd~", CONTENT_TYPE_X_STARMAIL }, - { "sfs", CONTENT_TYPE_APP_FRAMESET }, - { "sgl", CONTENT_TYPE_APP_VND_WRITER_GLOBAL }, - { "sim", CONTENT_TYPE_APP_VND_IMAGE }, - { "smd", CONTENT_TYPE_APP_STARMAIL_SMD }, //CONTENT_TYPE_X_STARMAIL - { "smf", CONTENT_TYPE_APP_VND_MATH }, - { "svh", CONTENT_TYPE_APP_STARHELP }, - { "svm", CONTENT_TYPE_IMAGE_GENERIC }, - { "sxc", CONTENT_TYPE_APP_VND_SUN_XML_CALC }, - { "sxd", CONTENT_TYPE_APP_VND_SUN_XML_DRAW }, - { "sxg", CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL }, - { "sxi", CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS }, - { "sxm", CONTENT_TYPE_APP_VND_SUN_XML_MATH }, - { "sxp", CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED }, - { "sxs", CONTENT_TYPE_APP_VND_SUN_XML_CHART }, - { "sxw", CONTENT_TYPE_APP_VND_SUN_XML_WRITER }, - { "tga", CONTENT_TYPE_IMAGE_GENERIC }, - { "thm", CONTENT_TYPE_APP_GALLERY_THEME }, - { "tif", CONTENT_TYPE_IMAGE_TIFF }, - { "tiff", CONTENT_TYPE_IMAGE_TIFF }, - { "txt", CONTENT_TYPE_TEXT_PLAIN }, - { "url", CONTENT_TYPE_TEXT_URL }, - { "vcf", CONTENT_TYPE_TEXT_VCARD }, - { "vcs", CONTENT_TYPE_TEXT_VCALENDAR }, - { "vdo", CONTENT_TYPE_VIDEO_VDO }, - { "vor", CONTENT_TYPE_APP_VND_TEMPLATE }, - { "wav", CONTENT_TYPE_AUDIO_WAV }, - { "webm", CONTENT_TYPE_VIDEO_WEBM }, - { "wmf", CONTENT_TYPE_IMAGE_GENERIC }, - { "wrl", CONTENT_TYPE_X_VRML }, - { "xbm", CONTENT_TYPE_IMAGE_GENERIC }, - { "xcs", CONTENT_TYPE_TEXT_XMLICALENDAR }, - { "xls", CONTENT_TYPE_APP_MSEXCEL }, - { "xlt", CONTENT_TYPE_APP_MSEXCEL_TEMPL }, - { "xlw", CONTENT_TYPE_APP_MSEXCEL }, - { "xpm", CONTENT_TYPE_IMAGE_GENERIC }, - { "zip", CONTENT_TYPE_APP_ZIP } }; + = { { u"aif"_ustr, CONTENT_TYPE_AUDIO_AIFF }, + { u"aiff"_ustr, CONTENT_TYPE_AUDIO_AIFF }, + { u"appt"_ustr, CONTENT_TYPE_APP_CDE_CALENDAR_APP }, + { u"au"_ustr, CONTENT_TYPE_AUDIO_BASIC }, + { u"avi"_ustr, CONTENT_TYPE_VIDEO_MSVIDEO }, + { u"bmp"_ustr, CONTENT_TYPE_IMAGE_BMP }, + { u"cgm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"doc"_ustr, CONTENT_TYPE_APP_MSWORD }, + { u"dot"_ustr, CONTENT_TYPE_APP_MSWORD_TEMPL }, + { u"dxf"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"eps"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"gal"_ustr, CONTENT_TYPE_APP_GALLERY }, + { u"gif"_ustr, CONTENT_TYPE_IMAGE_GIF }, + { u"htm"_ustr, CONTENT_TYPE_TEXT_HTML }, + { u"html"_ustr, CONTENT_TYPE_TEXT_HTML }, + { u"ics"_ustr, CONTENT_TYPE_TEXT_ICALENDAR }, + { u"jar"_ustr, CONTENT_TYPE_APP_JAR }, + { u"jpeg"_ustr, CONTENT_TYPE_IMAGE_JPEG }, + { u"jpg"_ustr, CONTENT_TYPE_IMAGE_JPEG }, + { u"met"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"mid"_ustr, CONTENT_TYPE_AUDIO_MIDI }, + { u"midi"_ustr, CONTENT_TYPE_AUDIO_MIDI }, + { u"ogg"_ustr, CONTENT_TYPE_AUDIO_VORBIS }, + { u"pbm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"pcd"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"pct"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"pcx"_ustr, CONTENT_TYPE_IMAGE_PCX }, + { u"pdf"_ustr, CONTENT_TYPE_APP_PDF }, + { u"pgm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"png"_ustr, CONTENT_TYPE_IMAGE_PNG }, + { u"pot"_ustr, CONTENT_TYPE_APP_MSPPOINT_TEMPL }, + { u"ppm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"ppt"_ustr, CONTENT_TYPE_APP_MSPPOINT }, + { u"psd"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"ras"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"rtf"_ustr, CONTENT_TYPE_APP_RTF }, + { u"sda"_ustr, CONTENT_TYPE_APP_VND_DRAW }, + { u"sdc"_ustr, CONTENT_TYPE_APP_VND_CALC }, + { u"sdd"_ustr, CONTENT_TYPE_APP_VND_IMPRESS }, + { u"sdm"_ustr, CONTENT_TYPE_APP_VND_MAIL }, + { u"sdp"_ustr, CONTENT_TYPE_APP_VND_IMPRESSPACKED }, + { u"sds"_ustr, CONTENT_TYPE_APP_VND_CHART }, + { u"sdw"_ustr, CONTENT_TYPE_APP_VND_WRITER }, + { u"sd~"_ustr, CONTENT_TYPE_X_STARMAIL }, + { u"sfs"_ustr, CONTENT_TYPE_APP_FRAMESET }, + { u"sgl"_ustr, CONTENT_TYPE_APP_VND_WRITER_GLOBAL }, + { u"sim"_ustr, CONTENT_TYPE_APP_VND_IMAGE }, + { u"smd"_ustr, CONTENT_TYPE_APP_STARMAIL_SMD }, //CONTENT_TYPE_X_STARMAIL + { u"smf"_ustr, CONTENT_TYPE_APP_VND_MATH }, + { u"svh"_ustr, CONTENT_TYPE_APP_STARHELP }, + { u"svm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"sxc"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_CALC }, + { u"sxd"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_DRAW }, + { u"sxg"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL }, + { u"sxi"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS }, + { u"sxm"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_MATH }, + { u"sxp"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED }, + { u"sxs"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_CHART }, + { u"sxw"_ustr, CONTENT_TYPE_APP_VND_SUN_XML_WRITER }, + { u"tga"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"thm"_ustr, CONTENT_TYPE_APP_GALLERY_THEME }, + { u"tif"_ustr, CONTENT_TYPE_IMAGE_TIFF }, + { u"tiff"_ustr, CONTENT_TYPE_IMAGE_TIFF }, + { u"txt"_ustr, CONTENT_TYPE_TEXT_PLAIN }, + { u"url"_ustr, CONTENT_TYPE_TEXT_URL }, + { u"vcf"_ustr, CONTENT_TYPE_TEXT_VCARD }, + { u"vcs"_ustr, CONTENT_TYPE_TEXT_VCALENDAR }, + { u"vdo"_ustr, CONTENT_TYPE_VIDEO_VDO }, + { u"vor"_ustr, CONTENT_TYPE_APP_VND_TEMPLATE }, + { u"wav"_ustr, CONTENT_TYPE_AUDIO_WAV }, + { u"webm"_ustr, CONTENT_TYPE_VIDEO_WEBM }, + { u"wmf"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"wrl"_ustr, CONTENT_TYPE_X_VRML }, + { u"xbm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"xcs"_ustr, CONTENT_TYPE_TEXT_XMLICALENDAR }, + { u"xls"_ustr, CONTENT_TYPE_APP_MSEXCEL }, + { u"xlt"_ustr, CONTENT_TYPE_APP_MSEXCEL_TEMPL }, + { u"xlw"_ustr, CONTENT_TYPE_APP_MSEXCEL }, + { u"xpm"_ustr, CONTENT_TYPE_IMAGE_GENERIC }, + { u"zip"_ustr, CONTENT_TYPE_APP_ZIP } }; } diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 205d905ae134..ac8e42fb28cc 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -75,11 +75,11 @@ ShareControlFile::ShareControlFile( std::u16string_view aOrigURL ) SvMemoryStream aStream(0,0); aInsertArg.Data.set(new ::utl::OInputStreamWrapper(aStream)); aInsertArg.ReplaceExisting = false; - aContent.executeCommand( "insert", uno::Any( aInsertArg ) ); + aContent.executeCommand( u"insert"_ustr, uno::Any( aInsertArg ) ); // try to let the file be hidden if possible try { - aContent.setPropertyValue("IsHidden", uno::Any( true ) ); + aContent.setPropertyValue(u"IsHidden"_ustr, uno::Any( true ) ); } catch( uno::Exception& ) {} // Try to open one more time diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index d31a9e8cbe0c..8efae06979f0 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -148,7 +148,7 @@ Result normalizePrefix( css::uno::Reference< css::ucb::XUniversalContentBroker > bool ok = (css::uno::Reference< css::ucb::XCommandProcessor >( content, css::uno::UNO_QUERY_THROW)->execute( - css::ucb::Command("getCasePreservingURL", + css::ucb::Command(u"getCasePreservingURL"_ustr, -1, css::uno::Any()), 0, css::uno::Reference< css::ucb::XCommandEnvironment >()) diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 0c68ea5db8a8..cf763d9249f5 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -331,7 +331,7 @@ sal_Int32 SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( cons OUString SAL_CALL SvNumberFormatterServiceObj::getImplementationName() { - return "com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"; + return u"com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"_ustr; } sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const OUString& ServiceName ) @@ -341,7 +341,7 @@ sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const OUString& uno::Sequence<OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedServiceNames() { - return { "com.sun.star.util.NumberFormatter" }; + return { u"com.sun.star.util.NumberFormatter"_ustr }; } SvNumberFormatsObj::SvNumberFormatsObj( SvNumberFormatsSupplierObj& _rParent, ::comphelper::SharedMutex _aMutex ) @@ -626,7 +626,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const OUString SAL_CALL SvNumberFormatsObj::getImplementationName() { - return "SvNumberFormatsObj"; + return u"SvNumberFormatsObj"_ustr; } sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const OUString& ServiceName ) @@ -636,7 +636,7 @@ sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const OUString& ServiceNa uno::Sequence<OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNames() { - return { "com.sun.star.util.NumberFormats" }; + return { u"com.sun.star.util.NumberFormats"_ustr }; } SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_Int32 nK, ::comphelper::SharedMutex _aMutex ) @@ -836,7 +836,7 @@ void SAL_CALL SvNumberFormatObj::setPropertyValues( const uno::Sequence<beans::P OUString SAL_CALL SvNumberFormatObj::getImplementationName() { - return "SvNumberFormatObj"; + return u"SvNumberFormatObj"_ustr; } sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const OUString& ServiceName ) @@ -846,7 +846,7 @@ sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const OUString& ServiceNam uno::Sequence<OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceNames() { - return { "com.sun.star.util.NumberFormatProperties" }; + return { u"com.sun.star.util.NumberFormatProperties"_ustr }; } SvNumberFormatSettingsObj::SvNumberFormatSettingsObj( SvNumberFormatsSupplierObj& rParent, ::comphelper::SharedMutex _aMutex ) @@ -962,7 +962,7 @@ void SAL_CALL SvNumberFormatSettingsObj::removeVetoableChangeListener( const OUS OUString SAL_CALL SvNumberFormatSettingsObj::getImplementationName() { - return "SvNumberFormatSettingsObj"; + return u"SvNumberFormatSettingsObj"_ustr; } sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const OUString& ServiceName ) @@ -972,7 +972,7 @@ sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const OUString& Se uno::Sequence<OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceNames() { - return { "com.sun.star.util.NumberFormatSettings" }; + return { u"com.sun.star.util.NumberFormatSettings"_ustr }; } diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index e5402f0fdb06..b8f396ffb578 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -99,7 +99,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< OUString SAL_CALL SvNumberFormatsSupplierServiceObject::getImplementationName( ) { - return "com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"; + return u"com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"_ustr; } sal_Bool SAL_CALL SvNumberFormatsSupplierServiceObject::supportsService( const OUString& _rServiceName ) @@ -109,7 +109,7 @@ sal_Bool SAL_CALL SvNumberFormatsSupplierServiceObject::supportsService( const O Sequence< OUString > SAL_CALL SvNumberFormatsSupplierServiceObject::getSupportedServiceNames( ) { - return { "com.sun.star.util.NumberFormatsSupplier" }; + return { u"com.sun.star.util.NumberFormatsSupplier"_ustr }; } Reference< XPropertySet > SAL_CALL SvNumberFormatsSupplierServiceObject::getNumberFormatSettings() diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 3d7333f3a1c6..c14e1b0abe30 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -650,7 +650,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) } else if (i == 2 && mrCurrentLanguageData.GetLanguageTag().getLanguage() == "de") { - if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && StringContainsWord( "MRZ", rString, nPos)) + if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && StringContainsWord( u"MRZ"_ustr, rString, nPos)) { // Accept MRZ for MÄR nPos = nPos + 3; res = sal::static_int_cast< short >(-(i+1)); // negative @@ -667,14 +667,14 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) { // This assumes the weirdness is applicable to all locales. // It is the case for at least en-* and de-* locales. - if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( "SEP", rString, nPos)) + if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( u"SEP"_ustr, rString, nPos)) { // #102136# The correct English form of month September abbreviated is // SEPT, but almost every data contains SEP instead. nPos = nPos + 3; res = sal::static_int_cast< short >(-(i+1)); // negative break; // for } - else if (pUpperAbbrevMonthText[i] == "SEP" && StringContainsWord( "SEPT", rString, nPos)) + else if (pUpperAbbrevMonthText[i] == "SEP" && StringContainsWord( u"SEPT"_ustr, rString, nPos)) { // And vice versa, accept SEPT for SEP nPos = nPos + 4; res = sal::static_int_cast< short >(-(i+1)); // negative @@ -694,12 +694,12 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) { // Locale data has Jänner/Jän assert(pUpperMonthText[0] == u"J\u00C4NNER"); - if (StringContainsWord( "JANUAR", rString, nPos)) + if (StringContainsWord( u"JANUAR"_ustr, rString, nPos)) { nPos += 6; res = 1; } - else if (StringContainsWord( "JAN", rString, nPos)) + else if (StringContainsWord( u"JAN"_ustr, rString, nPos)) { nPos += 3; res = -1; diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 2d26b1251f3e..bd5ef47a595b 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2620,7 +2620,7 @@ OUString SvNFFormatData::GetCalcCellReturn(sal_uInt32 nFormat) const { const SvNumberformat* pFormat = GetFormatEntry(nFormat); if (!pFormat) - return "G"; + return u"G"_ustr; OUString aStr; bool bAppendPrec = true; @@ -3278,7 +3278,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+5 /* NF_DATETIME_ISO_YYYYMMDDTHHMMSS */ ); assert(pFormat); - pFormat->SetComment("ISO 8601"); // not to be localized + pFormat->SetComment(u"ISO 8601"_ustr); // not to be localized // YYYY-MM-DD"T"HH:MM:SS,000 ISO with milliseconds and ',' or '.' decimal separator aSingleFormatCode.Code = @@ -3292,7 +3292,7 @@ void SvNFFormatData::ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, cons pFormat = ImpInsertFormat(rCurrentLanguage, rNatNum, aSingleFormatCode, CLOffset + ZF_STANDARD_DATETIME+6 /* NF_DATETIME_ISO_YYYYMMDDTHHMMSS000 */ ); assert(pFormat); - pFormat->SetComment("ISO 8601"); // not to be localized + pFormat->SetComment(u"ISO 8601"_ustr); // not to be localized // Scientific number @@ -3573,12 +3573,12 @@ OUString SvNFEngine::GenerateFormat(SvNFLanguageData& rCurrentLanguage, } // Native Number - const OUString sPosNatNumModifier = pFormat ? pFormat->GetNatNumModifierString( 0 ) : ""; + const OUString sPosNatNumModifier = pFormat ? pFormat->GetNatNumModifierString( 0 ) : u""_ustr; const OUString sNegNatNumModifier = pFormat ? // if a negative format already exists, use its NatNum modifier // else use NatNum modifier of positive format ( pFormat->GetNumForString( 1, 0 ) ? pFormat->GetNatNumModifierString( 1 ) : sPosNatNumModifier ) - : ""; + : u""_ustr; if (eType == SvNumFormatType::PERCENT) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 6167878fccf9..855acc179d30 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -5821,10 +5821,10 @@ void SvNumberformat::GetNatNumXml( css::i18n::NativeNumberXmlAttributes2& rAttr, OUString SvNumberformat::GetNatNumModifierString( sal_uInt16 nNumFor ) const { if ( nNumFor > 3 ) - return ""; + return u""_ustr; const SvNumberNatNum& rNum = NumFor[nNumFor].GetNatNum(); if ( !rNum.IsSet() ) - return ""; + return u""_ustr; const sal_Int32 nNum = rNum.GetNatNum(); OUStringBuffer sNatNumModifier = "[NatNum" + OUString::number( nNum ); if ( NatNumTakesParameters( nNum ) ) diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index f112d4d19ea4..08f6a8591ef5 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -45,64 +45,64 @@ const int MaxCntPost = 20; //max dec places allow by rtl_math_round const NfKeywordTable ImpSvNumberformatScan::sEnglishKeyword = { // Syntax keywords in English (USA) //! All keywords MUST be UPPERCASE! In same order as NfKeywordIndex - "", // NF_KEY_NONE 0 - "E", // NF_KEY_E Exponent - "AM/PM", // NF_KEY_AMPM AM/PM - "A/P", // NF_KEY_AP AM/PM short - "M", // NF_KEY_MI Minute - "MM", // NF_KEY_MMI Minute 02 - "M", // NF_KEY_M month (!) - "MM", // NF_KEY_MM month 02 (!) - "MMM", // NF_KEY_MMM month short name - "MMMM", // NF_KEY_MMMM month long name - "MMMMM", // NF_KEY_MMMMM first letter of month name - "H", // NF_KEY_H hour - "HH", // NF_KEY_HH hour 02 - "S", // NF_KEY_S Second - "SS", // NF_KEY_SS Second 02 - "Q", // NF_KEY_Q Quarter short 'Q' - "QQ", // NF_KEY_QQ Quarter long - "D", // NF_KEY_D day of month - "DD", // NF_KEY_DD day of month 02 - "DDD", // NF_KEY_DDD day of week short - "DDDD", // NF_KEY_DDDD day of week long - "YY", // NF_KEY_YY year two digits - "YYYY", // NF_KEY_YYYY year four digits - "NN", // NF_KEY_NN Day of week short - "NNN", // NF_KEY_NNN Day of week long - "NNNN", // NF_KEY_NNNN Day of week long incl. separator - "AAA", // NF_KEY_AAA - "AAAA", // NF_KEY_AAAA - "E", // NF_KEY_EC - "EE", // NF_KEY_EEC - "G", // NF_KEY_G - "GG", // NF_KEY_GG - "GGG", // NF_KEY_GGG - "R", // NF_KEY_R - "RR", // NF_KEY_RR - "WW", // NF_KEY_WW Week of year - "t", // NF_KEY_THAI_T Thai T modifier, speciality of Thai Excel, only + u""_ustr, // NF_KEY_NONE 0 + u"E"_ustr, // NF_KEY_E Exponent + u"AM/PM"_ustr, // NF_KEY_AMPM AM/PM + u"A/P"_ustr, // NF_KEY_AP AM/PM short + u"M"_ustr, // NF_KEY_MI Minute + u"MM"_ustr, // NF_KEY_MMI Minute 02 + u"M"_ustr, // NF_KEY_M month (!) + u"MM"_ustr, // NF_KEY_MM month 02 (!) + u"MMM"_ustr, // NF_KEY_MMM month short name + u"MMMM"_ustr, // NF_KEY_MMMM month long name + u"MMMMM"_ustr, // NF_KEY_MMMMM first letter of month name + u"H"_ustr, // NF_KEY_H hour + u"HH"_ustr, // NF_KEY_HH hour 02 + u"S"_ustr, // NF_KEY_S Second + u"SS"_ustr, // NF_KEY_SS Second 02 + u"Q"_ustr, // NF_KEY_Q Quarter short 'Q' + u"QQ"_ustr, // NF_KEY_QQ Quarter long + u"D"_ustr, // NF_KEY_D day of month + u"DD"_ustr, // NF_KEY_DD day of month 02 + u"DDD"_ustr, // NF_KEY_DDD day of week short + u"DDDD"_ustr, // NF_KEY_DDDD day of week long + u"YY"_ustr, // NF_KEY_YY year two digits + u"YYYY"_ustr, // NF_KEY_YYYY year four digits + u"NN"_ustr, // NF_KEY_NN Day of week short + u"NNN"_ustr, // NF_KEY_NNN Day of week long + u"NNNN"_ustr, // NF_KEY_NNNN Day of week long incl. separator + u"AAA"_ustr, // NF_KEY_AAA + u"AAAA"_ustr, // NF_KEY_AAAA + u"E"_ustr, // NF_KEY_EC + u"EE"_ustr, // NF_KEY_EEC + u"G"_ustr, // NF_KEY_G + u"GG"_ustr, // NF_KEY_GG + u"GGG"_ustr, // NF_KEY_GGG + u"R"_ustr, // NF_KEY_R + u"RR"_ustr, // NF_KEY_RR + u"WW"_ustr, // NF_KEY_WW Week of year + u"t"_ustr, // NF_KEY_THAI_T Thai T modifier, speciality of Thai Excel, only // used with Thai locale and converted to [NatNum1], only // exception as lowercase - "CCC", // NF_KEY_CCC Currency abbreviation - "BOOLEAN", // NF_KEY_BOOLEAN boolean - "GENERAL", // NF_KEY_GENERAL General / Standard + u"CCC"_ustr, // NF_KEY_CCC Currency abbreviation + u"BOOLEAN"_ustr, // NF_KEY_BOOLEAN boolean + u"GENERAL"_ustr, // NF_KEY_GENERAL General / Standard // Reserved words translated and color names follow: - "TRUE", // NF_KEY_TRUE boolean true - "FALSE", // NF_KEY_FALSE boolean false - "COLOR", // NF_KEY_COLOR color + u"TRUE"_ustr, // NF_KEY_TRUE boolean true + u"FALSE"_ustr, // NF_KEY_FALSE boolean false + u"COLOR"_ustr, // NF_KEY_COLOR color // colours - "BLACK", // NF_KEY_BLACK - "BLUE", // NF_KEY_BLUE - "GREEN", // NF_KEY_GREEN - "CYAN", // NF_KEY_CYAN - "RED", // NF_KEY_RED - "MAGENTA", // NF_KEY_MAGENTA - "BROWN", // NF_KEY_BROWN - "GREY", // NF_KEY_GREY - "YELLOW", // NF_KEY_YELLOW - "WHITE" // NF_KEY_WHITE + u"BLACK"_ustr, // NF_KEY_BLACK + u"BLUE"_ustr, // NF_KEY_BLUE + u"GREEN"_ustr, // NF_KEY_GREEN + u"CYAN"_ustr, // NF_KEY_CYAN + u"RED"_ustr, // NF_KEY_RED + u"MAGENTA"_ustr, // NF_KEY_MAGENTA + u"BROWN"_ustr, // NF_KEY_BROWN + u"GREY"_ustr, // NF_KEY_GREY + u"YELLOW"_ustr, // NF_KEY_YELLOW + u"WHITE"_ustr // NF_KEY_WHITE }; const ::std::vector<Color> ImpSvNumberformatScan::StandardColor{ diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 538a8890516b..447909ab4944 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -183,7 +183,7 @@ PasswordMap StorageItem::getInfo() { PasswordMap aResult; - const Sequence< OUString > aNodeNames = ConfigItem::GetNodeNames( "Store" ); + const Sequence< OUString > aNodeNames = ConfigItem::GetNodeNames( u"Store"_ustr ); sal_Int32 aNodeCount = aNodeNames.getLength(); Sequence< OUString > aPropNames( aNodeCount * 2); @@ -238,13 +238,13 @@ PasswordMap StorageItem::getInfo() void StorageItem::setUseStorage( bool bUse ) { ConfigItem::SetModified(); - ConfigItem::PutProperties( { "UseStorage" }, { uno::Any(bUse) } ); + ConfigItem::PutProperties( { u"UseStorage"_ustr }, { uno::Any(bUse) } ); } bool StorageItem::useStorage() { - Sequence<OUString> aNodeNames { "UseStorage" }; + Sequence<OUString> aNodeNames { u"UseStorage"_ustr }; Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames ); @@ -263,7 +263,7 @@ bool StorageItem::useStorage() sal_Int32 StorageItem::getStorageVersion() { - Sequence<OUString> aNodeNames { "StorageVersion" }; + Sequence<OUString> aNodeNames { u"StorageVersion"_ustr }; Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames ); @@ -288,7 +288,7 @@ bool StorageItem::getEncodedMasterPassword( OUString& aResult, OUString& aResult return true; } - Sequence< OUString > aNodeNames{ "HasMaster", "Master", "MasterInitializationVector" }; + Sequence< OUString > aNodeNames{ u"HasMaster"_ustr, u"Master"_ustr, u"MasterInitializationVector"_ustr }; Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames ); @@ -314,7 +314,7 @@ void StorageItem::setEncodedMasterPassword( const OUString& aEncoded, const OUSt bool bHasMaster = ( !aEncoded.isEmpty() || bAcceptEmpty ); ConfigItem::SetModified(); - ConfigItem::PutProperties( { "HasMaster", "Master", "MasterInitializationVector", "StorageVersion" }, + ConfigItem::PutProperties( { u"HasMaster"_ustr, u"Master"_ustr, u"MasterInitializationVector"_ustr, u"StorageVersion"_ustr }, { uno::Any(bHasMaster), uno::Any(aEncoded), uno::Any(aEncodedIV), uno::Any(nCurrentStorageVersion) } ); @@ -328,13 +328,13 @@ void StorageItem::remove( const OUString& aURL, const OUString& aName ) { Sequence< OUString > sendSeq { createIndex( { aURL, aName } ) }; - ConfigItem::ClearNodeElements( "Store", sendSeq ); + ConfigItem::ClearNodeElements( u"Store"_ustr, sendSeq ); } void StorageItem::clear() { - ConfigItem::ClearNodeSet( "Store" ); + ConfigItem::ClearNodeSet( u"Store"_ustr ); } @@ -353,7 +353,7 @@ void StorageItem::update( const OUString& aURL, const NamePasswordRecord& aRecor aRecord.GetPersistentPasswords()) }; ConfigItem::SetModified(); - ConfigItem::SetSetProperties( "Store", sendSeq ); + ConfigItem::SetSetProperties( u"Store"_ustr, sendSeq ); } @@ -468,7 +468,7 @@ std::vector< OUString > PasswordContainer::DecodePasswords( std::u16string_view // problems with decoding OSL_FAIL( "Problem with decoding" ); throw css::task::NoMasterException( - "Can't decode!", css::uno::Reference<css::uno::XInterface>(), mode); + u"Can't decode!"_ustr, css::uno::Reference<css::uno::XInterface>(), mode); } OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines, std::u16string_view aIV, std::u16string_view aMasterPasswd) @@ -555,7 +555,7 @@ OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines // problems with encoding OSL_FAIL( "Problem with encoding" ); - throw RuntimeException("Can't encode!" ); + throw RuntimeException(u"Can't encode!"_ustr ); } void PasswordContainer::UpdateVector( const OUString& aURL, std::vector< NamePasswordRecord >& toUpdate, NamePasswordRecord const & aRecord, bool writeFile ) @@ -653,7 +653,7 @@ OUString PasswordContainer::createIV() unsigned char iv[RTL_DIGEST_LENGTH_MD5]; if (rtl_random_getBytes(nullptr, iv, RTL_DIGEST_LENGTH_MD5) != rtl_Random_E_None) { - throw uno::RuntimeException("rtl_random_getBytes failed"); + throw uno::RuntimeException(u"rtl_random_getBytes failed"_ustr); } OUStringBuffer aBuffer; for (sal_uInt8 i : iv) @@ -860,7 +860,7 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac { PasswordRequestMode aRMode = PasswordRequestMode_PASSWORD_ENTER; if( !m_xStorageFile || !m_xStorageFile->useStorage() ) - throw NoMasterException("Password storing is not active!", Reference< XInterface >(), aRMode ); + throw NoMasterException(u"Password storing is not active!"_ustr, Reference< XInterface >(), aRMode ); if( m_aMasterPassword.isEmpty() && aHandler.is() ) { @@ -913,7 +913,7 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac } if ( m_aMasterPassword.isEmpty() ) - throw NoMasterException("No master password!", Reference< XInterface >(), aRMode ); + throw NoMasterException(u"No master password!"_ustr, Reference< XInterface >(), aRMode ); return m_aMasterPassword; } @@ -1219,7 +1219,7 @@ sal_Bool SAL_CALL PasswordContainer::hasMasterPassword( ) std::unique_lock aGuard( mMutex ); if ( !m_xStorageFile ) - throw uno::RuntimeException("storage file not set"); + throw uno::RuntimeException(u"storage file not set"_ustr); OUString aEncodedMP, aEncodedMPIV; return ( m_xStorageFile->useStorage() && m_xStorageFile->getEncodedMasterPassword( aEncodedMP, aEncodedMPIV ) ); @@ -1230,7 +1230,7 @@ sal_Bool SAL_CALL PasswordContainer::allowPersistentStoring( sal_Bool bAllow ) std::unique_lock aGuard( mMutex ); if ( !m_xStorageFile ) - throw uno::RuntimeException("storage file not set"); + throw uno::RuntimeException(u"storage file not set"_ustr); if ( !bAllow ) removeMasterPassword(aGuard); @@ -1247,7 +1247,7 @@ sal_Bool SAL_CALL PasswordContainer::isPersistentStoringAllowed() std::unique_lock aGuard( mMutex ); if ( !m_xStorageFile ) - throw uno::RuntimeException("storage file not set"); + throw uno::RuntimeException(u"storage file not set"_ustr); return m_xStorageFile->useStorage(); } @@ -1309,7 +1309,7 @@ sal_Bool SAL_CALL PasswordContainer::isDefaultMasterPasswordUsed() std::unique_lock aGuard( mMutex ); if ( !m_xStorageFile ) - throw uno::RuntimeException("storage file not set"); + throw uno::RuntimeException(u"storage file not set"_ustr); OUString aEncodedMP, aEncodedMPIV; return ( m_xStorageFile->useStorage() && m_xStorageFile->getEncodedMasterPassword( aEncodedMP, aEncodedMPIV ) && aEncodedMP.isEmpty() ); @@ -1380,7 +1380,7 @@ void PasswordContainer::Notify() OUString SAL_CALL PasswordContainer::getImplementationName( ) { - return "stardiv.svl.PasswordContainer"; + return u"stardiv.svl.PasswordContainer"_ustr; } sal_Bool SAL_CALL PasswordContainer::supportsService( const OUString& ServiceName ) @@ -1390,7 +1390,7 @@ sal_Bool SAL_CALL PasswordContainer::supportsService( const OUString& ServiceNam Sequence< OUString > SAL_CALL PasswordContainer::getSupportedServiceNames( ) { - return { "com.sun.star.task.PasswordContainer" }; + return { u"com.sun.star.task.PasswordContainer"_ustr }; } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index 8de4a82f0d9a..9f2aa2198286 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.cxx @@ -25,11 +25,11 @@ using namespace com::sun::star; SysCredentialsConfigItem::SysCredentialsConfigItem( SysCredentialsConfig * pOwner ) -: utl::ConfigItem( "Office.Common/Passwords", ConfigItemMode::NONE ), +: utl::ConfigItem( u"Office.Common/Passwords"_ustr, ConfigItemMode::NONE ), m_bInited( false ), m_pOwner( pOwner ) { - uno::Sequence<OUString> aNode { "Office.Common/Passwords/AuthenticateUsingSystemCredentials" }; + uno::Sequence<OUString> aNode { u"Office.Common/Passwords/AuthenticateUsingSystemCredentials"_ustr }; -e ... etc. - the rest is truncated