diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-07 12:55:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-07 14:41:40 +0200 |
commit | 9422879a5cf74120c1057b0f8150529e304f7c95 (patch) | |
tree | 00b6c549be8fea2980f0ee2e2fc621b8ca8920fd | |
parent | c87077f653739d00ed5237d54838c1a454d65c4f (diff) |
loplugin:ostr in desktop
Change-Id: Ib43d1c3a182badddd870bcb8e052ac7fd0a16fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
61 files changed, 642 insertions, 638 deletions
diff --git a/desktop/qa/deployment_misc/test_dp_version.cxx b/desktop/qa/deployment_misc/test_dp_version.cxx index 1b8fb9086769..abf92acb8331 100644 --- a/desktop/qa/deployment_misc/test_dp_version.cxx +++ b/desktop/qa/deployment_misc/test_dp_version.cxx @@ -47,17 +47,17 @@ void Test::test() { }; static Data const data[] = { { OUString(), - OUString("0.0000.00.0"), + u"0.0000.00.0"_ustr, ::dp_misc::EQUAL }, - { OUString(".01"), - OUString("0.1"), + { u".01"_ustr, + u"0.1"_ustr, ::dp_misc::EQUAL }, - { OUString("10"), - OUString("2"), + { u"10"_ustr, + u"2"_ustr, ::dp_misc::GREATER }, - { OUString("9223372036854775808"), + { u"9223372036854775808"_ustr, // 2^63 - OUString("9223372036854775807"), + u"9223372036854775807"_ustr, ::dp_misc::GREATER } }; for (std::size_t i = 0; i < std::size(data); ++i) { diff --git a/desktop/qa/desktop_app/test_desktop_app.cxx b/desktop/qa/desktop_app/test_desktop_app.cxx index 2c9c7ba7121b..7112b22deb97 100644 --- a/desktop/qa/desktop_app/test_desktop_app.cxx +++ b/desktop/qa/desktop_app/test_desktop_app.cxx @@ -72,7 +72,7 @@ void Test::testTdf100837() { { // 1. Test default behaviour: Office URIs define open mode - TestSupplier supplier{ "foo", "ms-word:ofe|u|bar1", "ms-word:ofv|u|bar2", "ms-word:nft|u|bar3", "baz" }; + TestSupplier supplier{ u"foo"_ustr, u"ms-word:ofe|u|bar1"_ustr, u"ms-word:ofv|u|bar2"_ustr, u"ms-word:nft|u|bar3"_ustr, u"baz"_ustr }; desktop::CommandLineArgs args(supplier); auto vOpenList = args.GetOpenList(); auto vForceOpenList = args.GetForceOpenList(); @@ -80,37 +80,37 @@ void Test::testTdf100837() { auto vForceNewList = args.GetForceNewList(); // 2 documents go to Open list: foo; baz CPPUNIT_ASSERT_EQUAL(decltype(vOpenList.size())(2), vOpenList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("foo"), vOpenList[0]); - CPPUNIT_ASSERT_EQUAL(OUString("baz"), vOpenList[1]); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, vOpenList[0]); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, vOpenList[1]); // 1 document goes to ForceOpen list: bar1 CPPUNIT_ASSERT_EQUAL(decltype(vForceOpenList.size())(1), vForceOpenList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar1"), vForceOpenList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar1"_ustr, vForceOpenList[0]); // 1 document goes to View list: bar2 CPPUNIT_ASSERT_EQUAL(decltype(vViewList.size())(1), vViewList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar2"), vViewList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar2"_ustr, vViewList[0]); // 1 document goes to ForceNew list: bar3 CPPUNIT_ASSERT_EQUAL(decltype(vForceNewList.size())(1), vForceNewList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar3"), vForceNewList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar3"_ustr, vForceNewList[0]); } { // 2. Test explicit open mode arguments. Office URI commands should have no effect - TestSupplier supplier{ "--view", "ms-word:ofe|u|foo", "-o", "ms-word:ofv|u|bar", "ms-word:nft|u|baz" }; + TestSupplier supplier{ u"--view"_ustr, u"ms-word:ofe|u|foo"_ustr, u"-o"_ustr, u"ms-word:ofv|u|bar"_ustr, u"ms-word:nft|u|baz"_ustr }; desktop::CommandLineArgs args(supplier); auto vViewList = args.GetViewList(); auto vForceOpenList = args.GetForceOpenList(); // 1 document goes to View list: foo CPPUNIT_ASSERT_EQUAL(decltype(vViewList.size())(1), vViewList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("foo"), vViewList[0]); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, vViewList[0]); // 2 documents go to ForceOpen list: bar, baz CPPUNIT_ASSERT_EQUAL(decltype(vForceOpenList.size())(2), vForceOpenList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar"), vForceOpenList[0]); - CPPUNIT_ASSERT_EQUAL(OUString("baz"), vForceOpenList[1]); + CPPUNIT_ASSERT_EQUAL(u"bar"_ustr, vForceOpenList[0]); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, vForceOpenList[1]); } { // 3. Test encoded URLs - TestSupplier supplier{ "foo", "ms-word:ofe%7Cu%7cbar1", "ms-word:ofv%7cu%7Cbar2", "ms-word:nft%7Cu%7cbar3", "baz" }; + TestSupplier supplier{ u"foo"_ustr, u"ms-word:ofe%7Cu%7cbar1"_ustr, u"ms-word:ofv%7cu%7Cbar2"_ustr, u"ms-word:nft%7Cu%7cbar3"_ustr, u"baz"_ustr }; desktop::CommandLineArgs args(supplier); auto vOpenList = args.GetOpenList(); auto vForceOpenList = args.GetForceOpenList(); @@ -118,17 +118,17 @@ void Test::testTdf100837() { auto vForceNewList = args.GetForceNewList(); // 2 documents go to Open list: foo; baz CPPUNIT_ASSERT_EQUAL(decltype(vOpenList.size())(2), vOpenList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("foo"), vOpenList[0]); - CPPUNIT_ASSERT_EQUAL(OUString("baz"), vOpenList[1]); + CPPUNIT_ASSERT_EQUAL(u"foo"_ustr, vOpenList[0]); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, vOpenList[1]); // 1 document goes to ForceOpen list: bar1 CPPUNIT_ASSERT_EQUAL(decltype(vForceOpenList.size())(1), vForceOpenList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar1"), vForceOpenList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar1"_ustr, vForceOpenList[0]); // 1 document goes to View list: bar2 CPPUNIT_ASSERT_EQUAL(decltype(vViewList.size())(1), vViewList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar2"), vViewList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar2"_ustr, vViewList[0]); // 1 document goes to ForceNew list: bar3 CPPUNIT_ASSERT_EQUAL(decltype(vForceNewList.size())(1), vForceNewList.size()); - CPPUNIT_ASSERT_EQUAL(OUString("bar3"), vForceNewList[0]); + CPPUNIT_ASSERT_EQUAL(u"bar3"_ustr, vForceNewList[0]); } } diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 4310e64f25dd..ec40760861e7 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -97,7 +97,7 @@ static LibreOfficeKitDocumentType getDocumentTypeFromName(const char* pName) class DesktopLOKTest : public UnoApiTest { public: - DesktopLOKTest() : UnoApiTest("/desktop/qa/data/"), + DesktopLOKTest() : UnoApiTest(u"/desktop/qa/data/"_ustr), m_nSelectionBeforeSearchResult(0), m_nSelectionAfterSearchResult(0), m_bModified(false), @@ -602,11 +602,11 @@ void DesktopLOKTest::testSearchCalc() uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( { - {"SearchItem.SearchString", uno::Any(OUString("foo"))}, + {"SearchItem.SearchString", uno::Any(u"foo"_ustr)}, {"SearchItem.Backward", uno::Any(false)}, {"SearchItem.Command", uno::Any(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))}, })); - dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues); + dispatchCommand(mxComponent, u".uno:ExecuteSearch"_ustr, aPropertyValues); std::vector<OString> aSelections; sal_Int32 nIndex = 0; @@ -632,11 +632,11 @@ void DesktopLOKTest::testSearchAllNotificationsCalc() uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( { - {"SearchItem.SearchString", uno::Any(OUString("foo"))}, + {"SearchItem.SearchString", uno::Any(u"foo"_ustr)}, {"SearchItem.Backward", uno::Any(false)}, {"SearchItem.Command", uno::Any(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))}, })); - dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues); + dispatchCommand(mxComponent, u".uno:ExecuteSearch"_ustr, aPropertyValues); // This was 1, make sure that we get no notifications about selection changes during search. CPPUNIT_ASSERT_EQUAL(0, m_nSelectionBeforeSearchResult); @@ -736,7 +736,7 @@ void DesktopLOKTest::testPasteWriter() uno::Reference<container::XEnumerationAccess> xParagraph(xParagraphEnumeration->nextElement(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xTextPortionEnumeration = xParagraph->createEnumeration(); uno::Reference<beans::XPropertySet> xTextPortion(xTextPortionEnumeration->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Text"), xTextPortion->getPropertyValue("TextPortionType").get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, xTextPortion->getPropertyValue(u"TextPortionType"_ustr).get<OUString>()); // Without the accompanying fix in place, this test would have failed, as we had a comment // between "foo" and "baz". CPPUNIT_ASSERT(!xTextPortionEnumeration->hasMoreElements()); @@ -759,7 +759,7 @@ void DesktopLOKTest::testPasteWriterJPEG() uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); // This was text::TextContentAnchorType_AT_PARAGRAPH. - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>()); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, xShape->getPropertyValue(u"AnchorType"_ustr).get<text::TextContentAnchorType>()); // Delete the pasted picture, and paste again with a custom anchor type. uno::Reference<lang::XComponent>(xShape, uno::UNO_QUERY_THROW)->dispose(); @@ -767,10 +767,10 @@ void DesktopLOKTest::testPasteWriterJPEG() { {"AnchorType", uno::Any(static_cast<sal_uInt16>(text::TextContentAnchorType_AT_CHARACTER))}, })); - dispatchCommand(mxComponent, ".uno:Paste", aPropertyValues); + dispatchCommand(mxComponent, u".uno:Paste"_ustr, aPropertyValues); xShape.set(xDrawPage->getByIndex(0), uno::UNO_QUERY); // This was text::TextContentAnchorType_AS_CHARACTER, AnchorType argument was ignored. - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>()); + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, xShape->getPropertyValue(u"AnchorType"_ustr).get<text::TextContentAnchorType>()); } void DesktopLOKTest::testUndoWriter() @@ -1017,7 +1017,7 @@ void DesktopLOKTest::testWriterComments() uno::Reference<container::XEnumerationAccess> xParagraph(xParagraphEnumeration->nextElement(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xTextPortionEnumeration = xParagraph->createEnumeration(); uno::Reference<beans::XPropertySet> xTextPortion(xTextPortionEnumeration->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), xTextPortion->getPropertyValue("TextPortionType").get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"Annotation"_ustr, xTextPortion->getPropertyValue(u"TextPortionType"_ustr).get<OUString>()); // Type "test" and finish editing. pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0); @@ -1028,9 +1028,9 @@ void DesktopLOKTest::testWriterComments() Scheduler::ProcessEventsToIdle(); // Test that the typed characters ended up in the right window. - auto xTextField = xTextPortion->getPropertyValue("TextField").get< uno::Reference<beans::XPropertySet> >(); + auto xTextField = xTextPortion->getPropertyValue(u"TextField"_ustr).get< uno::Reference<beans::XPropertySet> >(); // This was empty, typed characters ended up in the body text. - CPPUNIT_ASSERT_EQUAL(OUString("test"), xTextField->getPropertyValue("Content").get<OUString>()); + CPPUNIT_ASSERT_EQUAL(u"test"_ustr, xTextField->getPropertyValue(u"Content"_ustr).get<OUString>()); } void DesktopLOKTest::testTrackChanges() @@ -1229,7 +1229,7 @@ void DesktopLOKTest::testSheetDragDrop() rViewFrame.GetBindings().QueryState(rViewFrame.GetBindings().QuerySlotId(aURL), pState); pState->QueryValue(aValue); aValue >>= sValue; - CPPUNIT_ASSERT_EQUAL(OUString("Sheet5.A1:E1"), sValue); + CPPUNIT_ASSERT_EQUAL(u"Sheet5.A1:E1"_ustr, sValue); } // Check selection content @@ -1285,7 +1285,7 @@ void DesktopLOKTest::testSheetDragDrop() rViewFrame.GetBindings().QueryState(rViewFrame.GetBindings().QuerySlotId(aURL), pState); pState->QueryValue(aValue); aValue >>= sValue; - CPPUNIT_ASSERT_EQUAL(OUString("Sheet5.D1:H1"), sValue); + CPPUNIT_ASSERT_EQUAL(u"Sheet5.D1:H1"_ustr, sValue); } // Check selection content @@ -2071,7 +2071,7 @@ void DesktopLOKTest::testRedlineWriter() // Load a Writer document, enable change recording and press a key. LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY); - xPropertySet->setPropertyValue("RecordChanges", uno::Any(true)); + xPropertySet->setPropertyValue(u"RecordChanges"_ustr, uno::Any(true)); pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0); pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0); Scheduler::ProcessEventsToIdle(); @@ -2098,7 +2098,7 @@ void DesktopLOKTest::testRedlineCalc() // Load a Writer document, enable change recording and press a key. LibLODocument_Impl* pDocument = loadDoc("sheets.ods"); uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY); - xPropertySet->setPropertyValue("RecordChanges", uno::Any(true)); + xPropertySet->setPropertyValue(u"RecordChanges"_ustr, uno::Any(true)); pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0); pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0); pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN); @@ -2299,10 +2299,10 @@ void DesktopLOKTest::testPaintPartTileDifferentSchemes() { uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence( { - { "NewTheme", uno::Any(OUString("Dark")) }, + { "NewTheme", uno::Any(u"Dark"_ustr) }, } ); - dispatchCommand(mxComponent, ".uno:ChangeTheme", aPropertyValues); + dispatchCommand(mxComponent, u".uno:ChangeTheme"_ustr, aPropertyValues); } constexpr int nCanvasWidth = 256; @@ -2342,7 +2342,7 @@ void DesktopLOKTest::testGetFontSubset() { LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); OUString aFontName = rtl::Uri::encode( - OUString("Liberation Sans"), + u"Liberation Sans"_ustr, rtl_UriCharClassRelSegment, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8 @@ -2680,30 +2680,30 @@ void DesktopLOKTest::testRunMacro() void DesktopLOKTest::testExtractParameter() { - OUString aOptions("Language=de-DE"); + OUString aOptions(u"Language=de-DE"_ustr); OUString aValue = extractParameter(aOptions, u"Language"); - CPPUNIT_ASSERT_EQUAL(OUString("de-DE"), aValue); + CPPUNIT_ASSERT_EQUAL(u"de-DE"_ustr, aValue); CPPUNIT_ASSERT_EQUAL(OUString(), aOptions); aOptions = "Language=en-US,Something"; aValue = extractParameter(aOptions, u"Language"); - CPPUNIT_ASSERT_EQUAL(OUString("en-US"), aValue); - CPPUNIT_ASSERT_EQUAL(OUString("Something"), aOptions); + CPPUNIT_ASSERT_EQUAL(u"en-US"_ustr, aValue); + CPPUNIT_ASSERT_EQUAL(u"Something"_ustr, aOptions); aOptions = "SomethingElse,Language=cs-CZ"; aValue = extractParameter(aOptions, u"Language"); - CPPUNIT_ASSERT_EQUAL(OUString("cs-CZ"), aValue); - CPPUNIT_ASSERT_EQUAL(OUString("SomethingElse"), aOptions); + CPPUNIT_ASSERT_EQUAL(u"cs-CZ"_ustr, aValue); + CPPUNIT_ASSERT_EQUAL(u"SomethingElse"_ustr, aOptions); aOptions = "Something1,Language=hu-HU,Something2"; aValue = extractParameter(aOptions, u"Language"); - CPPUNIT_ASSERT_EQUAL(OUString("hu-HU"), aValue); - CPPUNIT_ASSERT_EQUAL(OUString("Something1,Something2"), aOptions); + CPPUNIT_ASSERT_EQUAL(u"hu-HU"_ustr, aValue); + CPPUNIT_ASSERT_EQUAL(u"Something1,Something2"_ustr, aOptions); aOptions = "Something1,Something2=blah,Something3"; aValue = extractParameter(aOptions, u"Language"); CPPUNIT_ASSERT_EQUAL(OUString(), aValue); - CPPUNIT_ASSERT_EQUAL(OUString("Something1,Something2=blah,Something3"), aOptions); + CPPUNIT_ASSERT_EQUAL(u"Something1,Something2=blah,Something3"_ustr, aOptions); } void DesktopLOKTest::readFileIntoByteVector(std::u16string_view sFilename, std::vector<unsigned char> & rByteVector) @@ -3029,7 +3029,7 @@ void DesktopLOKTest::testDialogPaste() Control* pCtrlFocused = GetFocusControl(pWindow.get()); CPPUNIT_ASSERT(pCtrlFocused); CPPUNIT_ASSERT_EQUAL(WindowType::COMBOBOX, pCtrlFocused->GetType()); - CPPUNIT_ASSERT_EQUAL(OUString("www.softwarelibre.org.bo"), pCtrlFocused->GetText()); + CPPUNIT_ASSERT_EQUAL(u"www.softwarelibre.org.bo"_ustr, pCtrlFocused->GetText()); static_cast<SystemWindow*>(pWindow.get())->Close(); Scheduler::ProcessEventsToIdle(); @@ -3287,15 +3287,15 @@ void DesktopLOKTest::testMetricField() CPPUNIT_ASSERT(pWin); WindowUIObject aWinUI(pWin); - std::unique_ptr<UIObject> pUIWin(aWinUI.get_child("selectwidth")); + std::unique_ptr<UIObject> pUIWin(aWinUI.get_child(u"selectwidth"_ustr)); CPPUNIT_ASSERT(pUIWin); StringMap aMap; - aMap["VALUE"] = "75.06"; - pUIWin->execute("VALUE", aMap); + aMap[u"VALUE"_ustr] = "75.06"; + pUIWin->execute(u"VALUE"_ustr, aMap); StringMap aRet = pUIWin->get_state(); - CPPUNIT_ASSERT_EQUAL(aMap["VALUE"], aRet["Value"]); + CPPUNIT_ASSERT_EQUAL(aMap[u"VALUE"_ustr], aRet[u"Value"_ustr]); } void DesktopLOKTest::testJumpCursor() @@ -3363,7 +3363,7 @@ void DesktopLOKTest::testRenderSearchResult_WriterNode() if (bDumpBitmap) { - SvFileStream aStream("~/SearchResultBitmap.png", StreamMode::WRITE | StreamMode::TRUNC); + SvFileStream aStream(u"~/SearchResultBitmap.png"_ustr, StreamMode::WRITE | StreamMode::TRUNC); vcl::PngImageWriter aPNGWriter(aStream); aPNGWriter.write(aBitmap); } @@ -3408,7 +3408,7 @@ void DesktopLOKTest::testRenderSearchResult_CommonNode() if (bDumpBitmap) { - SvFileStream aStream("~/SearchResultBitmap.png", StreamMode::WRITE | StreamMode::TRUNC); + SvFileStream aStream(u"~/SearchResultBitmap.png"_ustr, StreamMode::WRITE | StreamMode::TRUNC); vcl::PngImageWriter aPNGWriter(aStream); aPNGWriter.write(aBitmap); } diff --git a/desktop/qa/unit/desktop-lok-init.cxx b/desktop/qa/unit/desktop-lok-init.cxx index 49971afc2e5c..90c645c07781 100644 --- a/desktop/qa/unit/desktop-lok-init.cxx +++ b/desktop/qa/unit/desktop-lok-init.cxx @@ -62,7 +62,7 @@ void LOKInitTest::testJsonToPropertyValues() "\"value\":\"something.odt\"" "}}"; - uno::Sequence aArgs{ comphelper::makePropertyValue("FileName", OUString("something.odt")) }; + uno::Sequence aArgs{ comphelper::makePropertyValue(u"FileName"_ustr, u"something.odt"_ustr) }; assertSequencesEqual( aArgs, comphelper::containerToSequence(desktop::jsonToPropertyValuesVector(arguments))); @@ -146,8 +146,8 @@ void LOKInitTest::testJsonToPropertyValuesBorder() uno::Any(static_cast<sal_Int16>(0x7F)), uno::Any(static_cast<sal_Int32>(0)) }; - uno::Sequence aArgs{ comphelper::makePropertyValue("OuterBorder", aOuterSeq), - comphelper::makePropertyValue("InnerBorder", aInnerSeq) }; + uno::Sequence aArgs{ comphelper::makePropertyValue(u"OuterBorder"_ustr, aOuterSeq), + comphelper::makePropertyValue(u"InnerBorder"_ustr, aInnerSeq) }; assertSequencesEqual( aArgs, comphelper::containerToSequence(desktop::jsonToPropertyValuesVector(arguments))); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 158f02909fa8..1dcc49f56d7c 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -206,11 +206,11 @@ namespace { // UserInstallation can be poisoned by old junk any more. bool cleanExtensionCache() { OUString buildId( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"); + u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"_ustr); rtl::Bootstrap::expandMacros(buildId); //TODO: detect failure OUString extDir( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") - ":UserInstallation}/user/extensions"); + u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") + ":UserInstallation}/user/extensions"_ustr); rtl::Bootstrap::expandMacros(extDir); //TODO: detect failure OUString buildIdFile(extDir + "/buildid"); osl::File fr(buildIdFile); @@ -247,8 +247,8 @@ bool cleanExtensionCache() { } utl::removeTree(extDir); OUString userRcFile( - "$UNO_USER_PACKAGES_CACHE/registry/" - "com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc"); + u"$UNO_USER_PACKAGES_CACHE/registry/" + "com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc"_ustr); rtl::Bootstrap::expandMacros(userRcFile); //TODO: detect failure rc = osl::File::remove(userRcFile); SAL_WARN_IF( @@ -332,8 +332,8 @@ void DoRestartActionsIfNecessary(bool quickstart) { void RemoveIconCacheDirectory() { // See getIconCacheUrl in vcl/source/image/ImplImageTree.cxx - OUString sUrl = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER - "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache"; + OUString sUrl = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER + "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache"_ustr; rtl::Bootstrap::expandMacros(sUrl); utl::UCBContentHelper::Kill(sUrl); } @@ -402,7 +402,7 @@ CommandLineArgs& Desktop::GetCommandLineArgs() OUString ReplaceStringHookProc( const OUString& rStr ) { - const static OUString sBuildId(utl::Bootstrap::getBuildIdData("development")), + const static OUString sBuildId(utl::Bootstrap::getBuildIdData(u"development"_ustr)), sBrandName(utl::ConfigManager::getProductName()), sVersion(utl::ConfigManager::getProductVersion()), sAboutBoxVersion(utl::ConfigManager::getAboutBoxProductVersion()), @@ -485,7 +485,7 @@ void Desktop::Init() if (officecfg::Setup::Office::OfficeRestartInProgress::get()) { if (!officecfg::Office::Common::Misc::FirstRun::get()) - GetCommandLineArgs().RemoveFilesFromOpenListEndingWith(".oxt"); + GetCommandLineArgs().RemoveFilesFromOpenListEndingWith(u".oxt"_ustr); } try @@ -933,7 +933,7 @@ void handleSafeMode() css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< css::frame::XSynchronousDispatch > xSafeModeUI( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.svx.SafeModeUI", xContext), + xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.comp.svx.SafeModeUI"_ustr, xContext), css::uno::UNO_QUERY_THROW); css::util::URL aURL; @@ -1002,7 +1002,7 @@ bool impl_callRecoveryUI(bool bEmergencySave , css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); g_xRecoveryUI.set( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.svx.RecoveryUI", xContext), + xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.comp.svx.RecoveryUI"_ustr, xContext), css::uno::UNO_QUERY_THROW); RefClearGuard<Reference< css::frame::XSynchronousDispatch >> refClearGuard(g_xRecoveryUI); @@ -1225,7 +1225,7 @@ private: Reference< XMultiServiceFactory > xSMgr = comphelper::getProcessServiceFactory(); Reference< css::loader::XImplementationLoader > xJavaComponentLoader( - xSMgr->createInstance("com.sun.star.comp.stoc.JavaComponentLoader"), + xSMgr->createInstance(u"com.sun.star.comp.stoc.JavaComponentLoader"_ustr), css::uno::UNO_QUERY_THROW); if (xJavaComponentLoader.is()) @@ -1233,7 +1233,7 @@ private: const css::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRegistryKey; try { - xJavaComponentLoader->activate("", "", "", xRegistryKey); + xJavaComponentLoader->activate(u""_ustr, u""_ustr, u""_ustr, xRegistryKey); } catch (...) { @@ -1367,7 +1367,7 @@ int Desktop::Main() OUString aTitle(ReplaceStringHookProc(RID_APPTITLE)); #ifdef DBG_UTIL //include buildid in non product builds - aTitle += " [" + utl::Bootstrap::getBuildIdData("development") + "]"; + aTitle += " [" + utl::Bootstrap::getBuildIdData(u"development"_ustr) + "]"; #endif SetDisplayName( aTitle ); @@ -2077,7 +2077,7 @@ void Desktop::OpenClients() } // write this information here to avoid depending on vcl in the crash reporter lib - CrashReporter::addKeyValue("Language", Application::GetSettings().GetLanguageTag().getBcp47(), CrashReporter::Create); + CrashReporter::addKeyValue(u"Language"_ustr, Application::GetSettings().GetLanguageTag().getBcp47(), CrashReporter::Create); RequestHandler::EnableRequests(); @@ -2295,7 +2295,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) { // no visible task that could be activated found Reference< css::awt::XWindow > xContainerWindow; - Reference< XFrame > xBackingFrame = xDesktop->findFrame( "_blank", 0); + Reference< XFrame > xBackingFrame = xDesktop->findFrame( u"_blank"_ustr, 0); if (xBackingFrame.is()) xContainerWindow = xBackingFrame->getContainerWindow(); if (xContainerWindow.is()) @@ -2442,7 +2442,7 @@ void Desktop::OpenSplashScreen() aAppName = "web"; // Which splash to use - OUString aSplashService( "com.sun.star.office.SplashScreen" ); + OUString aSplashService( u"com.sun.star.office.SplashScreen"_ustr ); if ( rCmdLine.HasSplashPipe() ) aSplashService = "com.sun.star.office.PipeSplashScreen"; @@ -2453,7 +2453,7 @@ void Desktop::OpenSplashScreen() UNO_QUERY); if(m_rSplashScreen.is()) - m_rSplashScreen->start("SplashScreen", 100); + m_rSplashScreen->start(u"SplashScreen"_ustr, 100); } #endif @@ -2501,7 +2501,7 @@ IMPL_STATIC_LINK_NOARG(Desktop, AsyncInitFirstRun, Timer *, void) try { Reference< XJobExecutor > xExecutor = theJobExecutor::get( ::comphelper::getProcessComponentContext() ); - xExecutor->trigger( "onFirstRunInitialization" ); + xExecutor->trigger( u"onFirstRunInitialization"_ustr ); } catch(const css::uno::Exception&) { @@ -2521,7 +2521,7 @@ void Desktop::ShowBackingComponent(Desktop * progress) { progress->SetSplashScreenProgress(60); } - Reference< XFrame > xBackingFrame = xDesktop->findFrame( "_blank", 0); + Reference< XFrame > xBackingFrame = xDesktop->findFrame( u"_blank"_ustr, 0); Reference< css::awt::XWindow > xContainerWindow; if (xBackingFrame.is()) diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 887b717d43ad..633ebde2d967 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -153,7 +153,7 @@ void Desktop::createAcceptor(const OUString& aAcceptString) Sequence< Any > aSeq{ Any(aAcceptString), Any(bAccept) }; Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference<XInitialization> rAcceptor( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Acceptor", xContext), + xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.office.Acceptor"_ustr, xContext), UNO_QUERY ); if ( rAcceptor.is() ) { diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index 7f76d155c31e..52047e0230fb 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -218,9 +218,9 @@ static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContex uno::Reference< lang::XMultiComponentFactory > xServiceManager( xContext->getServiceManager() ); if( !xServiceManager.is() ) throw uno::RuntimeException( - "impl_showExtensionDialog(): unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); + u"impl_showExtensionDialog(): unable to obtain service manager from component context"_ustr, uno::Reference< uno::XInterface > () ); - xService = xServiceManager->createInstanceWithContext( "com.sun.star.deployment.ui.UpdateRequiredDialog", xContext ); + xService = xServiceManager->createInstanceWithContext( u"com.sun.star.deployment.ui.UpdateRequiredDialog"_ustr, xContext ); uno::Reference< ui::dialogs::XExecutableDialog > xExecutable( xService, uno::UNO_QUERY ); if ( xExecutable.is() ) nRet = xExecutable->execute(); @@ -316,15 +316,15 @@ static void impl_setNeedsCompatCheck() configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() ) ); - beans::NamedValue v( "nodepath", - Any( OUString("org.openoffice.Setup/Office") ) ); + beans::NamedValue v( u"nodepath"_ustr, + Any( u"org.openoffice.Setup/Office"_ustr ) ); Sequence< Any > theArgs{ Any(v) }; Reference< beans::XPropertySet > pset( theConfigProvider->createInstanceWithArguments( aAccessSrvc, theArgs ), UNO_QUERY_THROW ); - Any value( OUString("never") ); + Any value( u"never"_ustr ); - pset->setPropertyValue("LastCompatibilityCheckID", value ); + pset->setPropertyValue(u"LastCompatibilityCheckID"_ustr, value ); Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges(); } catch (const Exception&) {} @@ -338,7 +338,7 @@ static bool impl_needsCompatCheck() { bool bNeedsCheck = false; OUString aLastCheckBuildID; - OUString aCurrentBuildID( "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}" ); + OUString aCurrentBuildID( u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}"_ustr ); rtl::Bootstrap::expandMacros( aCurrentBuildID ); try { @@ -346,20 +346,20 @@ static bool impl_needsCompatCheck() configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() ) ); - beans::NamedValue v( "nodepath", - Any( OUString("org.openoffice.Setup/Office") ) ); + beans::NamedValue v( u"nodepath"_ustr, + Any( u"org.openoffice.Setup/Office"_ustr ) ); Sequence< Any > theArgs{ Any(v) }; Reference< beans::XPropertySet > pset( theConfigProvider->createInstanceWithArguments( aAccessSrvc, theArgs ), UNO_QUERY_THROW ); - Any result = pset->getPropertyValue("LastCompatibilityCheckID"); + Any result = pset->getPropertyValue(u"LastCompatibilityCheckID"_ustr); result >>= aLastCheckBuildID; if ( aLastCheckBuildID != aCurrentBuildID ) { bNeedsCheck = true; result <<= aCurrentBuildID; - pset->setPropertyValue("LastCompatibilityCheckID", result ); + pset->setPropertyValue(u"LastCompatibilityCheckID"_ustr, result ); Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges(); } #if OSL_DEBUG_LEVEL >= 2 @@ -408,7 +408,7 @@ void Desktop::SynchronizeExtensionRepositories(bool bCleanedExtensionCache, Desk new SilentCommandEnv(context, pDesktop)); if (bCleanedExtensionCache) { deployment::ExtensionManager::get(context)->reinstallDeployedExtensions( - true, "user", Reference<task::XAbortChannel>(), silent); + true, u"user"_ustr, Reference<task::XAbortChannel>(), silent); #if !HAVE_FEATURE_MACOSX_SANDBOX if (!comphelper::LibreOfficeKit::isActive()) task::OfficeRestartManager::get(context)->requestRestart( diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index af26ef9eaab9..3b112cdc298b 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -104,7 +104,7 @@ std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_v const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); const Reference< XContainerQuery > xFilterFactory( - xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.FilterFactory", xContext ), + xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.document.FilterFactory"_ustr, xContext ), UNO_QUERY_THROW ); std::shared_ptr<const SfxFilter> pBestMatch; @@ -114,7 +114,7 @@ std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_v while ( xFilterEnum->hasMoreElements() ) { comphelper::SequenceAsHashMap aFilterProps( xFilterEnum->nextElement() ); - const OUString aName( aFilterProps.getUnpackedValueOrDefault( "Name", OUString() ) ); + const OUString aName( aFilterProps.getUnpackedValueOrDefault( u"Name"_ustr, OUString() ) ); if ( !aName.isEmpty() ) { std::shared_ptr<const SfxFilter> pFilter( SfxFilter::GetFilterByName( aName ) ); @@ -136,7 +136,7 @@ std::shared_ptr<const SfxFilter> impl_getExportFilterFromUrl( { const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); const Reference< document::XTypeDetection > xTypeDetector( - xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.TypeDetection", xContext ), + xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.document.TypeDetection"_ustr, xContext ), UNO_QUERY_THROW ); const OUString aTypeName( xTypeDetector->queryTypeByURL( rUrl ) ); @@ -273,13 +273,13 @@ void batchPrint( std::u16string_view rPrinterName, const Reference< XPrintable > Sequence < PropertyValue > aPrinterArgs; if( !aPrinterName.isEmpty() ) { - aPrinterArgs = { comphelper::makePropertyValue("Name", aPrinterName) }; + aPrinterArgs = { comphelper::makePropertyValue(u"Name"_ustr, aPrinterName) }; xDoc->setPrinter( aPrinterArgs ); } // print ( also without user interaction ) - aPrinterArgs = { comphelper::makePropertyValue("FileName", aOutFile), - comphelper::makePropertyValue("Wait", true) }; + aPrinterArgs = { comphelper::makePropertyValue(u"FileName"_ustr, aOutFile), + comphelper::makePropertyValue(u"Wait"_ustr, true) }; xDoc->print( aPrinterArgs ); } @@ -292,31 +292,31 @@ OUString getName(const Reference< XInterface > & xDoc) utl::MediaDescriptor aMediaDesc( xModel->getArgs() ); OUString aDocService = aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE, OUString() ); if (aDocService == "com.sun.star.text.TextDocument") - return "Writer"; + return u"Writer"_ustr; else if (aDocService == "com.sun.star.text.GlobalDocument") - return "Writer master"; + return u"Writer master"_ustr; else if (aDocService == "com.sun.star.text.WebDocument") - return "Writer/Web"; + return u"Writer/Web"_ustr; else if (aDocService == "com.sun.star.drawing.DrawingDocument") - return "Draw"; + return u"Draw"_ustr; else if (aDocService == "com.sun.star.presentation.PresentationDocument") - return "Impress"; + return u"Impress"_ustr; else if (aDocService == "com.sun.star.sheet.SpreadsheetDocument") - return "Calc"; + return u"Calc"_ustr; else if (aDocService == "com.sun.star.script.BasicIDE") - return "Basic"; + return u"Basic"_ustr; else if (aDocService == "com.sun.star.formula.FormulaProperties") - return "Math"; + return u"Math"_ustr; else if (aDocService == "com.sun.star.sdb.RelationDesign") - return "Relation Design"; + return u"Relation Design"_ustr; else if (aDocService == "com.sun.star.sdb.QueryDesign") - return "Query Design"; + return u"Query Design"_ustr; else if (aDocService == "com.sun.star.sdb.TableDesign") - return "Table Design"; + return u"Table Design"_ustr; else if (aDocService == "com.sun.star.sdb.DataSourceBrowser") - return "Data Source Browser"; + return u"Data Source Browser"_ustr; else if (aDocService == "com.sun.star.sdb.DatabaseDocument") - return "Database"; + return u"Database"_ustr; return OUString(); } @@ -357,10 +357,10 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest std::vector<PropertyValue> aArgs; // mark request as user interaction from outside - aArgs.emplace_back("Referer", 0, Any(OUString("private:OpenEvent")), + aArgs.emplace_back("Referer", 0, Any(u"private:OpenEvent"_ustr), PropertyState_DIRECT_VALUE); - OUString aTarget("_default"); + OUString aTarget(u"_default"_ustr); if ( aDispatchRequest.aRequestType == REQUEST_PRINT || aDispatchRequest.aRequestType == REQUEST_PRINTTO || @@ -464,7 +464,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest // We have to be listener to catch errors during dispatching URLs. // Otherwise it would be possible to have an office running without an open // window!! - Sequence < PropertyValue > aArgs2{ comphelper::makePropertyValue("SynchronMode", + Sequence < PropertyValue > aArgs2{ comphelper::makePropertyValue(u"SynchronMode"_ustr, true) }; Reference < XNotifyingDispatch > xDisp( xDispatcher, UNO_QUERY ); if ( xDisp.is() ) @@ -645,7 +645,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest Sequence<PropertyValue> conversionProperties( nProps ); auto pconversionProperties = conversionProperties.getArray(); pconversionProperties[0].Name = "ConversionRequestOrigin"; - pconversionProperties[0].Value <<= OUString("CommandLine"); + pconversionProperties[0].Value <<= u"CommandLine"_ustr; pconversionProperties[1].Name = "Overwrite"; pconversionProperties[1].Value <<= true; @@ -753,12 +753,12 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest { // create the printer Sequence < PropertyValue > aPrinterArgs{ comphelper::makePropertyValue( - "Name", aDispatchRequest.aPrinterName) }; + u"Name"_ustr, aDispatchRequest.aPrinterName) }; xDoc->setPrinter( aPrinterArgs ); } // print ( also without user interaction ) - Sequence < PropertyValue > aPrinterArgs{ comphelper::makePropertyValue("Wait", + Sequence < PropertyValue > aPrinterArgs{ comphelper::makePropertyValue(u"Wait"_ustr, true) }; xDoc->print( aPrinterArgs ); } @@ -795,8 +795,8 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest { // Execute all asynchronous dispatches now after we placed them into our request container! Sequence < PropertyValue > aArgs{ - comphelper::makePropertyValue("Referer", OUString("private:OpenEvent")), - comphelper::makePropertyValue("SynchronMode", true) + comphelper::makePropertyValue(u"Referer"_ustr, u"private:OpenEvent"_ustr), + comphelper::makePropertyValue(u"SynchronMode"_ustr, true) }; for (const DispatchHolder & aDispatche : aDispatches) diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 5eb2f0636bcd..702f0a66f224 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -86,7 +86,7 @@ bool prepareLocale() { std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create()); officecfg::Office::Linguistic::General::UILocale::set( - "", batch); + u""_ustr, batch); batch->commit(); } catch (const css::uno::Exception &) { TOOLS_WARN_EXCEPTION("desktop.app", "ignoring"); diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 1378c91bf6c6..9fa0b36342af 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -320,7 +320,7 @@ oslSignalAction SalMainPipeExchangeSignal_impl(SAL_UNUSED_PARAMETER void* /*pDat // XServiceInfo OUString SAL_CALL RequestHandlerController::getImplementationName() { - return "com.sun.star.comp.RequestHandlerController"; + return u"com.sun.star.comp.RequestHandlerController"_ustr; } sal_Bool RequestHandlerController::supportsService( @@ -1306,14 +1306,14 @@ bool RequestHandler::ExecuteCmdLineRequests( static std::vector<DispatchWatcher::DispatchRequest> aDispatchList; // Create dispatch list for dispatch watcher - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aInFilter, DispatchWatcher::REQUEST_INFILTER, "", aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aOpenList, DispatchWatcher::REQUEST_OPEN, "", aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aViewList, DispatchWatcher::REQUEST_VIEW, "", aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aStartList, DispatchWatcher::REQUEST_START, "", aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintList, DispatchWatcher::REQUEST_PRINT, "", aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aInFilter, DispatchWatcher::REQUEST_INFILTER, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aOpenList, DispatchWatcher::REQUEST_OPEN, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aViewList, DispatchWatcher::REQUEST_VIEW, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aStartList, DispatchWatcher::REQUEST_START, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintList, DispatchWatcher::REQUEST_PRINT, u""_ustr, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintToList, DispatchWatcher::REQUEST_PRINTTO, aRequest.aPrinterName, aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceOpenList, DispatchWatcher::REQUEST_FORCEOPEN, "", aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceNewList, DispatchWatcher::REQUEST_FORCENEW, "", aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceOpenList, DispatchWatcher::REQUEST_FORCEOPEN, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceNewList, DispatchWatcher::REQUEST_FORCENEW, u""_ustr, aRequest.aModule ); AddConversionsToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aConversionList, aRequest.aConversionParams, aRequest.aPrinterName, aRequest.aModule, aRequest.aConversionOut, aRequest.aImageConversionType, aRequest.bTextCat, aRequest.bScriptCat ); bool bShutdown( false ); diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index ad3df6bf3fd6..310fa1e4a020 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -56,7 +56,7 @@ static bool testOpenCLDriver() // whether the driver crashes (asserts,etc.) when trying to use OpenCL. SAL_INFO("opencl", "Starting CL driver test"); - OUString testerURL("$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/opencltest"); + OUString testerURL(u"$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/opencltest"_ustr); rtl::Bootstrap::expandMacros(testerURL); //TODO: detect failure OUString deviceName, platformName; @@ -126,10 +126,10 @@ static bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUSt try { css::uno::Reference< css::frame::XComponentLoader > xLoader(xDesktop, css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::beans::PropertyValue > aArgs{ comphelper::makePropertyValue("Hidden", + css::uno::Sequence< css::beans::PropertyValue > aArgs{ comphelper::makePropertyValue(u"Hidden"_ustr, true) }; - xComponent.set(xLoader->loadComponentFromURL(rURL, "_blank", 0, aArgs)); + xComponent.set(xLoader->loadComponentFromURL(rURL, u"_blank"_ustr, 0, aArgs)); // What an unpleasant API to use. css::uno::Reference< css::sheet::XCalculatable > xCalculatable( xComponent, css::uno::UNO_QUERY_THROW); @@ -148,7 +148,7 @@ static bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUSt // So we insert our MAX call at the end on a named range. css::uno::Reference< css::table::XCell2 > xCell( xSheet->getCellByPosition(1,0), css::uno::UNO_QUERY_THROW ); - xCell->setFormula("=MAX(results)"); + xCell->setFormula(u"=MAX(results)"_ustr); double fResult = xCell->getValue(); // Ensure the maximum variance is below our tolerance. @@ -212,7 +212,7 @@ void Desktop::CheckOpenCLCompute(const Reference< XDesktop2 > &xDesktop) aSelectedCLDeviceVersionID += "--" LIBO_VERSION_DOTTED; // Append timestamp of the file. - OUString aURL("$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/opencl/cl-test.ods"); + OUString aURL(u"$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/opencl/cl-test.ods"_ustr); rtl::Bootstrap::expandMacros(aURL); DirectoryItem aItem; diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 448977684b9a..73ac6e24cfe4 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -65,7 +65,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() desktop::Desktop aDesktop; // This string is used during initialization of the Gtk+ VCL module - Application::SetAppName( "soffice" ); + Application::SetAppName( u"soffice"_ustr ); // handle --version and --help already here, otherwise they would be handled // after VCL initialization that might fail if $DISPLAY is not set diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx index 5d75422cf0d5..480aecb7bd48 100644 --- a/desktop/source/deployment/dp_log.cxx +++ b/desktop/source/deployment/dp_log.cxx @@ -85,7 +85,7 @@ ProgressLogImpl::ProgressLogImpl( // XServiceInfo OUString ProgressLogImpl::getImplementationName() { - return "com.sun.star.comp.deployment.ProgressLog"; + return u"com.sun.star.comp.deployment.ProgressLog"_ustr; } sal_Bool ProgressLogImpl::supportsService( const OUString& ServiceName ) @@ -96,7 +96,7 @@ sal_Bool ProgressLogImpl::supportsService( const OUString& ServiceName ) css::uno::Sequence< OUString > ProgressLogImpl::getSupportedServiceNames() { // a private one - return { "com.sun.star.comp.deployment.ProgressLog" }; + return { u"com.sun.star.comp.deployment.ProgressLog"_ustr }; } // XProgressHandler diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx b/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx index f94b2989177b..09ebb86b99c5 100644 --- a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx @@ -27,8 +27,9 @@ using dp_gui::DependencyDialog; DependencyDialog::DependencyDialog(weld::Window* parent, std::vector<OUString> const& dependencies) - : GenericDialogController(parent, "desktop/ui/dependenciesdialog.ui", "Dependencies") - , m_xList(m_xBuilder->weld_tree_view("depListTreeview")) + : GenericDialogController(parent, u"desktop/ui/dependenciesdialog.ui"_ustr, + u"Dependencies"_ustr) + , m_xList(m_xBuilder->weld_tree_view(u"depListTreeview"_ustr)) { m_xList->set_size_request(-1, m_xList->get_height_rows(10)); for (auto const& dependency : dependencies) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index d5af09441405..99e1ccd489c2 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -223,13 +223,13 @@ bool ExtBoxWithBtns_Impl::Command(const CommandEvent& rCEvt) OUString ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const tools::Long nPos ) { if ( nPos >= static_cast<tools::Long>(getItemCount()) ) - return "CMD_NONE"; + return u"CMD_NONE"_ustr; - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "desktop/ui/extensionmenu.ui")); - std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu("menu")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, u"desktop/ui/extensionmenu.ui"_ustr)); + std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu(u"menu"_ustr)); #if ENABLE_EXTENSION_UPDATE - xPopup->append("CMD_UPDATE", DpResId( RID_CTX_ITEM_CHECK_UPDATE ) ); + xPopup->append(u"CMD_UPDATE"_ustr, DpResId( RID_CTX_ITEM_CHECK_UPDATE ) ); #endif if ( ! GetEntryData( nPos )->m_bLocked ) @@ -237,18 +237,18 @@ OUString ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const tools::Lo if ( GetEntryData( nPos )->m_bUser ) { if ( GetEntryData( nPos )->m_eState == REGISTERED ) - xPopup->append("CMD_DISABLE", DpResId(RID_CTX_ITEM_DISABLE)); + xPopup->append(u"CMD_DISABLE"_ustr, DpResId(RID_CTX_ITEM_DISABLE)); else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) - xPopup->append("CMD_ENABLE", DpResId(RID_CTX_ITEM_ENABLE)); + xPopup->append(u"CMD_ENABLE"_ustr, DpResId(RID_CTX_ITEM_ENABLE)); } if (!officecfg::Office::ExtensionManager::ExtensionSecurity::DisableExtensionRemoval::get()) { - xPopup->append("CMD_REMOVE", DpResId(RID_CTX_ITEM_REMOVE)); + xPopup->append(u"CMD_REMOVE"_ustr, DpResId(RID_CTX_ITEM_REMOVE)); } } if ( !GetEntryData( nPos )->m_sLicenseText.isEmpty() ) - xPopup->append("CMD_SHOW_LICENSE", DpResId(RID_STR_SHOW_LICENSE_CMD)); + xPopup->append(u"CMD_SHOW_LICENSE"_ustr, DpResId(RID_STR_SHOW_LICENSE_CMD)); return xPopup->popup_at_rect(GetDrawingArea(), tools::Rectangle(rPos, Size(1, 1))); } @@ -385,8 +385,8 @@ bool DialogHelper::installForAllUsers(bool &bInstallForAll) { const SolarMutexGuard guard; incBusy(); - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(getFrameWeld(), "desktop/ui/installforalldialog.ui")); - std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("InstallForAllDialog")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(getFrameWeld(), u"desktop/ui/installforalldialog.ui"_ustr)); + std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog(u"InstallForAllDialog"_ustr)); short nRet = xQuery->run(); xQuery.reset(); decBusy(); @@ -407,7 +407,7 @@ void DialogHelper::PostUserEvent( const Link<void*,void>& rLink, void* pCaller ) // ExtMgrDialog ExtMgrDialog::ExtMgrDialog(weld::Window *pParent, TheExtensionManager *pManager) - : GenericDialogController(pParent, "desktop/ui/extensionmanager.ui", "ExtensionManagerDialog") + : GenericDialogController(pParent, u"desktop/ui/extensionmanager.ui"_ustr, u"ExtensionManagerDialog"_ustr) , DialogHelper(pManager->getContext(), m_xDialog.get()) , m_sAddPackages(DpResId(RID_STR_ADD_PACKAGES)) , m_bHasProgress(false) @@ -421,22 +421,22 @@ ExtMgrDialog::ExtMgrDialog(weld::Window *pParent, TheExtensionManager *pManager) , m_nProgress(0) , m_aIdle( "ExtMgrDialog m_aIdle TimeOutHdl" ) , m_pManager(pManager) - , m_xExtensionBox(new ExtBoxWithBtns_Impl(m_xBuilder->weld_scrolled_window("scroll", true))) - , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, "extensions", *m_xExtensionBox)) - , m_xOptionsBtn(m_xBuilder->weld_button("optionsbtn")) - , m_xAddBtn(m_xBuilder->weld_button("addbtn")) - , m_xRemoveBtn(m_xBuilder->weld_button("removebtn")) - , m_xEnableBtn(m_xBuilder->weld_button("enablebtn")) - , m_xUpdateBtn(m_xBuilder->weld_button("updatebtn")) - , m_xCloseBtn(m_xBuilder->weld_button("close")) - , m_xBundledCbx(m_xBuilder->weld_check_button("bundled")) - , m_xSharedCbx(m_xBuilder->weld_check_button("shared")) - , m_xUserCbx(m_xBuilder->weld_check_button("user")) - , m_xGetExtensions(m_xBuilder->weld_link_button("getextensions")) - , m_xProgressText(m_xBuilder->weld_label("progressft")) - , m_xProgressBar(m_xBuilder->weld_progress_bar("progressbar")) - , m_xCancelBtn(m_xBuilder->weld_button("cancel")) - , m_xSearchEntry(m_xBuilder->weld_entry("search")) + , m_xExtensionBox(new ExtBoxWithBtns_Impl(m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true))) + , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, u"extensions"_ustr, *m_xExtensionBox)) + , m_xOptionsBtn(m_xBuilder->weld_button(u"optionsbtn"_ustr)) + , m_xAddBtn(m_xBuilder->weld_button(u"addbtn"_ustr)) + , m_xRemoveBtn(m_xBuilder->weld_button(u"removebtn"_ustr)) + , m_xEnableBtn(m_xBuilder->weld_button(u"enablebtn"_ustr)) + , m_xUpdateBtn(m_xBuilder->weld_button(u"updatebtn"_ustr)) + , m_xCloseBtn(m_xBuilder->weld_button(u"close"_ustr)) + , m_xBundledCbx(m_xBuilder->weld_check_button(u"bundled"_ustr)) + , m_xSharedCbx(m_xBuilder->weld_check_button(u"shared"_ustr)) + , m_xUserCbx(m_xBuilder->weld_check_button(u"user"_ustr)) + , m_xGetExtensions(m_xBuilder->weld_link_button(u"getextensions"_ustr)) + , m_xProgressText(m_xBuilder->weld_label(u"progressft"_ustr)) + , m_xProgressBar(m_xBuilder->weld_progress_bar(u"progressbar"_ustr)) + , m_xCancelBtn(m_xBuilder->weld_button(u"cancel"_ustr)) + , m_xSearchEntry(m_xBuilder->weld_entry(u"search"_ustr)) { m_xExtensionBox->InitFromDialog(this); @@ -674,7 +674,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() }(); // All files at top: - xFilePicker->appendFilter( StrAllFiles, "*.*" ); + xFilePicker->appendFilter( StrAllFiles, u"*.*"_ustr ); xFilePicker->appendFilter( DpResId(RID_STR_ALL_SUPPORTED), supportedFilters.makeStringAndClear() ); // then supported ones: for (auto const& elem : title2filter) @@ -713,7 +713,7 @@ void ExtMgrDialog::enableRemoveButton( bool bEnable ) } else { - m_xRemoveBtn->set_tooltip_text(""); + m_xRemoveBtn->set_tooltip_text(u""_ustr); } } @@ -803,7 +803,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface, void ) } else { - m_xAddBtn->set_tooltip_text(""); + m_xAddBtn->set_tooltip_text(u""_ustr); } m_xUpdateBtn->set_sensitive( !bLockInterface && m_xExtensionBox->getItemCount() ); @@ -984,7 +984,7 @@ void ExtMgrDialog::Close() //UpdateRequiredDialog UpdateRequiredDialog::UpdateRequiredDialog(weld::Window *pParent, TheExtensionManager *pManager) - : GenericDialogController(pParent, "desktop/ui/updaterequireddialog.ui", "UpdateRequiredDialog") + : GenericDialogController(pParent, u"desktop/ui/updaterequireddialog.ui"_ustr, u"UpdateRequiredDialog"_ustr) , DialogHelper(pManager->getContext(), m_xDialog.get()) , m_sCloseText(DpResId(RID_STR_CLOSE_BTN)) , m_bHasProgress(false) @@ -995,14 +995,14 @@ UpdateRequiredDialog::UpdateRequiredDialog(weld::Window *pParent, TheExtensionMa , m_nProgress(0) , m_aIdle( "UpdateRequiredDialog m_aIdle TimeOutHdl" ) , m_pManager(pManager) - , m_xExtensionBox(new ExtensionBox_Impl(m_xBuilder->weld_scrolled_window("scroll", true))) - , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, "extensions", *m_xExtensionBox)) - , m_xUpdateNeeded(m_xBuilder->weld_label("updatelabel")) - , m_xUpdateBtn(m_xBuilder->weld_button("ok")) - , m_xCloseBtn(m_xBuilder->weld_button("disable")) - , m_xCancelBtn(m_xBuilder->weld_button("cancel")) - , m_xProgressText(m_xBuilder->weld_label("progresslabel")) - , m_xProgressBar(m_xBuilder->weld_progress_bar("progress")) + , m_xExtensionBox(new ExtensionBox_Impl(m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true))) + , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, u"extensions"_ustr, *m_xExtensionBox)) + , m_xUpdateNeeded(m_xBuilder->weld_label(u"updatelabel"_ustr)) + , m_xUpdateBtn(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xCloseBtn(m_xBuilder->weld_button(u"disable"_ustr)) + , m_xCancelBtn(m_xBuilder->weld_button(u"cancel"_ustr)) + , m_xProgressText(m_xBuilder->weld_label(u"progresslabel"_ustr)) + , m_xProgressBar(m_xBuilder->weld_progress_bar(u"progress"_ustr)) { m_xExtensionBox->setExtensionManager(pManager); @@ -1342,8 +1342,8 @@ void UpdateRequiredDialog::disableAllEntries() // ShowLicenseDialog ShowLicenseDialog::ShowLicenseDialog(weld::Window* pParent, const uno::Reference< deployment::XPackage> &xPackage) - : GenericDialogController(pParent, "desktop/ui/showlicensedialog.ui", "ShowLicenseDialog") - , m_xLicenseText(m_xBuilder->weld_text_view("textview")) + : GenericDialogController(pParent, u"desktop/ui/showlicensedialog.ui"_ustr, u"ShowLicenseDialog"_ustr) + , m_xLicenseText(m_xBuilder->weld_text_view(u"textview"_ustr)) { m_xLicenseText->set_size_request(m_xLicenseText->get_approximate_digit_width() * 72, m_xLicenseText->get_height_rows(21)); @@ -1365,7 +1365,7 @@ UpdateRequiredDialogService::UpdateRequiredDialogService( SAL_UNUSED_PARAMETER u // XServiceInfo OUString UpdateRequiredDialogService::getImplementationName() { - return "com.sun.star.comp.deployment.ui.UpdateRequiredDialog"; + return u"com.sun.star.comp.deployment.ui.UpdateRequiredDialog"_ustr; } sal_Bool UpdateRequiredDialogService::supportsService( const OUString& ServiceName ) @@ -1375,7 +1375,7 @@ sal_Bool UpdateRequiredDialogService::supportsService( const OUString& ServiceNa css::uno::Sequence< OUString > UpdateRequiredDialogService::getSupportedServiceNames() { - return { "com.sun.star.deployment.ui.UpdateRequiredDialog" }; + return { u"com.sun.star.deployment.ui.UpdateRequiredDialog"_ustr }; } diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index fe7194405576..e9b5326afe10 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -88,7 +88,7 @@ namespace { OUString getVersion( OUString const & sVersion ) { - return ( sVersion.isEmpty() ) ? OUString( "0" ) : sVersion; + return ( sVersion.isEmpty() ) ? u"0"_ustr : sVersion; } OUString getVersion( const uno::Reference< deployment::XPackage > &rPackage ) @@ -838,7 +838,7 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv uno::Any anyTitle; try { - anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv, m_xContext ).getPropertyValue( "Title" ); + anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv, m_xContext ).getPropertyValue( u"Title"_ustr ); } catch ( const uno::Exception & ) { @@ -1092,7 +1092,7 @@ void ExtensionCmdQueue::acceptLicense( const uno::Reference< deployment::XPackag void ExtensionCmdQueue::syncRepositories( const uno::Reference< uno::XComponentContext > &xContext ) { - dp_misc::syncRepositories( false, new ProgressCmdEnv( xContext, nullptr, "Extension Manager" ) ); + dp_misc::syncRepositories( false, new ProgressCmdEnv( xContext, nullptr, u"Extension Manager"_ustr ) ); } bool ExtensionCmdQueue::isBusy() @@ -1103,7 +1103,7 @@ bool ExtensionCmdQueue::isBusy() void handleInteractionRequest( const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< task::XInteractionRequest > & xRequest ) { - ::rtl::Reference< ProgressCmdEnv > xCmdEnv( new ProgressCmdEnv( xContext, nullptr, "Extension Manager" ) ); + ::rtl::Reference< ProgressCmdEnv > xCmdEnv( new ProgressCmdEnv( xContext, nullptr, u"Extension Manager"_ustr ) ); xCmdEnv->handle( xRequest ); } diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index c359cb7501c7..896c181f5807 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -161,7 +161,7 @@ ServiceImpl::ServiceImpl( Sequence<Any> const& args, // XServiceInfo OUString ServiceImpl::getImplementationName() { - return "com.sun.star.comp.deployment.ui.PackageManagerDialog"; + return u"com.sun.star.comp.deployment.ui.PackageManagerDialog"_ustr; } sal_Bool ServiceImpl::supportsService( const OUString& ServiceName ) @@ -171,7 +171,7 @@ sal_Bool ServiceImpl::supportsService( const OUString& ServiceName ) css::uno::Sequence< OUString > ServiceImpl::getSupportedServiceNames() { - return { "com.sun.star.deployment.ui.PackageManagerDialog" }; + return { u"com.sun.star.deployment.ui.PackageManagerDialog"_ustr }; } // XAsynchronousExecutableDialog @@ -220,7 +220,7 @@ void ServiceImpl::startExecuteModal( OSL_ASSERT( ! bAppUp ); app.reset( new MyApp ); if (! InitVCL() ) - throw RuntimeException( "Cannot initialize VCL!", + throw RuntimeException( u"Cannot initialize VCL!"_ustr, static_cast<OWeakObject *>(this) ); Application::SetDisplayName( utl::ConfigManager::getProductName() + diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 8cf6623d9676..f942ee349c4b 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -68,24 +68,24 @@ TheExtensionManager::TheExtensionManager( uno::Reference< awt::XWindow > xParent configuration::theDefaultProvider::get(xContext)); uno::Sequence<uno::Any> args(comphelper::InitAnyPropertySequence( { - {"nodepath", uno::Any(OUString("/org.openoffice.Office.OptionsDialog/Nodes"))} + {"nodepath", uno::Any(u"/org.openoffice.Office.OptionsDialog/Nodes"_ustr)} })); m_xNameAccessNodes.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args), + xConfig->createInstanceWithArguments( u"com.sun.star.configuration.ConfigurationAccess"_ustr, args), uno::UNO_QUERY_THROW); // get the 'get more extensions here' url uno::Sequence<uno::Any> args2(comphelper::InitAnyPropertySequence( { - {"nodepath", uno::Any(OUString("/org.openoffice.Office.ExtensionManager/ExtensionRepositories"))} + {"nodepath", uno::Any(u"/org.openoffice.Office.ExtensionManager/ExtensionRepositories"_ustr)} })); uno::Reference< container::XNameAccess > xNameAccessRepositories; xNameAccessRepositories.set( - xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args2), + xConfig->createInstanceWithArguments( u"com.sun.star.configuration.ConfigurationAccess"_ustr, args2), uno::UNO_QUERY_THROW); try { //throws css::container::NoSuchElementException, css::lang::WrappedTargetException - uno::Any value = xNameAccessRepositories->getByName("WebsiteLink"); + uno::Any value = xNameAccessRepositories->getByName(u"WebsiteLink"_ustr); m_sGetExtensionsURL = value.get< OUString > (); } catch ( const uno::Exception& ) @@ -395,7 +395,7 @@ bool TheExtensionManager::supportsOptions( const uno::Reference< deployment::XPa uno::Reference< XInterface> xIntNode = anyNode.get< uno::Reference< XInterface > >(); uno::Reference< container::XNameAccess > xNode( xIntNode, uno::UNO_QUERY_THROW ); - uno::Any anyLeaves = xNode->getByName("Leaves"); + uno::Any anyLeaves = xNode->getByName(u"Leaves"_ustr); uno::Reference< XInterface > xIntLeaves = anyLeaves.get< uno::Reference< XInterface > >(); uno::Reference< container::XNameAccess > xLeaves( xIntLeaves, uno::UNO_QUERY_THROW ); @@ -408,7 +408,7 @@ bool TheExtensionManager::supportsOptions( const uno::Reference< deployment::XPa uno::Reference< beans::XPropertySet > xLeaf( xIntLeaf, uno::UNO_QUERY_THROW ); //investigate the Id property if it matches the extension identifier which //has been passed in. - uno::Any anyValue = xLeaf->getPropertyValue("Id"); + uno::Any anyValue = xLeaf->getPropertyValue(u"Id"_ustr); OUString sId = anyValue.get< OUString >(); if ( sId == aId.Value ) @@ -468,7 +468,7 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & ) { ToTop(); throw frame::TerminationVetoException( - "The office cannot be closed while the Extension Manager is running", + u"The office cannot be closed while the Extension Manager is running"_ustr, static_cast<frame::XTerminateListener*>(this)); } else diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 85786e63535c..5d22ca840585 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -270,7 +270,7 @@ void UpdateDialog::Thread::execute() if (extensions[2].is() ) sVersionBundled = extensions[2]->getVersion(); - bool bSharedReadOnly = extMgr->isReadOnlyRepository("shared"); + bool bSharedReadOnly = extMgr->isReadOnlyRepository(u"shared"_ustr); dp_misc::UPDATE_SOURCE sourceUser = dp_misc::isUpdateUserExtension( bSharedReadOnly, sVersionUser, sVersionShared, sVersionBundled, sOnlineVersion); @@ -421,7 +421,7 @@ UpdateDialog::UpdateDialog( uno::Reference< uno::XComponentContext > const & context, weld::Window * parent, std::vector<uno::Reference< deployment::XPackage > > && vExtensionList, std::vector< dp_gui::UpdateData > * updateData) - : GenericDialogController(parent, "desktop/ui/updatedialog.ui", "UpdateDialog") + : GenericDialogController(parent, u"desktop/ui/updatedialog.ui"_ustr, u"UpdateDialog"_ustr) , m_context(context) , m_none(DpResId(RID_DLG_UPDATE_NONE)) , m_noInstallable(DpResId(RID_DLG_UPDATE_NOINSTALLABLE)) @@ -436,20 +436,20 @@ UpdateDialog::UpdateDialog( , m_ignoredUpdate(DpResId(RID_DLG_UPDATE_IGNORED_UPDATE)) , m_updateData(*updateData) , m_thread(new UpdateDialog::Thread(context, *this, std::move(vExtensionList))) - , m_xChecking(m_xBuilder->weld_label("UPDATE_CHECKING")) - , m_xThrobber(m_xBuilder->weld_spinner("THROBBER")) - , m_xUpdate(m_xBuilder->weld_label("UPDATE_LABEL")) - , m_xUpdates(m_xBuilder->weld_tree_view("checklist")) - , m_xAll(m_xBuilder->weld_check_button("UPDATE_ALL")) - , m_xDescription(m_xBuilder->weld_label("DESCRIPTION_LABEL")) - , m_xPublisherLabel(m_xBuilder->weld_label("PUBLISHER_LABEL")) - , m_xPublisherLink(m_xBuilder->weld_link_button("PUBLISHER_LINK")) - , m_xReleaseNotesLabel(m_xBuilder->weld_label("RELEASE_NOTES_LABEL")) - , m_xReleaseNotesLink(m_xBuilder->weld_link_button("RELEASE_NOTES_LINK")) - , m_xDescriptions(m_xBuilder->weld_text_view("DESCRIPTIONS")) - , m_xOk(m_xBuilder->weld_button("ok")) - , m_xClose(m_xBuilder->weld_button("close")) - , m_xHelp(m_xBuilder->weld_button("help")) + , m_xChecking(m_xBuilder->weld_label(u"UPDATE_CHECKING"_ustr)) + , m_xThrobber(m_xBuilder->weld_spinner(u"THROBBER"_ustr)) + , m_xUpdate(m_xBuilder->weld_label(u"UPDATE_LABEL"_ustr)) + , m_xUpdates(m_xBuilder->weld_tree_view(u"checklist"_ustr)) + , m_xAll(m_xBuilder->weld_check_button(u"UPDATE_ALL"_ustr)) + , m_xDescription(m_xBuilder->weld_label(u"DESCRIPTION_LABEL"_ustr)) + , m_xPublisherLabel(m_xBuilder->weld_label(u"PUBLISHER_LABEL"_ustr)) + , m_xPublisherLink(m_xBuilder->weld_link_button(u"PUBLISHER_LINK"_ustr)) + , m_xReleaseNotesLabel(m_xBuilder->weld_label(u"RELEASE_NOTES_LABEL"_ustr)) + , m_xReleaseNotesLink(m_xBuilder->weld_link_button(u"RELEASE_NOTES_LINK"_ustr)) + , m_xDescriptions(m_xBuilder->weld_text_view(u"DESCRIPTIONS"_ustr)) + , m_xOk(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xClose(m_xBuilder->weld_button(u"close"_ustr)) + , m_xHelp(m_xBuilder->weld_button(u"help"_ustr)) { auto nWidth = m_xDescriptions->get_approximate_digit_width() * 62; auto nHeight = m_xDescriptions->get_height_rows(8); @@ -608,16 +608,16 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly, comphelper::getProcessComponentContext())); uno::Sequence< uno::Any > aArgumentList{ uno::Any(comphelper::makePropertyValue( - "nodepath", - OUString("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob"))) }; + u"nodepath"_ustr, + u"org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob"_ustr)) }; uno::Reference< container::XNameAccess > xNameAccess( xConfigProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), + u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArgumentList ), uno::UNO_QUERY_THROW ); util::URL aURL; - xNameAccess->getByName("URL") >>= aURL.Complete; + xNameAccess->getByName(u"URL"_ustr) >>= aURL.Complete; uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference < util::XURLTransformer > xTransformer = util::URLTransformer::create(xContext); @@ -631,8 +631,8 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly, if( xDispatch.is() ) { - uno::Sequence aPropList{ comphelper::makePropertyValue("updateList", rItemList), - comphelper::makePropertyValue("prepareOnly", bPrepareOnly) }; + uno::Sequence aPropList{ comphelper::makePropertyValue(u"updateList"_ustr, rItemList), + comphelper::makePropertyValue(u"prepareOnly"_ustr, bPrepareOnly) }; xDispatch->dispatch(aURL, aPropList ); } @@ -695,12 +695,12 @@ void UpdateDialog::clearDescription() { m_xPublisherLabel->hide(); m_xPublisherLink->hide(); - m_xPublisherLink->set_label(""); - m_xPublisherLink->set_uri(""); + m_xPublisherLink->set_label(u""_ustr); + m_xPublisherLink->set_uri(u""_ustr); m_xReleaseNotesLabel->hide(); m_xReleaseNotesLink->hide(); - m_xReleaseNotesLink->set_uri( "" ); - m_xDescriptions->set_text(""); + m_xReleaseNotesLink->set_uri( u""_ustr ); + m_xDescriptions->set_text(u""_ustr); } bool UpdateDialog::showDescription(uno::Reference< xml::dom::XNode > const & aUpdateInfo) @@ -715,7 +715,7 @@ bool UpdateDialog::showDescription(uno::Reference< deployment::XPackage > const OSL_ASSERT(aExtension.is()); beans::StringPair pubInfo = aExtension->getPublisherInfo(); return showDescription(std::make_pair(pubInfo.First, pubInfo.Second), - ""); + u""_ustr); } bool UpdateDialog::showDescription(std::pair< OUString, OUString > const & pairPublisher, @@ -759,10 +759,10 @@ void UpdateDialog::getIgnoredUpdates() { uno::Reference< lang::XMultiServiceFactory > xConfig( configuration::theDefaultProvider::get(m_context)); - beans::NamedValue aValue( "nodepath", uno::Any( OUString(IGNORED_UPDATES) ) ); + beans::NamedValue aValue( u"nodepath"_ustr, uno::Any( OUString(IGNORED_UPDATES) ) ); uno::Sequence< uno::Any > args{ uno::Any(aValue) }; - uno::Reference< container::XNameAccess > xNameAccess( xConfig->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", args), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xNameAccess( xConfig->createInstanceWithArguments( u"com.sun.star.configuration.ConfigurationAccess"_ustr, args), uno::UNO_QUERY_THROW ); const uno::Sequence< OUString > aElementNames = xNameAccess->getElementNames(); for ( OUString const & aIdentifier : aElementNames ) @@ -862,8 +862,8 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void) if (data.unsatisfiedDependencies.hasElements()) { // create error string for version mismatch - OUString sVersion( "%VERSION" ); - OUString sProductName( "%PRODUCTNAME" ); + OUString sVersion( u"%VERSION"_ustr ); + OUString sProductName( u"%PRODUCTNAME"_ustr ); sal_Int32 nPos = m_noDependencyCurVer.indexOf( sVersion ); if ( nPos >= 0 ) { diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index e15c72c9caac..1e87852d9b4a 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -179,8 +179,8 @@ UpdateInstallDialog::UpdateInstallDialog( weld::Window* pParent, std::vector<dp_gui::UpdateData> & aVecUpdateData, css::uno::Reference< css::uno::XComponentContext > const & xCtx) - : GenericDialogController(pParent, "desktop/ui/updateinstalldialog.ui", - "UpdateInstallDialog") + : GenericDialogController(pParent, u"desktop/ui/updateinstalldialog.ui"_ustr, + u"UpdateInstallDialog"_ustr) , m_thread(new Thread(xCtx, *this, aVecUpdateData)) , m_bError(false) , m_bNoEntry(true) @@ -192,13 +192,13 @@ UpdateInstallDialog::UpdateInstallDialog( , m_sErrorLicenseDeclined(DpResId(RID_DLG_UPDATE_INSTALL_ERROR_LIC_DECLINED)) , m_sNoInstall(DpResId(RID_DLG_UPDATE_INSTALL_EXTENSION_NOINSTALL)) , m_sThisErrorOccurred(DpResId(RID_DLG_UPDATE_INSTALL_THIS_ERROR_OCCURRED)) - , m_xFt_action(m_xBuilder->weld_label("DOWNLOADING")) - , m_xStatusbar(m_xBuilder->weld_progress_bar("STATUSBAR")) - , m_xFt_extension_name(m_xBuilder->weld_label("EXTENSION_NAME")) - , m_xMle_info(m_xBuilder->weld_text_view("INFO")) - , m_xHelp(m_xBuilder->weld_button("help")) - , m_xOk(m_xBuilder->weld_button("ok")) - , m_xCancel(m_xBuilder->weld_button("cancel")) + , m_xFt_action(m_xBuilder->weld_label(u"DOWNLOADING"_ustr)) + , m_xStatusbar(m_xBuilder->weld_progress_bar(u"STATUSBAR"_ustr)) + , m_xFt_extension_name(m_xBuilder->weld_label(u"EXTENSION_NAME"_ustr)) + , m_xMle_info(m_xBuilder->weld_text_view(u"INFO"_ustr)) + , m_xHelp(m_xBuilder->weld_button(u"help"_ustr)) + , m_xOk(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xCancel(m_xBuilder->weld_button(u"cancel"_ustr)) { m_xMle_info->set_size_request(m_xMle_info->get_approximate_digit_width() * 52, m_xMle_info->get_height_rows(5)); @@ -292,7 +292,7 @@ void UpdateInstallDialog::Thread::downloadExtensions() //create the download directory in the temp folder OUString sTempDir; if (::osl::FileBase::getTempDirURL(sTempDir) != ::osl::FileBase::E_None) - throw css::uno::Exception("Could not get URL for the temp directory. No extensions will be installed.", nullptr); + throw css::uno::Exception(u"Could not get URL for the temp directory. No extensions will be installed."_ustr, nullptr); //create a unique name for the directory OUString tempEntry, destFolder; @@ -439,15 +439,15 @@ void UpdateInstallDialog::Thread::installExtensions() } if (!updateData.aUpdateSource.is() && !updateData.sLocalURL.isEmpty()) { - css::beans::NamedValue prop("EXTENSION_UPDATE", css::uno::Any(OUString("1"))); + css::beans::NamedValue prop(u"EXTENSION_UPDATE"_ustr, css::uno::Any(u"1"_ustr)); if (!updateData.bIsShared) xExtension = m_dialog.getExtensionManager()->addExtension( updateData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1), - "user", xAbortChannel, m_updateCmdEnv); + u"user"_ustr, xAbortChannel, m_updateCmdEnv); else xExtension = m_dialog.getExtensionManager()->addExtension( updateData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1), - "shared", xAbortChannel, m_updateCmdEnv); + u"shared"_ustr, xAbortChannel, m_updateCmdEnv); } else if (updateData.aUpdateSource.is()) { @@ -456,15 +456,15 @@ void UpdateInstallDialog::Thread::installExtensions() //add extension. Currently it contains only "SUPPRESS_LICENSE". So it could happen //that a license is displayed when updating from the shared repository, although the //shared extension was installed using "SUPPRESS_LICENSE". - css::beans::NamedValue prop("EXTENSION_UPDATE", css::uno::Any(OUString("1"))); + css::beans::NamedValue prop(u"EXTENSION_UPDATE"_ustr, css::uno::Any(u"1"_ustr)); if (!updateData.bIsShared) xExtension = m_dialog.getExtensionManager()->addExtension( updateData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1), - "user", xAbortChannel, m_updateCmdEnv); + u"user"_ustr, xAbortChannel, m_updateCmdEnv); else xExtension = m_dialog.getExtensionManager()->addExtension( updateData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1), - "shared", xAbortChannel, m_updateCmdEnv); + u"shared"_ustr, xAbortChannel, m_updateCmdEnv); } } catch (css::deployment::DeploymentException & de) diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 23f184a333dc..24bf5e350d65 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -77,17 +77,17 @@ LicenseDialogImpl::LicenseDialogImpl( weld::Window * pParent, std::u16string_view sExtensionName, const OUString & sLicenseText) - : GenericDialogController(pParent, "desktop/ui/licensedialog.ui", "LicenseDialog") + : GenericDialogController(pParent, u"desktop/ui/licensedialog.ui"_ustr, u"LicenseDialog"_ustr) , m_bLicenseRead(false) , m_aResized("desktop LicenseDialogImpl m_aResized") , m_aRepeat("LicenseDialogImpl m_aRepeat") - , m_xFtHead(m_xBuilder->weld_label("head")) - , m_xArrow1(m_xBuilder->weld_widget("arrow1")) - , m_xArrow2(m_xBuilder->weld_widget("arrow2")) - , m_xLicense(m_xBuilder->weld_text_view("textview")) - , m_xDown(m_xBuilder->weld_button("down")) - , m_xAcceptButton(m_xBuilder->weld_button("ok")) - , m_xDeclineButton(m_xBuilder->weld_button("cancel")) + , m_xFtHead(m_xBuilder->weld_label(u"head"_ustr)) + , m_xArrow1(m_xBuilder->weld_widget(u"arrow1"_ustr)) + , m_xArrow2(m_xBuilder->weld_widget(u"arrow2"_ustr)) + , m_xLicense(m_xBuilder->weld_text_view(u"textview"_ustr)) + , m_xDown(m_xBuilder->weld_button(u"down"_ustr)) + , m_xAcceptButton(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xDeclineButton(m_xBuilder->weld_button(u"cancel"_ustr)) { m_xArrow1->show(); m_xArrow2->hide(); @@ -207,7 +207,7 @@ LicenseDialog::LicenseDialog( Sequence<Any> const& args, // XServiceInfo OUString LicenseDialog::getImplementationName() { - return "com.sun.star.comp.deployment.ui.LicenseDialog"; + return u"com.sun.star.comp.deployment.ui.LicenseDialog"_ustr; } sal_Bool LicenseDialog::supportsService( const OUString& ServiceName ) @@ -217,7 +217,7 @@ sal_Bool LicenseDialog::supportsService( const OUString& ServiceName ) css::uno::Sequence< OUString > LicenseDialog::getSupportedServiceNames() { - return { "com.sun.star.deployment.ui.LicenseDialog" }; + return { u"com.sun.star.deployment.ui.LicenseDialog"_ustr }; } diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h index e72a2cce9332..1cf03eb31631 100644 --- a/desktop/source/deployment/inc/dp_ucb.h +++ b/desktop/source/deployment/inc/dp_ucb.h @@ -36,12 +36,12 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle { static css::uno::Sequence< OUString > getTitleSequence() { - css::uno::Sequence<OUString> aSeq { "Title" }; + css::uno::Sequence<OUString> aSeq { u"Title"_ustr }; return aSeq; } static OUString getTitle( ::ucbhelper::Content &rContent ) { - return rContent.getPropertyValue("Title").get<OUString>(); + return rContent.getPropertyValue(u"Title"_ustr).get<OUString>(); } // just return titles - the ucbhelper should have a simpler API for this [!] static css::uno::Reference< css::sdbc::XResultSet > diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx index fae938019c27..105c34c31e8e 100644 --- a/desktop/source/deployment/manager/dp_activepackages.hxx +++ b/desktop/source/deployment/manager/dp_activepackages.hxx @@ -37,7 +37,7 @@ namespace dp_manager { class ActivePackages { public: struct Data { - Data(): failedPrerequisites("0") + Data(): failedPrerequisites(u"0"_ustr) {} /* name of the temporary file (shared, user extension) or the name of the folder of the bundled extension. diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 6c210101fcc0..29504fd32954 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -173,7 +173,7 @@ ExtensionManager::~ExtensionManager() // XServiceInfo OUString ExtensionManager::getImplementationName() { - return "com.sun.star.comp.deployment.ExtensionManager"; + return u"com.sun.star.comp.deployment.ExtensionManager"_ustr; } sal_Bool ExtensionManager::supportsService( const OUString& ServiceName ) @@ -184,28 +184,28 @@ sal_Bool ExtensionManager::supportsService( const OUString& ServiceName ) css::uno::Sequence< OUString > ExtensionManager::getSupportedServiceNames() { // a private one: - return { "com.sun.star.comp.deployment.ExtensionManager" }; + return { u"com.sun.star.comp.deployment.ExtensionManager"_ustr }; } Reference<css::deployment::XPackageManager> ExtensionManager::getUserRepository() { - return m_xPackageManagerFactory->getPackageManager("user"); + return m_xPackageManagerFactory->getPackageManager(u"user"_ustr); } Reference<css::deployment::XPackageManager> ExtensionManager::getSharedRepository() { - return m_xPackageManagerFactory->getPackageManager("shared"); + return m_xPackageManagerFactory->getPackageManager(u"shared"_ustr); } Reference<css::deployment::XPackageManager> ExtensionManager::getBundledRepository() { - return m_xPackageManagerFactory->getPackageManager("bundled"); + return m_xPackageManagerFactory->getPackageManager(u"bundled"_ustr); } Reference<css::deployment::XPackageManager> ExtensionManager::getTmpRepository() { - return m_xPackageManagerFactory->getPackageManager("tmp"); + return m_xPackageManagerFactory->getPackageManager(u"tmp"_ustr); } Reference<css::deployment::XPackageManager> ExtensionManager::getBakRepository() { - return m_xPackageManagerFactory->getPackageManager("bak"); + return m_xPackageManagerFactory->getPackageManager(u"bak"_ustr); } Reference<task::XAbortChannel> ExtensionManager::createAbortChannel() @@ -229,7 +229,7 @@ ExtensionManager::getPackageManager(std::u16string_view repository) xPackageManager = getBakRepository(); else throw lang::IllegalArgumentException( - "No valid repository name provided.", + u"No valid repository name provided."_ustr, static_cast<cppu::OWeakObject*>(this), 0); return xPackageManager; } @@ -349,7 +349,7 @@ ExtensionManager::getExtensionsWithSameIdentifier( { uno::Any exc = ::cppu::getCaughtException(); throw css::deployment::DeploymentException( - "Extension Manager: exception during getExtensionsWithSameIdentifier", + u"Extension Manager: exception during getExtensionsWithSameIdentifier"_ustr, static_cast<OWeakObject*>(this), exc); } } @@ -594,12 +594,12 @@ bool ExtensionManager::doChecksForAddExtension( } catch (const uno::Exception &) { uno::Any excOccurred = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: exception in doChecksForAddExtension", + u"Extension Manager: exception in doChecksForAddExtension"_ustr, static_cast<OWeakObject*>(this), excOccurred); throw exc; } catch (...) { throw uno::RuntimeException( - "Extension Manager: unexpected exception in doChecksForAddExtension", + u"Extension Manager: unexpected exception in doChecksForAddExtension"_ustr, static_cast<OWeakObject*>(this)); } } @@ -620,7 +620,7 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension( xPackageManager = getSharedRepository(); else throw lang::IllegalArgumentException( - "No valid repository name provided.", + u"No valid repository name provided."_ustr, static_cast<cppu::OWeakObject*>(this), 0); //We must make sure that the xTmpExtension is not create twice, because this //would remove the first one. @@ -744,14 +744,14 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension( } catch (const uno::Exception &) { uno::Any excOccurred = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: Exception on fireModified() " - "in the scope of 'if (failedPrereq == 0)'", + u"Extension Manager: Exception on fireModified() " + "in the scope of 'if (failedPrereq == 0)'"_ustr, static_cast<OWeakObject*>(this), excOccurred); throw exc; } catch (...) { throw uno::RuntimeException( - "Extension Manager: RuntimeException on fireModified() " - "in the scope of 'if (failedPrereq == 0)'", + u"Extension Manager: RuntimeException on fireModified() " + "in the scope of 'if (failedPrereq == 0)'"_ustr, static_cast<OWeakObject*>(this)); } } @@ -763,7 +763,7 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension( ::cppu::throwException(pSilentCommandEnv->m_UnknownException); else throw css::deployment::DeploymentException ( - "Extension Manager: exception during addExtension, ckeckPrerequisites failed", + u"Extension Manager: exception during addExtension, ckeckPrerequisites failed"_ustr, static_cast<OWeakObject*>(this), uno::Any()); } } @@ -835,7 +835,7 @@ void ExtensionManager::removeExtension( xPackageManager = getSharedRepository(); else throw lang::IllegalArgumentException( - "No valid repository name provided.", + u"No valid repository name provided."_ustr, static_cast<cppu::OWeakObject*>(this), 0); bUserDisabled = isUserDisabled(identifier, fileName); @@ -868,7 +868,7 @@ void ExtensionManager::removeExtension( } catch (...) { excOccurred1 = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: exception during removeExtension", + u"Extension Manager: exception during removeExtension"_ustr, static_cast<OWeakObject*>(this), excOccurred1); excOccurred1 <<= exc; } @@ -925,7 +925,7 @@ void ExtensionManager::enableExtension( OUString repository = extension->getRepositoryName(); if (repository != "user") throw lang::IllegalArgumentException( - "No valid repository name provided.", + u"No valid repository name provided."_ustr, static_cast<cppu::OWeakObject*>(this), 0); bUserDisabled = isUserDisabled(dp_misc::getIdentifier(extension), @@ -948,7 +948,7 @@ void ExtensionManager::enableExtension( } catch (...) { excOccurred = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: exception during enableExtension", + u"Extension Manager: exception during enableExtension"_ustr, static_cast<OWeakObject*>(this), excOccurred); excOccurred <<= exc; } @@ -1006,7 +1006,7 @@ sal_Int32 ExtensionManager::checkPrerequisitesAndEnable( } catch (...) { uno::Any excOccurred = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: exception during disableExtension", + u"Extension Manager: exception during disableExtension"_ustr, static_cast<OWeakObject*>(this), excOccurred); throw exc; } @@ -1027,7 +1027,7 @@ void ExtensionManager::disableExtension( const OUString repository( extension->getRepositoryName()); if (repository != "user") throw lang::IllegalArgumentException( - "No valid repository name provided.", + u"No valid repository name provided."_ustr, static_cast<cppu::OWeakObject*>(this), 0); const OUString id(dp_misc::getIdentifier(extension)); @@ -1049,7 +1049,7 @@ void ExtensionManager::disableExtension( } catch (...) { excOccurred = ::cppu::getCaughtException(); css::deployment::DeploymentException exc( - "Extension Manager: exception during disableExtension", + u"Extension Manager: exception during disableExtension"_ustr, static_cast<OWeakObject*>(this), excOccurred); excOccurred <<= exc; } @@ -1144,7 +1144,7 @@ uno::Sequence< uno::Sequence<Reference<css::deployment::XPackage> > > } catch (...) { uno::Any exc = ::cppu::getCaughtException(); throw css::deployment::DeploymentException( - "Extension Manager: exception during enableExtension", + u"Extension Manager: exception during enableExtension"_ustr, static_cast<OWeakObject*>(this), exc); } } @@ -1223,7 +1223,7 @@ void ExtensionManager::reinstallDeployedExtensions( } catch (...) { uno::Any exc = ::cppu::getCaughtException(); throw css::deployment::DeploymentException( - "Extension Manager: exception during enableExtension", + u"Extension Manager: exception during enableExtension"_ustr, static_cast<OWeakObject*>(this), exc); } } @@ -1239,13 +1239,13 @@ sal_Bool ExtensionManager::synchronize( sSynchronizingShared = sSynchronizingShared.replaceAll("%NAME", "shared"); dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared); bool bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv); - progressShared.update("\n\n"); + progressShared.update(u"\n\n"_ustr); OUString sSynchronizingBundled(StrSyncRepository()); sSynchronizingBundled = sSynchronizingBundled.replaceAll("%NAME", "bundled"); dp_misc::ProgressLevel progressBundled(xCmdEnv, sSynchronizingBundled); bModified |= static_cast<bool>(getBundledRepository()->synchronize(xAbortChannel, xCmdEnv)); - progressBundled.update("\n\n"); + progressBundled.update(u"\n\n"_ustr); //Always determine the active extension. //TODO: Is this still necessary? (It used to be necessary for the @@ -1272,9 +1272,9 @@ sal_Bool ExtensionManager::synchronize( //so we will no repeat this every time OOo starts. OSL_FAIL("Extensions Manager: synchronize"); } - OUString lastSyncBundled("$BUNDLED_EXTENSIONS_USER/lastsynchronized"); + OUString lastSyncBundled(u"$BUNDLED_EXTENSIONS_USER/lastsynchronized"_ustr); writeLastModified(lastSyncBundled, xCmdEnv, m_xContext); - OUString lastSyncShared("$SHARED_EXTENSIONS_USER/lastsynchronized"); + OUString lastSyncShared(u"$SHARED_EXTENSIONS_USER/lastsynchronized"_ustr); writeLastModified(lastSyncShared, xCmdEnv, m_xContext); return bModified; } catch ( const css::deployment::DeploymentException& ) { @@ -1290,7 +1290,7 @@ sal_Bool ExtensionManager::synchronize( } catch (...) { uno::Any exc = ::cppu::getCaughtException(); throw css::deployment::DeploymentException( - "Extension Manager: exception in synchronize", + u"Extension Manager: exception in synchronize"_ustr, static_cast<OWeakObject*>(this), exc); } } @@ -1400,7 +1400,7 @@ void ExtensionManager::check() ::osl::MutexGuard guard( m_aMutex ); if (rBHelper.bInDispose || rBHelper.bDisposed) { throw lang::DisposedException( - "ExtensionManager instance has already been disposed!", + u"ExtensionManager instance has already been disposed!"_ustr, static_cast<OWeakObject *>(this) ); } } diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index 5b6d6a92b947..14208c3b27a3 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -96,7 +96,7 @@ PackageInformationProvider::PackageInformationProvider( uno::Reference< uno::XCo // XServiceInfo OUString PackageInformationProvider::getImplementationName() { - return "com.sun.star.comp.deployment.PackageInformationProvider"; + return u"com.sun.star.comp.deployment.PackageInformationProvider"_ustr; } sal_Bool PackageInformationProvider::supportsService( const OUString& ServiceName ) @@ -107,7 +107,7 @@ sal_Bool PackageInformationProvider::supportsService( const OUString& ServiceNam css::uno::Sequence< OUString > PackageInformationProvider::getSupportedServiceNames() { // a private one: - return { "com.sun.star.comp.deployment.PackageInformationProvider" }; + return { u"com.sun.star.comp.deployment.PackageInformationProvider"_ustr }; } OUString PackageInformationProvider::getPackageLocation( @@ -148,15 +148,15 @@ OUString PackageInformationProvider::getPackageLocation( OUString SAL_CALL PackageInformationProvider::getPackageLocation( const OUString& _sExtensionId ) { - OUString aLocationURL = getPackageLocation( "user", _sExtensionId ); + OUString aLocationURL = getPackageLocation( u"user"_ustr, _sExtensionId ); if ( aLocationURL.isEmpty() ) { - aLocationURL = getPackageLocation( "shared", _sExtensionId ); + aLocationURL = getPackageLocation( u"shared"_ustr, _sExtensionId ); } if ( aLocationURL.isEmpty() ) { - aLocationURL = getPackageLocation( "bundled", _sExtensionId ); + aLocationURL = getPackageLocation( u"bundled"_ustr, _sExtensionId ); } if ( !aLocationURL.isEmpty() ) { @@ -248,7 +248,7 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId ) if (extensions[2].is() ) sVersionBundled = extensions[2]->getVersion(); - bool bSharedReadOnly = extMgr->isReadOnlyRepository("shared"); + bool bSharedReadOnly = extMgr->isReadOnlyRepository(u"shared"_ustr); dp_misc::UPDATE_SOURCE sourceUser = dp_misc::isUpdateUserExtension( bSharedReadOnly, sVersionUser, sVersionShared, sVersionBundled, sOnlineVersion); diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index d882b77bafa3..c2c8c621df1f 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -416,7 +416,7 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( comphelper::EventLogger logger(xComponentContext, "unopkg"); const Reference<XLogger> xLogger(logger.getLogger()); Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xComponentContext)); - Sequence < beans::NamedValue > aSeq2 { { "Formatter", Any(xLogFormatter) }, {"FileURL", Any(logFile)} }; + Sequence < beans::NamedValue > aSeq2 { { u"Formatter"_ustr, Any(xLogFormatter) }, {u"FileURL"_ustr, Any(logFile)} }; Reference<XLogHandler> xFileHandler(css::logging::FileHandler::createWithSettings(xComponentContext, aSeq2)); xFileHandler->setLevel(LogLevel::WARNING); xLogger->addLogHandler(xFileHandler); @@ -424,7 +424,7 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( that->m_xLogFile.set( that->m_xComponentContext->getServiceManager() ->createInstanceWithArgumentsAndContext( - "com.sun.star.comp.deployment.ProgressLog", + u"com.sun.star.comp.deployment.ProgressLog"_ustr, Sequence<Any>(), that->m_xComponentContext ), UNO_QUERY_THROW ); @@ -488,7 +488,7 @@ void PackageManagerImpl::disposing() catch (const Exception &) { Any exc( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( - "caught unexpected exception while disposing...", + u"caught unexpected exception while disposing..."_ustr, static_cast<OWeakObject *>(this), exc ); } } @@ -570,7 +570,7 @@ OUString PackageManagerImpl::detectMediaType( if (url.match( "vnd.sun.star.tdoc:" ) || url.match( "vnd.sun.star.pkg:" )) { try { - ucbContent.getPropertyValue( "MediaType" ) >>= mediaType; + ucbContent.getPropertyValue( u"MediaType"_ustr ) >>= mediaType; } catch (const beans::UnknownPropertyException &) { } @@ -761,11 +761,11 @@ Reference<deployment::XPackage> PackageManagerImpl::addPackage( // clashes, but the whole m_activePackages.getLength()==0 // case (i.e., document-relative deployment) currently does // not work, anyway. - docContent.setPropertyValue("MediaType", Any(mediaType) ); + docContent.setPropertyValue(u"MediaType"_ustr, Any(mediaType) ); // xxx todo: obsolete in the future try { - docFolderContent.executeCommand( "flush", Any() ); + docFolderContent.executeCommand( u"flush"_ustr, Any() ); } catch (const UnsupportedCommandException &) { } @@ -1126,7 +1126,7 @@ void PackageManagerImpl::reinstallDeployedPackages( check(); if (!force && office_is_running()) throw RuntimeException( - "You must close any running Office process before reinstalling packages!", + u"You must close any running Office process before reinstalling packages!"_ustr, static_cast<OWeakObject *>(this) ); Reference<XCommandEnvironment> xCmdEnv; @@ -1137,7 +1137,7 @@ void PackageManagerImpl::reinstallDeployedPackages( try { ProgressLevel progress( - xCmdEnv, "Reinstalling all deployed packages..." ); + xCmdEnv, u"Reinstalling all deployed packages..."_ustr ); try_dispose( m_xRegistry ); m_xRegistry.clear(); @@ -1469,7 +1469,7 @@ Sequence< Reference<deployment::XPackage> > PackageManagerImpl::getExtensionsWit { Any exc = ::cppu::getCaughtException(); deployment::DeploymentException de( - "PackageManagerImpl::getExtensionsWithUnacceptedLicenses", + u"PackageManagerImpl::getExtensionsWithUnacceptedLicenses"_ustr, static_cast<OWeakObject*>(this), exc); exc <<= de; ::cppu::throwException(exc); @@ -1489,7 +1489,7 @@ sal_Int32 PackageManagerImpl::checkPrerequisites( return 0; if (m_context != extension->getRepositoryName()) throw lang::IllegalArgumentException( - "PackageManagerImpl::checkPrerequisites: extension is not from this repository.", + u"PackageManagerImpl::checkPrerequisites: extension is not from this repository."_ustr, nullptr, 0); ActivePackages::Data dbData; @@ -1497,7 +1497,7 @@ sal_Int32 PackageManagerImpl::checkPrerequisites( if (!m_activePackagesDB->get( &dbData, id, OUString())) { throw lang::IllegalArgumentException( - "PackageManagerImpl::checkPrerequisites: unknown extension", + u"PackageManagerImpl::checkPrerequisites: unknown extension"_ustr, nullptr, 0); } @@ -1526,7 +1526,7 @@ sal_Int32 PackageManagerImpl::checkPrerequisites( } catch (...) { uno::Any excOccurred = ::cppu::getCaughtException(); deployment::DeploymentException exc( - "PackageManagerImpl::checkPrerequisites: exception ", + u"PackageManagerImpl::checkPrerequisites: exception "_ustr, static_cast<OWeakObject*>(this), excOccurred); throw exc; } diff --git a/desktop/source/deployment/manager/dp_manager.h b/desktop/source/deployment/manager/dp_manager.h index dce57d418e3f..f83e70e123da 100644 --- a/desktop/source/deployment/manager/dp_manager.h +++ b/desktop/source/deployment/manager/dp_manager.h @@ -217,7 +217,7 @@ inline void PackageManagerImpl::check() ::osl::MutexGuard guard( m_aMutex ); if (rBHelper.bInDispose || rBHelper.bDisposed) throw css::lang::DisposedException( - "PackageManager instance has already been disposed!", + u"PackageManager instance has already been disposed!"_ustr, static_cast< ::cppu::OWeakObject * >(this) ); } diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx index 79e0ea3588db..e67769dacd76 100644 --- a/desktop/source/deployment/manager/dp_managerfac.cxx +++ b/desktop/source/deployment/manager/dp_managerfac.cxx @@ -80,7 +80,7 @@ PackageManagerFactoryImpl::PackageManagerFactoryImpl( // XServiceInfo OUString PackageManagerFactoryImpl::getImplementationName() { - return "com.sun.star.comp.deployment.PackageManagerFactory"; + return u"com.sun.star.comp.deployment.PackageManagerFactory"_ustr; } sal_Bool PackageManagerFactoryImpl::supportsService( const OUString& ServiceName ) @@ -91,7 +91,7 @@ sal_Bool PackageManagerFactoryImpl::supportsService( const OUString& ServiceName css::uno::Sequence< OUString > PackageManagerFactoryImpl::getSupportedServiceNames() { // a private one: - return { "com.sun.star.comp.deployment.PackageManagerFactory" }; + return { u"com.sun.star.comp.deployment.PackageManagerFactory"_ustr }; } inline void PackageManagerFactoryImpl::check() @@ -100,7 +100,7 @@ inline void PackageManagerFactoryImpl::check() if (rBHelper.bInDispose || rBHelper.bDisposed) { throw lang::DisposedException( - "PackageManagerFactory instance has already been disposed!", + u"PackageManagerFactory instance has already been disposed!"_ustr, static_cast<OWeakObject *>(this) ); } } diff --git a/desktop/source/deployment/manager/dp_properties.cxx b/desktop/source/deployment/manager/dp_properties.cxx index 6dc1fff30351..e356c9393bb5 100644 --- a/desktop/source/deployment/manager/dp_properties.cxx +++ b/desktop/source/deployment/manager/dp_properties.cxx @@ -84,18 +84,18 @@ ExtensionProperties::ExtensionProperties( else { throw lang::IllegalArgumentException( - "Extension Manager: unknown property", nullptr, -1); + u"Extension Manager: unknown property"_ustr, nullptr, -1); } } } OUString ExtensionProperties::getPropertyValue(css::beans::NamedValue const & v) { - OUString value("0"); + OUString value(u"0"_ustr); if (! (v.Value >>= value) ) { throw lang::IllegalArgumentException( - "Extension Manager: wrong property value", nullptr, -1); + u"Extension Manager: wrong property value"_ustr, nullptr, -1); } return value; } diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index eea3cfba9cde..b9044f256977 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -65,8 +65,8 @@ OUString getReferenceOpenOfficeOrgMajorMinor() { OUString v("4.1"); #else OUString v( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") - ":Version:ReferenceOOoMajorMinor}"); + u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") + ":Version:ReferenceOOoMajorMinor}"_ustr); rtl::Bootstrap::expandMacros(v); //TODO: check for failure #endif return v; @@ -125,20 +125,20 @@ check(dp_misc::DescriptionInfoset const & infoset) { { sat = bIgnoreOoo || satisfiesMinimalVersion( getReferenceOpenOfficeOrgMajorMinor(), - e->getAttribute("value")); + e->getAttribute(u"value"_ustr)); } else if ( e->getNamespaceURI() == namespaceOpenOfficeOrg && e->getTagName() == maximalVersionOpenOfficeOrg ) { sat = bIgnoreOoo || satisfiesMaximalVersion( getReferenceOpenOfficeOrgMajorMinor(), - e->getAttribute("value")); + e->getAttribute(u"value"_ustr)); } else if (e->getNamespaceURI() == namespaceLibreOffice && e->getTagName() == minimalVersionLibreOffice ) { sat = satisfiesMinimalVersion( getLibreOfficeMajorMinorMicro(), - e->getAttribute("value")); + e->getAttribute(u"value"_ustr)); } else if (e->getNamespaceURI() == namespaceLibreOffice && e->getTagName() == maximalVersionLibreOffice ) { - sat = satisfiesMaximalVersion(getLibreOfficeMajorMinorMicro(), e->getAttribute("value")); + sat = satisfiesMaximalVersion(getLibreOfficeMajorMinorMicro(), e->getAttribute(u"value"_ustr)); } else if (e->hasAttributeNS(namespaceOpenOfficeOrg, minimalVersionOpenOfficeOrg)) { @@ -163,22 +163,22 @@ OUString getErrorText( { return produceErrorText( DpResId(RID_DEPLOYMENT_DEPENDENCIES_OOO_MIN), - dependency->getAttribute("value")); + dependency->getAttribute(u"value"_ustr)); } else if (dependency->getNamespaceURI() == namespaceOpenOfficeOrg && dependency->getTagName() == maximalVersionOpenOfficeOrg ) { return produceErrorText( DpResId(RID_DEPLOYMENT_DEPENDENCIES_OOO_MAX), - dependency->getAttribute("value")); + dependency->getAttribute(u"value"_ustr)); } else if (dependency->getNamespaceURI() == namespaceLibreOffice && dependency->getTagName() == minimalVersionLibreOffice ) { return produceErrorText( DpResId(RID_DEPLOYMENT_DEPENDENCIES_LO_MIN), - dependency->getAttribute("value")); + dependency->getAttribute(u"value"_ustr)); } else if (dependency->getNamespaceURI() == namespaceLibreOffice && dependency->getTagName() == maximalVersionLibreOffice ) { return produceErrorText( DpResId(RID_DEPLOYMENT_DEPENDENCIES_LO_MAX), - dependency->getAttribute("value")); + dependency->getAttribute(u"value"_ustr)); } else if (dependency->hasAttributeNS(namespaceOpenOfficeOrg, minimalVersionOpenOfficeOrg)) { diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 00b32c04f2c4..0da83782f1f9 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -85,7 +85,7 @@ EmptyNodeList::EmptyNodeList() {} css::uno::Reference< css::xml::dom::XNode > EmptyNodeList::item(::sal_Int32) { - throw css::uno::RuntimeException("bad EmptyNodeList com.sun.star.xml.dom.XNodeList.item call", + throw css::uno::RuntimeException(u"bad EmptyNodeList com.sun.star.xml.dom.XNodeList.item call"_ustr, static_cast< ::cppu::OWeakObject * >(this)); } @@ -202,7 +202,7 @@ ExtensionDescription::ExtensionDescription( if (!xDocBuilder->isNamespaceAware()) { throw css::uno::Exception( - "Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware.", nullptr); + u"Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware."_ustr, nullptr); } Reference<css::xml::dom::XDocument> xDoc = xDocBuilder->parse(xIn); @@ -322,15 +322,15 @@ DescriptionInfoset::DescriptionInfoset( { if (m_element.is()) { m_xpath = css::xml::xpath::XPathAPI::create(context); - m_xpath->registerNS("desc", element->getNamespaceURI()); - m_xpath->registerNS("xlink", "http://www.w3.org/1999/xlink"); + m_xpath->registerNS(u"desc"_ustr, element->getNamespaceURI()); + m_xpath->registerNS(u"xlink"_ustr, u"http://www.w3.org/1999/xlink"_ustr); } } DescriptionInfoset::~DescriptionInfoset() {} ::std::optional< OUString > DescriptionInfoset::getIdentifier() const { - return getOptionalValue("desc:identifier/@value"); + return getOptionalValue(u"desc:identifier/@value"_ustr); } OUString DescriptionInfoset::getNodeValueFromExpression(OUString const & expression) const @@ -360,12 +360,12 @@ void DescriptionInfoset::checkDenylist() const css::uno::Sequence<css::uno::Any> args(comphelper::InitAnyPropertySequence( { - {"nodepath", css::uno::Any(OUString("/org.openoffice.Office.ExtensionDependencies/Extensions"))} + {"nodepath", css::uno::Any(u"/org.openoffice.Office.ExtensionDependencies/Extensions"_ustr)} })); css::uno::Reference< css::container::XNameAccess > denylist( (css::configuration::theDefaultProvider::get(m_context) ->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", args)), + u"com.sun.star.configuration.ConfigurationAccess"_ustr, args)), css::uno::UNO_QUERY_THROW); // check first if a denylist entry is available @@ -374,7 +374,7 @@ void DescriptionInfoset::checkDenylist() const css::uno::Reference< css::beans::XPropertySet > extProps( denylist->getByName(*id), css::uno::UNO_QUERY_THROW); - css::uno::Any anyValue = extProps->getPropertyValue("Versions"); + css::uno::Any anyValue = extProps->getPropertyValue(u"Versions"_ustr); css::uno::Sequence< OUString > blversions; anyValue >>= blversions; @@ -382,7 +382,7 @@ void DescriptionInfoset::checkDenylist() const // check if the current version requires further dependency checks from the denylist if (!checkDenylistVersion(currentversion, blversions)) return; - anyValue = extProps->getPropertyValue("Dependencies"); + anyValue = extProps->getPropertyValue(u"Dependencies"_ustr); OUString udeps; anyValue >>= udeps; @@ -392,7 +392,7 @@ void DescriptionInfoset::checkDenylist() const OString xmlDependencies = OUStringToOString(udeps, RTL_TEXTENCODING_UNICODE); css::uno::Reference< css::xml::dom::XDocumentBuilder> docbuilder( - m_context->getServiceManager()->createInstanceWithContext("com.sun.star.xml.dom.DocumentBuilder", m_context), + m_context->getServiceManager()->createInstanceWithContext(u"com.sun.star.xml.dom.DocumentBuilder"_ustr, m_context), css::uno::UNO_QUERY_THROW); css::uno::Sequence< sal_Int8 > byteSeq(reinterpret_cast<const sal_Int8*>(xmlDependencies.getStr()), xmlDependencies.getLength()); @@ -410,16 +410,16 @@ void DescriptionInfoset::checkDenylist() const // get dependency node of current description info to merge the new dependencies from the denylist css::uno::Reference< css::xml::dom::XNode > xCurrentDeps( - m_xpath->selectSingleNode(m_element, "desc:dependencies")); + m_xpath->selectSingleNode(m_element, u"desc:dependencies"_ustr)); // if no dependency node exists, create a new one in the current description info if (!xCurrentDeps.is()) { css::uno::Reference< css::xml::dom::XNode > xNewDepNode( xCurrentDescInfo->createElementNS( - "http://openoffice.org/extensions/description/2006", - "dependencies"), css::uno::UNO_QUERY_THROW); + u"http://openoffice.org/extensions/description/2006"_ustr, + u"dependencies"_ustr), css::uno::UNO_QUERY_THROW); m_element->appendChild(xNewDepNode); - xCurrentDeps = m_xpath->selectSingleNode(m_element, "desc:dependencies"); + xCurrentDeps = m_xpath->selectSingleNode(m_element, u"desc:dependencies"_ustr); } for (sal_Int32 i=0; i<nLen; i++) { @@ -448,7 +448,7 @@ bool DescriptionInfoset::checkDenylistVersion( OUString DescriptionInfoset::getVersion() const { - return getNodeValueFromExpression( "desc:version/@value" ); + return getNodeValueFromExpression( u"desc:version/@value"_ustr ); } css::uno::Sequence< OUString > DescriptionInfoset::getSupportedPlatforms() const @@ -456,19 +456,19 @@ css::uno::Sequence< OUString > DescriptionInfoset::getSupportedPlatforms() const //When there is no description.xml then we assume that we support all platforms if (! m_element.is()) { - return { OUString("all") }; + return { u"all"_ustr }; } //Check if the <platform> element was provided. If not the default is "all" platforms css::uno::Reference< css::xml::dom::XNode > nodePlatform( - m_xpath->selectSingleNode(m_element, "desc:platform")); + m_xpath->selectSingleNode(m_element, u"desc:platform"_ustr)); if (!nodePlatform.is()) { - return { OUString("all") }; + return { u"all"_ustr }; } //There is a platform element. - const OUString value = getNodeValueFromExpression("desc:platform/@value"); + const OUString value = getNodeValueFromExpression(u"desc:platform/@value"_ustr); //parse the string, it can contained multiple strings separated by commas std::vector< OUString> vec; sal_Int32 nIndex = 0; @@ -491,7 +491,7 @@ DescriptionInfoset::getDependencies() const { // check the extension denylist first and expand the dependencies if applicable checkDenylist(); - return m_xpath->selectNodeList(m_element, "desc:dependencies/*"); + return m_xpath->selectNodeList(m_element, u"desc:dependencies/*"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -501,19 +501,19 @@ DescriptionInfoset::getDependencies() const { css::uno::Sequence< OUString > DescriptionInfoset::getUpdateInformationUrls() const { - return getUrls("desc:update-information/desc:src/@xlink:href"); + return getUrls(u"desc:update-information/desc:src/@xlink:href"_ustr); } css::uno::Sequence< OUString > DescriptionInfoset::getUpdateDownloadUrls() const { - return getUrls("desc:update-download/desc:src/@xlink:href"); + return getUrls(u"desc:update-download/desc:src/@xlink:href"_ustr); } OUString DescriptionInfoset::getIconURL( bool bHighContrast ) const { - css::uno::Sequence< OUString > aStrList = getUrls( "desc:icon/desc:default/@xlink:href" ); - css::uno::Sequence< OUString > aStrListHC = getUrls( "desc:icon/desc:high-contrast/@xlink:href" ); + css::uno::Sequence< OUString > aStrList = getUrls( u"desc:icon/desc:default/@xlink:href"_ustr ); + css::uno::Sequence< OUString > aStrListHC = getUrls( u"desc:icon/desc:high-contrast/@xlink:href"_ustr ); if ( bHighContrast && aStrListHC.hasElements() && !aStrListHC[0].isEmpty() ) return aStrListHC[0]; @@ -528,7 +528,7 @@ OUString DescriptionInfoset::getIconURL( bool bHighContrast ) const const { bool bParentExists = false; - const OUString sURL (getLocalizedHREFAttrFromChild("/desc:description/desc:update-website", &bParentExists )); + const OUString sURL (getLocalizedHREFAttrFromChild(u"/desc:description/desc:update-website"_ustr, &bParentExists )); if (!sURL.isEmpty()) return ::std::optional< OUString >(sURL); @@ -575,7 +575,7 @@ css::uno::Sequence< OUString > DescriptionInfoset::getUrls( std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAndURL() const { css::uno::Reference< css::xml::dom::XNode > node = - getLocalizedChild("desc:publisher"); + getLocalizedChild(u"desc:publisher"_ustr); OUString sPublisherName; OUString sURL; @@ -583,7 +583,7 @@ std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAnd { css::uno::Reference< css::xml::dom::XNode > xPathName; try { - xPathName = m_xpath->selectSingleNode(node, "text()"); + xPathName = m_xpath->selectSingleNode(node, u"text()"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -593,7 +593,7 @@ std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAnd css::uno::Reference< css::xml::dom::XNode > xURL; try { - xURL = m_xpath->selectSingleNode(node, "@xlink:href"); + xURL = m_xpath->selectSingleNode(node, u"@xlink:href"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -606,18 +606,18 @@ std::pair< OUString, OUString > DescriptionInfoset::getLocalizedPublisherNameAnd OUString DescriptionInfoset::getLocalizedReleaseNotesURL() const { - return getLocalizedHREFAttrFromChild("/desc:description/desc:release-notes", nullptr); + return getLocalizedHREFAttrFromChild(u"/desc:description/desc:release-notes"_ustr, nullptr); } OUString DescriptionInfoset::getLocalizedDisplayName() const { css::uno::Reference< css::xml::dom::XNode > node = - getLocalizedChild("desc:display-name"); + getLocalizedChild(u"desc:display-name"_ustr); if (node.is()) { css::uno::Reference< css::xml::dom::XNode > xtext; try { - xtext = m_xpath->selectSingleNode(node, "text()"); + xtext = m_xpath->selectSingleNode(node, u"text()"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -629,7 +629,7 @@ OUString DescriptionInfoset::getLocalizedDisplayName() const OUString DescriptionInfoset::getLocalizedLicenseURL() const { - return getLocalizedHREFAttrFromChild("/desc:description/desc:registration/desc:simple-license", nullptr); + return getLocalizedHREFAttrFromChild(u"/desc:description/desc:registration/desc:simple-license"_ustr, nullptr); } @@ -640,7 +640,7 @@ DescriptionInfoset::getSimpleLicenseAttributes() const css::uno::Reference< css::xml::dom::XNode > n; if (m_element.is()) { try { - n = m_xpath->selectSingleNode(m_element, "/desc:description/desc:registration/desc:simple-license/@accept-by"); + n = m_xpath->selectSingleNode(m_element, u"/desc:description/desc:registration/desc:simple-license/@accept-by"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -648,15 +648,15 @@ DescriptionInfoset::getSimpleLicenseAttributes() const { SimpleLicenseAttributes attributes; attributes.acceptBy = - getNodeValueFromExpression("/desc:description/desc:registration/desc:simple-license/@accept-by"); + getNodeValueFromExpression(u"/desc:description/desc:registration/desc:simple-license/@accept-by"_ustr); - ::std::optional< OUString > suppressOnUpdate = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-on-update"); + ::std::optional< OUString > suppressOnUpdate = getOptionalValue(u"/desc:description/desc:registration/desc:simple-license/@suppress-on-update"_ustr); if (suppressOnUpdate) attributes.suppressOnUpdate = o3tl::equalsIgnoreAsciiCase(o3tl::trim(*suppressOnUpdate), u"true"); else attributes.suppressOnUpdate = false; - ::std::optional< OUString > suppressIfRequired = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-if-required"); + ::std::optional< OUString > suppressIfRequired = getOptionalValue(u"/desc:description/desc:registration/desc:simple-license/@suppress-if-required"_ustr); if (suppressIfRequired) attributes.suppressIfRequired = o3tl::equalsIgnoreAsciiCase(o3tl::trim(*suppressIfRequired), u"true"); else @@ -670,7 +670,7 @@ DescriptionInfoset::getSimpleLicenseAttributes() const OUString DescriptionInfoset::getLocalizedDescriptionURL() const { - return getLocalizedHREFAttrFromChild("/desc:description/desc:extension-description", nullptr); + return getLocalizedHREFAttrFromChild(u"/desc:description/desc:extension-description"_ustr, nullptr); } css::uno::Reference< css::xml::dom::XNode > @@ -748,7 +748,7 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom { css::uno::Reference<css::xml::dom::XNode> nodeDefault; try { - nodeDefault = m_xpath->selectSingleNode(xParent, "@default-license-id"); + nodeDefault = m_xpath->selectSingleNode(xParent, u"@default-license-id"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -767,7 +767,7 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom } try { - return m_xpath->selectSingleNode(xParent, "*[1]"); + return m_xpath->selectSingleNode(xParent, u"*[1]"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore return nullptr; @@ -788,7 +788,7 @@ OUString DescriptionInfoset::getLocalizedHREFAttrFromChild( *out_bParentExists = true; css::uno::Reference< css::xml::dom::XNode > xURL; try { - xURL = m_xpath->selectSingleNode(node, "@xlink:href"); + xURL = m_xpath->selectSingleNode(node, u"@xlink:href"_ustr); } catch (const css::xml::xpath::XPathException &) { // ignore } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 6011d15cb11d..4cd248251b40 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -65,7 +65,7 @@ std::shared_ptr<rtl::Bootstrap> & UnoRc() { static std::shared_ptr<rtl::Bootstrap> theRc = []() { - OUString unorc( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("louno") ); + OUString unorc( u"$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("louno") ""_ustr ); ::rtl::Bootstrap::expandMacros( unorc ); auto ret = std::make_shared<::rtl::Bootstrap>( unorc ); OSL_ASSERT( ret->getHandle() != nullptr ); @@ -82,12 +82,12 @@ OUString generateOfficePipeId() if (aLocateResult != ::utl::Bootstrap::PATH_EXISTS && aLocateResult != ::utl::Bootstrap::PATH_VALID) { - throw Exception("Extension Manager: Could not obtain path for UserInstallation.", nullptr); + throw Exception(u"Extension Manager: Could not obtain path for UserInstallation."_ustr, nullptr); } rtlDigest digest = rtl_digest_create( rtl_Digest_AlgorithmMD5 ); if (!digest) { - throw RuntimeException("cannot get digest rtl_Digest_AlgorithmMD5!", nullptr ); + throw RuntimeException(u"cannot get digest rtl_Digest_AlgorithmMD5!"_ustr, nullptr ); } sal_uInt8 const * data = @@ -390,16 +390,16 @@ oslProcess raiseProcess( case osl_Process_E_None: break; case osl_Process_E_NotFound: - throw RuntimeException( "image not found!", nullptr ); + throw RuntimeException( u"image not found!"_ustr, nullptr ); case osl_Process_E_TimedOut: - throw RuntimeException( "timeout occurred!", nullptr ); + throw RuntimeException( u"timeout occurred!"_ustr, nullptr ); case osl_Process_E_NoPermission: - throw RuntimeException( "permission denied!", nullptr ); + throw RuntimeException( u"permission denied!"_ustr, nullptr ); case osl_Process_E_Unknown: - throw RuntimeException( "unknown error!", nullptr ); + throw RuntimeException( u"unknown error!"_ustr, nullptr ); case osl_Process_E_InvalidError: default: - throw RuntimeException( "unmapped error!", nullptr ); + throw RuntimeException( u"unmapped error!"_ustr, nullptr ); } return hProcess; @@ -411,11 +411,11 @@ OUString generateRandomPipeId() // compute some good pipe id: static rtlRandomPool s_hPool = rtl_random_createPool(); if (s_hPool == nullptr) - throw RuntimeException( "cannot create random pool!?", nullptr ); + throw RuntimeException( u"cannot create random pool!?"_ustr, nullptr ); sal_uInt8 bytes[ 32 ]; if (rtl_random_getBytes( s_hPool, bytes, std::size(bytes) ) != rtl_Random_E_None) { - throw RuntimeException( "random pool error!?", nullptr ); + throw RuntimeException( u"random pool error!?"_ustr, nullptr ); } OUStringBuffer buf; for (unsigned char byte : bytes) { @@ -436,7 +436,7 @@ Reference<XInterface> resolveUnoURL( for (int i = 0; i <= 40; ++i) // 20 seconds { if (abortChannel != nullptr && abortChannel->isAborted()) { - throw ucb::CommandAbortedException( "abort!" ); + throw ucb::CommandAbortedException( u"abort!"_ustr ); } try { return xUnoUrlResolver->resolve( connectString ); @@ -479,7 +479,7 @@ OUString readConsole() OUString value = OStringToOUString(std::string_view(buf), osl_getThreadTextEncoding()); return value.trim(); } - throw css::uno::RuntimeException("reading from stdin failed"); + throw css::uno::RuntimeException(u"reading from stdin failed"_ustr); } void TRACE(OUString const & sText) @@ -491,7 +491,7 @@ void syncRepositories( bool force, Reference<ucb::XCommandEnvironment> const & xCmdEnv) { OUString sDisable; - ::rtl::Bootstrap::get( "DISABLE_EXTENSION_SYNCHRONIZATION", sDisable, OUString() ); + ::rtl::Bootstrap::get( u"DISABLE_EXTENSION_SYNCHRONIZATION"_ustr, sDisable, OUString() ); if (!sDisable.isEmpty()) return; diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index aeab3e567051..bd22a8a788b4 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx @@ -35,7 +35,7 @@ namespace { static const OUString theOS = []() { - OUString os( "$_OS" ); + OUString os( u"$_OS"_ustr ); ::rtl::Bootstrap::expandMacros( os ); return os; }(); @@ -46,7 +46,7 @@ namespace { static const OUString theCPU = []() { - OUString arch( "$_ARCH" ); + OUString arch( u"$_ARCH"_ustr ); ::rtl::Bootstrap::expandMacros( arch ); return arch; }(); diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx index 5ca42f31aeac..fee38f7235a5 100644 --- a/desktop/source/deployment/misc/dp_ucb.cxx +++ b/desktop/source/deployment/misc/dp_ucb.cxx @@ -169,7 +169,7 @@ bool erase_path( OUString const & url, { try { ucb_content.executeCommand( - "delete", Any( true /* delete physically */ ) ); + u"delete"_ustr, Any( true /* delete physically */ ) ); } catch (const RuntimeException &) { throw; @@ -191,7 +191,7 @@ std::vector<sal_Int8> readFile( ::ucbhelper::Content & ucb_content ) ::xmlscript::createOutputStream( &bytes ) ); if (! ucb_content.openStream( xStream )) throw RuntimeException( - "::ucbhelper::Content::openStream( XOutputStream ) failed!", + u"::ucbhelper::Content::openStream( XOutputStream ) failed!"_ustr, nullptr ); return bytes; } diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index 650d648e8a3c..e78f40c2aff4 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -222,8 +222,8 @@ bool onlyBundledExtensions( OUString getExtensionDefaultUpdateURL() { OUString sUrl( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") - ":Version:ExtensionUpdateURL}"); + u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") + ":Version:ExtensionUpdateURL}"_ustr); ::rtl::Bootstrap::expandMacros(sUrl); return sUrl; } diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index f374a88c04a9..71127ed36410 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -377,7 +377,7 @@ BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const check(); //We should never get here... throw RuntimeException( - "Failed to get the BackendImpl", + u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<ComponentPackageImpl *>(this))); } return pBackend; @@ -406,7 +406,7 @@ void BackendImpl::disposing() catch (const Exception &) { Any exc( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( - "caught unexpected exception while disposing...", + u"caught unexpected exception while disposing..."_ustr, static_cast<OWeakObject *>(this), exc ); } } @@ -460,7 +460,7 @@ void BackendImpl::initServiceRdbFiles() m_xCommonRDB.set( m_xComponentContext->getServiceManager() ->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", + u"com.sun.star.registry.SimpleRegistry"_ustr, m_xComponentContext ), UNO_QUERY_THROW ); m_xCommonRDB->open( makeURL( expandUnoRcUrl(getCachePath()), m_commonRDB ), @@ -470,7 +470,7 @@ void BackendImpl::initServiceRdbFiles() m_xNativeRDB.set( m_xComponentContext->getServiceManager() ->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", + u"com.sun.star.registry.SimpleRegistry"_ustr, m_xComponentContext ), UNO_QUERY_THROW ); m_xNativeRDB->open( makeURL( expandUnoRcUrl(getCachePath()), m_nativeRDB ), @@ -488,33 +488,33 @@ BackendImpl::BackendImpl( m_xDynComponentTypeInfo( new Package::TypeInfo( "application/vnd.sun.star.uno-component;type=native;platform=" + getPlatformString(), - "*" SAL_DLLEXTENSION, + u"*" SAL_DLLEXTENSION ""_ustr, DpResId(RID_STR_DYN_COMPONENT) ) ), m_xJavaComponentTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.uno-component;type=Java", - "*.jar", + u"application/vnd.sun.star.uno-component;type=Java"_ustr, + u"*.jar"_ustr, DpResId(RID_STR_JAVA_COMPONENT) ) ), m_xPythonComponentTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.uno-component;type=Python", - "*.py", + u"application/vnd.sun.star.uno-component;type=Python"_ustr, + u"*.py"_ustr, DpResId( RID_STR_PYTHON_COMPONENT) ) ), m_xComponentsTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.uno-components", - "*.components", + u"application/vnd.sun.star.uno-components"_ustr, + u"*.components"_ustr, DpResId(RID_STR_COMPONENTS) ) ), m_xRDBTypelibTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.uno-typelibrary;type=RDB", - "*.rdb", + u"application/vnd.sun.star.uno-typelibrary;type=RDB"_ustr, + u"*.rdb"_ustr, DpResId(RID_STR_RDB_TYPELIB) ) ), m_xJavaTypelibTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.uno-typelibrary;type=Java", - "*.jar", + u"application/vnd.sun.star.uno-typelibrary;type=Java"_ustr, + u"*.jar"_ustr, DpResId(RID_STR_JAVA_TYPELIB) ) ), m_typeInfos{ m_xDynComponentTypeInfo, m_xJavaComponentTypeInfo, m_xPythonComponentTypeInfo, @@ -528,13 +528,13 @@ BackendImpl::BackendImpl( // common rdb for java, native rdb for shared lib components m_xCommonRDB.set( xComponentContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", + u"com.sun.star.registry.SimpleRegistry"_ustr, xComponentContext ), UNO_QUERY_THROW ); m_xCommonRDB->open( OUString() /* in-mem */, false /* ! read-only */, true /* create */ ); m_xNativeRDB.set( xComponentContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", + u"com.sun.star.registry.SimpleRegistry"_ustr, xComponentContext ), UNO_QUERY_THROW ); m_xNativeRDB->open( OUString() /* in-mem */, false /* ! read-only */, true /* create */ ); @@ -542,7 +542,7 @@ BackendImpl::BackendImpl( else { unorc_verify_init( xCmdEnv ); - OUString dbFile = makeURL(getCachePath(), "backenddb.xml"); + OUString dbFile = makeURL(getCachePath(), u"backenddb.xml"_ustr); m_backendDb.reset( new ComponentBackendDb(getComponentContext(), dbFile)); } @@ -551,7 +551,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.component.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.component.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -673,7 +673,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( if (bPlatformFits) return new BackendImpl::ComponentPackageImpl( this, url, name, m_xDynComponentTypeInfo, - "com.sun.star.loader.SharedLibrary", + u"com.sun.star.loader.SharedLibrary"_ustr, bRemoved, identifier); else return new BackendImpl::OtherPlatformPackageImpl( @@ -683,13 +683,13 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( if (value.equalsIgnoreAsciiCase("Java")) { return new BackendImpl::ComponentPackageImpl( this, url, name, m_xJavaComponentTypeInfo, - "com.sun.star.loader.Java2", + u"com.sun.star.loader.Java2"_ustr, bRemoved, identifier); } if (value.equalsIgnoreAsciiCase("Python")) { return new BackendImpl::ComponentPackageImpl( this, url, name, m_xPythonComponentTypeInfo, - "com.sun.star.loader.Python", + u"com.sun.star.loader.Python"_ustr, bRemoved, identifier); } } @@ -744,7 +744,7 @@ void BackendImpl::unorc_verify_init( ::ucbhelper::Content ucb_content; if (create_ucb_content( &ucb_content, - makeURL( getCachePath(), "unorc" ), + makeURL( getCachePath(), u"unorc"_ustr ), xCmdEnv, false /* no throw */ )) { OUString line; @@ -958,7 +958,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) reinterpret_cast<sal_Int8 const *>(buf.getStr()), buf.getLength() ) ); ::ucbhelper::Content ucb_content( - makeURL( getCachePath(), "unorc" ), xCmdEnv, m_xComponentContext ); + makeURL( getCachePath(), u"unorc"_ustr ), xCmdEnv, m_xComponentContext ); ucb_content.writeStream( xData, true /* replace existing */ ); m_unorc_modified = false; @@ -1009,7 +1009,7 @@ css::uno::Reference< css::uno::XComponentContext > BackendImpl::getRootContext() const { css::uno::Reference< css::uno::XComponentContext > rootContext( - getComponentContext()->getValueByName("_root"), + getComponentContext()->getValueByName(u"_root"_ustr), css::uno::UNO_QUERY); return rootContext.is() ? rootContext : getComponentContext(); } @@ -1049,7 +1049,7 @@ Reference<XComponentContext> raise_uno_process( { OSL_ASSERT( xContext.is() ); - OUString url( util::theMacroExpander::get(xContext)->expandMacros( "$URE_BIN_DIR/uno" ) ); + OUString url( util::theMacroExpander::get(xContext)->expandMacros( u"$URE_BIN_DIR/uno"_ustr ) ); const OUString connectStr = "uno:pipe,name=" + generateRandomPipeId() + ";urp;uno.ComponentContext"; @@ -1061,11 +1061,11 @@ Reference<XComponentContext> raise_uno_process( #if OSL_DEBUG_LEVEL == 0 "--quiet", #endif - "--singleaccept", - "-u", + u"--singleaccept"_ustr, + u"-u"_ustr, connectStr, // don't inherit from unorc: - "-env:INIFILENAME=" }; + u"-env:INIFILENAME="_ustr }; //now add the bootstrap variables which were supplied on the command line std::vector<OUString> bootvars = getCmdBootstrapVariables(); @@ -1121,7 +1121,7 @@ void extractComponentData( OUString name(key->getKeyName().copy(prefix)); data->implementationNames.push_back(name); css::uno::Reference< css::registry::XRegistryKey > singletons( - key->openKey("UNO/SINGLETONS")); + key->openKey(u"UNO/SINGLETONS"_ustr)); if (singletons.is()) { sal_Int32 prefix2 = key->getKeyName().getLength() + RTL_CONSTASCII_LENGTH("/UNO/SINGLETONS/"); @@ -1165,7 +1165,7 @@ void BackendImpl::ComponentPackageImpl::getComponentInfo( OUString url(getURL()); const Reference<registry::XSimpleRegistry> xMemReg( xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.SimpleRegistry", xContext ), + u"com.sun.star.registry.SimpleRegistry"_ustr, xContext ), UNO_QUERY_THROW ); xMemReg->open( OUString() /* in mem */, false, true ); xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), url ); @@ -1275,7 +1275,7 @@ BackendImpl::ComponentPackageImpl::isRegistered_( const Reference<registry::XRegistryKey> xRootKey( xRDB->getRootKey() ); const Reference<registry::XRegistryKey> xImplKey( - xRootKey->openKey( "IMPLEMENTATIONS" ) ); + xRootKey->openKey( u"IMPLEMENTATIONS"_ustr ) ); Sequence<OUString> implNames; if (xImplKey.is() && xImplKey->isValid()) implNames = xImplKey->getKeyNames(); @@ -1361,7 +1361,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( } css::uno::Reference< css::registry::XImplementationRegistration> impreg( context->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.ImplementationRegistration", + u"com.sun.star.registry.ImplementationRegistration"_ustr, context), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::registry::XSimpleRegistry > rdb(getRDB()); @@ -1404,7 +1404,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( } css::uno::Reference< css::registry::XImplementationRegistration >( context->getServiceManager()->createInstanceWithContext( - "com.sun.star.registry.ImplementationRegistration", + u"com.sun.star.registry.ImplementationRegistration"_ustr, context), css::uno::UNO_QUERY_THROW)->revokeImplementation(url, getRDB()); if (data.javaTypeLibrary) { @@ -1438,7 +1438,7 @@ BackendImpl * BackendImpl::TypelibraryPackageImpl::getMyBackend() const //May throw a DisposedException check(); //We should never get here... - throw RuntimeException( "Failed to get the BackendImpl", + throw RuntimeException( u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<TypelibraryPackageImpl *>(this))); } return pBackend; @@ -1486,8 +1486,8 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_( { css::uno::Reference< css::container::XSet >( that->getComponentContext()->getValueByName( - "/singletons" - "/com.sun.star.reflection.theTypeDescriptionManager"), + u"/singletons" + "/com.sun.star.reflection.theTypeDescriptionManager"_ustr), css::uno::UNO_QUERY_THROW)->insert( css::uno::Any(expandUnoRcUrl(url))); } @@ -1504,8 +1504,8 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_( if (!m_jarFile) { css::uno::Reference< css::container::XSet >( that->getComponentContext()->getValueByName( - "/singletons" - "/com.sun.star.reflection.theTypeDescriptionManager"), + u"/singletons" + "/com.sun.star.reflection.theTypeDescriptionManager"_ustr), css::uno::UNO_QUERY_THROW)->remove( css::uno::Any(expandUnoRcUrl(url))); } @@ -1532,7 +1532,7 @@ BackendImpl::OtherPlatformPackageImpl::getMyBackend() const //Throws a DisposedException check(); //We should never get here... - throw RuntimeException("Failed to get the BackendImpl", + throw RuntimeException(u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<OtherPlatformPackageImpl*>(this))); } return pBackend; @@ -1549,7 +1549,7 @@ BackendImpl::OtherPlatformPackageImpl::impl_openRDB() const try { xRegistry.set( - impl_createInstance("com.sun.star.registry.SimpleRegistry"), + impl_createInstance(u"com.sun.star.registry.SimpleRegistry"_ustr), UNO_QUERY) ; if (xRegistry.is()) @@ -1601,7 +1601,7 @@ BackendImpl::OtherPlatformPackageImpl::processPackage_( Reference<registry::XSimpleRegistry> const xServicesRDB(impl_openRDB()); Reference<registry::XImplementationRegistration> const xImplReg( - impl_createInstance("com.sun.star.registry.ImplementationRegistration"), + impl_createInstance(u"com.sun.star.registry.ImplementationRegistration"_ustr), UNO_QUERY) ; if (xImplReg.is() && xServicesRDB.is()) @@ -1620,7 +1620,7 @@ BackendImpl * BackendImpl::ComponentsPackageImpl::getMyBackend() const //Throws a DisposedException check(); //We should never get here... - throw RuntimeException("Failed to get the BackendImpl", + throw RuntimeException(u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<ComponentsPackageImpl *>(this))); } return pBackend; @@ -1663,8 +1663,8 @@ void BackendImpl::ComponentsPackageImpl::processPackage_( // supporting the extended XSet semantics: css::uno::Sequence< css::beans::NamedValue > args { - { "uri", css::uno::Any(expandUnoRcUrl(url)) }, - { "component-context", css::uno::Any(context) } + { u"uri"_ustr, css::uno::Any(expandUnoRcUrl(url)) }, + { u"component-context"_ustr, css::uno::Any(context) } }; css::uno::Reference< css::container::XSet > smgr( that->getRootContext()->getServiceManager(), @@ -1677,7 +1677,7 @@ void BackendImpl::ComponentsPackageImpl::processPackage_( if (!startup) { // This relies on the root component context's service manager // supporting the extended XSet semantics: - css::uno::Sequence< css::beans::NamedValue > args { { "uri", css::uno::Any(expandUnoRcUrl(url)) } }; + css::uno::Sequence< css::beans::NamedValue > args { { u"uri"_ustr, css::uno::Any(expandUnoRcUrl(url)) } }; css::uno::Reference< css::container::XSet > smgr( that->getRootContext()->getServiceManager(), css::uno::UNO_QUERY_THROW); diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 9ef3cc969432..e8f9cf607b9d 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -168,7 +168,7 @@ void BackendImpl::disposing() catch (const Exception &) { Any exc( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( - "caught unexpected exception while disposing...", + u"caught unexpected exception while disposing..."_ustr, static_cast<OWeakObject *>(this), exc ); } } @@ -181,13 +181,13 @@ BackendImpl::BackendImpl( m_configmgrini_inited( false ), m_configmgrini_modified( false ), m_xConfDataTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.configuration-data", - "*.xcu", + u"application/vnd.sun.star.configuration-data"_ustr, + u"*.xcu"_ustr, DpResId(RID_STR_CONF_DATA) ) ), m_xConfSchemaTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.configuration-schema", - "*.xcs", + u"application/vnd.sun.star.configuration-schema"_ustr, + u"*.xcs"_ustr, DpResId(RID_STR_CONF_SCHEMA) ) ), m_typeInfos{ m_xConfDataTypeInfo, m_xConfSchemaTypeInfo } @@ -200,7 +200,7 @@ BackendImpl::BackendImpl( } else { - OUString dbFile = makeURL(getCachePath(), "backenddb.xml"); + OUString dbFile = makeURL(getCachePath(), u"backenddb.xml"_ustr); m_backendDb.reset( new ConfigurationBackendDb(getComponentContext(), dbFile)); //clean up data folders which are no longer used. @@ -215,7 +215,7 @@ BackendImpl::BackendImpl( #if HAVE_FEATURE_EXTENSIONS std::unique_ptr<PersistentMap> pMap; - OUString aCompatURL( makeURL( getCachePath(), "registered_packages.pmap" ) ); + OUString aCompatURL( makeURL( getCachePath(), u"registered_packages.pmap"_ustr ) ); // Don't create it if it doesn't exist already if ( ::utl::UCBContentHelper::Exists( expandUnoRcUrl( aCompatURL ) ) ) @@ -240,7 +240,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.configuration.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.configuration.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -377,7 +377,7 @@ void BackendImpl::configmgrini_verify_init( ::ucbhelper::Content ucb_content; if (create_ucb_content( &ucb_content, - makeURL( getCachePath(), "configmgr.ini" ), + makeURL( getCachePath(), u"configmgr.ini"_ustr ), xCmdEnv, false /* no throw */ )) { OUString line; @@ -469,7 +469,7 @@ void BackendImpl::configmgrini_flush( reinterpret_cast<sal_Int8 const *>(buf.getStr()), buf.getLength() ) ); ::ucbhelper::Content ucb_content( - makeURL( getCachePath(), "configmgr.ini" ), xCmdEnv, m_xComponentContext ); + makeURL( getCachePath(), u"configmgr.ini"_ustr ), xCmdEnv, m_xComponentContext ); ucb_content.writeStream( xData, true /* replace existing */ ); m_configmgrini_modified = false; @@ -534,7 +534,7 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const check(); //We should never get here... throw RuntimeException( - "Failed to get the BackendImpl", + u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -752,9 +752,9 @@ void BackendImpl::PackageImpl::processPackage_( try { ::ucbhelper::Content( - makeURL( that->getCachePath(), "registry" ), + makeURL( that->getCachePath(), u"registry"_ustr ), xCmdEnv, that->getComponentContext() ).executeCommand( - "delete", Any( true /* delete physically */ ) ); + u"delete"_ustr, Any( true /* delete physically */ ) ); } catch(const Exception&) { diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 016ff66286d9..4071fee4600b 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -107,7 +107,7 @@ void PackageRegistryBackend::check() ::osl::MutexGuard guard( m_aMutex ); if (rBHelper.bInDispose || rBHelper.bDisposed) { throw lang::DisposedException( - "PackageRegistryBackend instance has already been disposed!", + u"PackageRegistryBackend instance has already been disposed!"_ustr, static_cast<OWeakObject *>(this) ); } } @@ -128,7 +128,7 @@ void PackageRegistryBackend::disposing() catch (const Exception &) { Any exc( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( - "caught unexpected exception while disposing!", + u"caught unexpected exception while disposing!"_ustr, static_cast<OWeakObject *>(this), exc ); } } @@ -151,11 +151,11 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage( if (!mediaType.isEmpty() && mediaType != xPackage->getPackageType()->getMediaType()) throw lang::IllegalArgumentException - ("XPackageRegistry::bindPackage: media type does not match", + (u"XPackageRegistry::bindPackage: media type does not match"_ustr, static_cast<OWeakObject*>(this), 1); if (xPackage->isRemoved() != bRemoved) throw deployment::InvalidRemovedParameterException( - "XPackageRegistry::bindPackage: bRemoved parameter does not match", + u"XPackageRegistry::bindPackage: bRemoved parameter does not match"_ustr, static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage); return xPackage; } @@ -338,7 +338,7 @@ void Package::check() const ::osl::MutexGuard guard( m_aMutex ); if (rBHelper.bInDispose || rBHelper.bDisposed) { throw lang::DisposedException( - "Package instance has already been disposed!", + u"Package instance has already been disposed!"_ustr, static_cast<OWeakObject *>(const_cast<Package *>(this))); } } @@ -393,7 +393,7 @@ void Package::checkAborted( { if (abortChannel.is() && abortChannel->isAborted()) { throw CommandAbortedException( - "abort!", static_cast<OWeakObject *>(this) ); + u"abort!"_ustr, static_cast<OWeakObject *>(this) ); } } @@ -546,7 +546,7 @@ void Package::exportTo( } if (!bOk) - throw RuntimeException( "UCB transferContent() failed!", nullptr ); + throw RuntimeException( u"UCB transferContent() failed!"_ustr, nullptr ); } void Package::fireModified() @@ -707,7 +707,7 @@ PackageRegistryBackend * Package::getMyBackend() const check(); //We should never get here... throw RuntimeException( - "Failed to get the BackendImpl", + u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<Package *>(this))); } return pBackend; diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index 28effd95c8f5..5f9a80f01dbd 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -169,7 +169,7 @@ void BackendDb::revokeEntry(std::u16string_view url) Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY); if (entry.is()) { - entry->setAttribute("revoked", "true"); + entry->setAttribute(u"revoked"_ustr, u"true"_ustr); save(); } } @@ -191,7 +191,7 @@ bool BackendDb::activateEntry(std::u16string_view url) if (entry.is()) { //no attribute "active" means it is active, that is, registered. - entry->removeAttribute("revoked"); + entry->removeAttribute(u"revoked"_ustr); save(); ret = true; } @@ -214,7 +214,7 @@ bool BackendDb::hasActiveEntry(std::u16string_view url) Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY); if (entry.is()) { - OUString sActive = entry->getAttribute("revoked"); + OUString sActive = entry->getAttribute(u"revoked"_ustr); if (!(sActive == "true")) ret = true; } @@ -484,7 +484,7 @@ Reference<css::xml::dom::XNode> BackendDb::writeKeyElement( const Reference<css::xml::dom::XElement> keyElement( doc->createElementNS(sNameSpace, sPrefix + ":" + sElementName)); - keyElement->setAttribute("url", url); + keyElement->setAttribute(u"url"_ustr, url); const Reference<css::xml::dom::XNode> keyNode( keyElement, UNO_QUERY_THROW); @@ -632,7 +632,7 @@ void RegisteredDb::addEntry(OUString const & url) Reference<css::xml::dom::XElement> helpElement( doc->createElementNS(sNameSpace, sPrefix + ":" + sEntry)); - helpElement->setAttribute("url", url); + helpElement->setAttribute(u"url"_ustr, url); Reference<css::xml::dom::XNode> helpNode( helpElement, UNO_QUERY_THROW); diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index ac19bcd8e9d8..6e9a4e9f1c2c 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -127,7 +127,7 @@ void PackageRegistryImpl::check() ::osl::MutexGuard guard( m_aMutex ); if (rBHelper.bInDispose || rBHelper.bDisposed) { throw lang::DisposedException( - "PackageRegistry instance has already been disposed!", + u"PackageRegistry instance has already been disposed!"_ustr, static_cast<OWeakObject *>(this) ); } } @@ -282,7 +282,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( Reference<container::XContentEnumerationAccess>( xComponentContext->getServiceManager(), UNO_QUERY_THROW )->createContentEnumeration( - "com.sun.star.deployment.PackageRegistryBackend" ) ); + u"com.sun.star.deployment.PackageRegistryBackend"_ustr ) ); if (xEnum.is()) { while (xEnum->hasMoreElements()) @@ -361,7 +361,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( // dump tables: { t_registryset allBackends; - dp_misc::TRACE("> [dp_registry.cxx] media-type detection:\n\n" ); + dp_misc::TRACE(u"> [dp_registry.cxx] media-type detection:\n\n"_ustr ); for (auto const& elem : that->m_filter2mediaType) { const Reference<deployment::XPackageRegistry> xBackend( @@ -375,7 +375,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( ->getImplementationName() + "\n"); } - dp_misc::TRACE( "> [dp_registry.cxx] ambiguous backends:\n\n" ); + dp_misc::TRACE( u"> [dp_registry.cxx] ambiguous backends:\n\n"_ustr ); for (auto const& ambiguousBackend : that->m_ambiguousBackends) { OUStringBuffer buf; diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index 40b253587b81..ce15db9f7eb9 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -106,12 +106,12 @@ BackendImpl::BackendImpl( Reference<XComponentContext> const & xComponentContext ) : PackageRegistryBackend( args, xComponentContext ), m_xExecutableTypeInfo(new Package::TypeInfo( - "application/vnd.sun.star.executable", - "", "Executable" ) ) + u"application/vnd.sun.star.executable"_ustr, + u""_ustr, u"Executable"_ustr ) ) { if (!transientMode()) { - OUString dbFile = makeURL(getCachePath(), "backenddb.xml"); + OUString dbFile = makeURL(getCachePath(), u"backenddb.xml"_ustr); m_backendDb.reset( new ExecutableBackendDb(getComponentContext(), dbFile)); } @@ -120,7 +120,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.executable.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.executable.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -213,7 +213,7 @@ BackendImpl * BackendImpl::ExecutablePackageImpl::getMyBackend() const //May throw a DisposedException check(); //We should never get here... - throw RuntimeException( "Failed to get the BackendImpl", + throw RuntimeException( u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<ExecutablePackageImpl *>(this))); } return pBackend; @@ -282,11 +282,11 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() const bool bSuccess = false; OUString sExtensionDir; if(getMyBackend()->m_context == "user") - sExtensionDir = dp_misc::expandUnoRcTerm("$UNO_USER_PACKAGES_CACHE"); + sExtensionDir = dp_misc::expandUnoRcTerm(u"$UNO_USER_PACKAGES_CACHE"_ustr); else if (getMyBackend()->m_context == "shared") - sExtensionDir = dp_misc::expandUnoRcTerm("$UNO_SHARED_PACKAGES_CACHE"); + sExtensionDir = dp_misc::expandUnoRcTerm(u"$UNO_SHARED_PACKAGES_CACHE"_ustr); else if (getMyBackend()->m_context == "bundled") - sExtensionDir = dp_misc::expandUnoRcTerm("$BUNDLED_EXTENSIONS"); + sExtensionDir = dp_misc::expandUnoRcTerm(u"$BUNDLED_EXTENSIONS"_ustr); else OSL_ASSERT(false); //remove file ellipses diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index b0db2acd200e..936875a886eb 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -129,7 +129,7 @@ BackendImpl::BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ) : PackageRegistryBackend( args, xComponentContext ), - m_xHelpTypeInfo( new Package::TypeInfo("application/vnd.sun.star.help", + m_xHelpTypeInfo( new Package::TypeInfo(u"application/vnd.sun.star.help"_ustr, OUString(), DpResId(RID_STR_HELP) ) ), @@ -138,7 +138,7 @@ BackendImpl::BackendImpl( if (transientMode()) return; - OUString dbFile = makeURL(getCachePath(), "backenddb.xml"); + OUString dbFile = makeURL(getCachePath(), u"backenddb.xml"_ustr); m_backendDb.reset( new HelpBackendDb(getComponentContext(), dbFile)); @@ -154,7 +154,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.help.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.help.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -265,7 +265,7 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const //May throw a DisposedException check(); //We should never get here... - throw RuntimeException("Failed to get the BackendImpl", + throw RuntimeException(u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -476,7 +476,7 @@ void BackendImpl::implProcessHelp( else aLang = "en"; - HelpIndexer aIndexer(aLang, "help", langFolderDestExpanded, langFolderDestExpanded); + HelpIndexer aIndexer(aLang, u"help"_ustr, langFolderDestExpanded, langFolderDestExpanded); aIndexer.indexDocuments(); } @@ -588,8 +588,8 @@ Reference< ucb::XSimpleFileAccess3 > const & BackendImpl::getFileAccess() if( !m_xSFA.is() ) { throw RuntimeException( - "dp_registry::backend::help::BackendImpl::getFileAccess(), " - "could not instantiate SimpleFileAccess." ); + u"dp_registry::backend::help::BackendImpl::getFileAccess(), " + "could not instantiate SimpleFileAccess."_ustr ); } } return m_xSFA; diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index c4407d9f2ee2..7b858ca42b13 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -269,13 +269,13 @@ BackendImpl::BackendImpl( : ImplBaseT( args, xComponentContext ), m_xRootRegistry( xRootRegistry ), m_xBundleTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.package-bundle", - "*.oxt;*.uno.pkg", + u"application/vnd.sun.star.package-bundle"_ustr, + u"*.oxt;*.uno.pkg"_ustr, DpResId(RID_STR_PACKAGE_BUNDLE) ) ), m_xLegacyBundleTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.legacy-package-bundle", - "*.zip", + u"application/vnd.sun.star.legacy-package-bundle"_ustr, + u"*.zip"_ustr, m_xBundleTypeInfo->getShortDescription() ) ), m_typeInfos{ m_xBundleTypeInfo, m_xLegacyBundleTypeInfo } @@ -283,7 +283,7 @@ BackendImpl::BackendImpl( if (!transientMode()) { OUString dbFile = makeURL(getCachePath(), getImplementationName()); - dbFile = makeURL(dbFile, "backenddb.xml"); + dbFile = makeURL(dbFile, u"backenddb.xml"_ustr); m_backendDb.reset( new ExtensionBackendDb(getComponentContext(), dbFile)); } @@ -299,7 +299,7 @@ void BackendImpl::disposing() // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.bundle.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.bundle.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService(OUString const & ServiceName) @@ -354,7 +354,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( //Every .oxt, uno.pkg file must contain a META-INF folder ::ucbhelper::Content metaInfContent; if (create_ucb_content( - &metaInfContent, makeURL( url, "META-INF" ), + &metaInfContent, makeURL( url, u"META-INF"_ustr ), xCmdEnv, false /* no throw */ )) { mediaType = "application/vnd.sun.star.package-bundle"; @@ -460,7 +460,7 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const //May throw a DisposedException check(); //We should never get here... - throw RuntimeException("Failed to get the BackendImpl", + throw RuntimeException(u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -573,7 +573,7 @@ bool BackendImpl::PackageImpl::checkPlatform( { ret = false; OUString msg( - "unsupported platform"); + u"unsupported platform"_ustr); Any e( css::deployment::PlatformException( msg, static_cast<OWeakObject *>(this), this)); @@ -600,7 +600,7 @@ bool BackendImpl::PackageImpl::checkDependencies( return true; } else { OUString msg( - "unsatisfied dependencies"); + u"unsatisfied dependencies"_ustr); Any e( css::deployment::DependencyException( msg, static_cast<OWeakObject *>(this), unsatisfied)); @@ -631,14 +631,14 @@ bool BackendImpl::PackageImpl::checkLicense( //license is available. if (sLic.isEmpty()) throw css::deployment::DeploymentException( - "Could not obtain path to license. Possible error in description.xml", nullptr, Any()); + u"Could not obtain path to license. Possible error in description.xml"_ustr, nullptr, Any()); OUString sHref = m_url_expanded + "/" + sLic; OUString sLicense = getTextFromURL(xCmdEnv, sHref); ////determine who has to agree to the license //check correct value for attribute if ( simplLicAttr->acceptBy != "user" && simplLicAttr->acceptBy != "admin") throw css::deployment::DeploymentException( - "Could not obtain attribute simple-license@accept-by or it has no valid value", nullptr, Any()); + u"Could not obtain attribute simple-license@accept-by or it has no valid value"_ustr, nullptr, Any()); //Only use interaction if there is no version of this extension already installed @@ -660,7 +660,7 @@ bool BackendImpl::PackageImpl::checkLicense( if (! interactContinuation( Any(licExc), cppu::UnoType<task::XInteractionApprove>::get(), xCmdEnv, &approve, &abort )) throw css::deployment::DeploymentException( - "Could not interact with user.", nullptr, Any()); + u"Could not interact with user."_ustr, nullptr, Any()); return approve; } @@ -675,7 +675,7 @@ bool BackendImpl::PackageImpl::checkLicense( throw; } catch (const css::uno::Exception&) { Any anyExc = cppu::getCaughtException(); - throw css::deployment::DeploymentException("Unexpected exception", nullptr, anyExc); + throw css::deployment::DeploymentException(u"Unexpected exception"_ustr, nullptr, anyExc); } } @@ -770,7 +770,7 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool uno::Reference< graphic::XGraphicProvider > xGraphProvider( graphic::GraphicProvider::create(xContext) ); uno::Sequence< beans::PropertyValue > aMediaProps{ comphelper::makePropertyValue( - "URL", aFullIconURL) }; + u"URL"_ustr, aFullIconURL) }; xGraphic = xGraphProvider->queryGraphic( aMediaProps ); } @@ -818,7 +818,7 @@ void BackendImpl::PackageImpl::processPackage_( bool approve = false, abort = false; if (! interactContinuation( Any( lang::WrappedTargetException( - "bundle item registration error!", + u"bundle item registration error!"_ustr, static_cast<OWeakObject *>(this), exc ) ), cppu::UnoType<task::XInteractionApprove>::get(), xCmdEnv, &approve, &abort )) { @@ -834,7 +834,7 @@ void BackendImpl::PackageImpl::processPackage_( continue; { - ProgressLevel progress( xCmdEnv, "rollback..." ); + ProgressLevel progress( xCmdEnv, u"rollback..."_ustr ); // try rollback for ( ; pos--; ) { @@ -848,7 +848,7 @@ void BackendImpl::PackageImpl::processPackage_( // ignore any errors of rollback } } - progress.update( "rollback finished." ); + progress.update( u"rollback finished."_ustr ); } deployment::DeploymentException dpExc; @@ -894,7 +894,7 @@ void BackendImpl::PackageImpl::processPackage_( bool approve = false, abort = false; if (! interactContinuation( Any( lang::WrappedTargetException( - "bundle item revocation error!", + u"bundle item revocation error!"_ustr, static_cast<OWeakObject *>(this), exc ) ), cppu::UnoType<task::XInteractionApprove>::get(), xCmdEnv, &approve, &abort )) { @@ -977,7 +977,7 @@ void BackendImpl::PackageImpl::exportTo( m_url_expanded, xCmdEnv, getMyBackend()->getComponentContext() ); OUString title(newTitle); if (title.isEmpty()) - sourceContent.getPropertyValue( "Title" ) >>= title; + sourceContent.getPropertyValue( u"Title"_ustr ) >>= title; OUString destURL( makeURL( destFolderURL, ::rtl::Uri::encode( title, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, @@ -1001,7 +1001,7 @@ void BackendImpl::PackageImpl::exportTo( } } else if (nameClashAction != ucb::NameClash::OVERWRITE) { - throw ucb::CommandFailedException("unsupported nameClashAction!", + throw ucb::CommandFailedException(u"unsupported nameClashAction!"_ustr, static_cast<OWeakObject *>(this), Any() ); } erase_path( destURL, xCmdEnv ); @@ -1037,7 +1037,7 @@ void BackendImpl::PackageImpl::exportTo( // assure META-INF folder: ::ucbhelper::Content metainfFolderContent; create_folder( &metainfFolderContent, - makeURL( destFolderContent.getURL(), "META-INF" ), + makeURL( destFolderContent.getURL(), u"META-INF"_ustr ), xCmdEnv ); if (m_legacyBundle) @@ -1105,7 +1105,7 @@ void BackendImpl::PackageImpl::exportTo( // write buffered pipe data to content: ::ucbhelper::Content manifestContent( - makeURL( metainfFolderContent.getURL(), "manifest.xml" ), + makeURL( metainfFolderContent.getURL(), u"manifest.xml"_ustr ), xCmdEnv, getMyBackend()->getComponentContext() ); manifestContent.writeStream( Reference<io::XInputStream>( xPipe, UNO_QUERY_THROW ), @@ -1120,7 +1120,7 @@ void BackendImpl::PackageImpl::exportTo( ::ucbhelper::Content manifestContent; if ( ! create_ucb_content( &manifestContent, - makeURL( m_url_expanded, "META-INF/manifest.xml" ), + makeURL( m_url_expanded, u"META-INF/manifest.xml"_ustr ), xCmdEnv, false ) ) { OSL_FAIL( "### missing META-INF/manifest.xml file!" ); @@ -1138,13 +1138,13 @@ void BackendImpl::PackageImpl::exportTo( } if (!bSuccess) - throw RuntimeException( "UCB transferContent() failed!", + throw RuntimeException( u"UCB transferContent() failed!"_ustr, static_cast<OWeakObject *>(this) ); } // xxx todo: maybe obsolete in the future try { - destFolderContent.executeCommand( "flush", Any() ); + destFolderContent.executeCommand( u"flush"_ustr, Any() ); } catch (const ucb::UnsupportedCommandException &) { } @@ -1179,13 +1179,13 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( OUString mediaType; // probe for script.xlb: if (create_ucb_content( - nullptr, makeURL( m_url_expanded, "script.xlb" ), + nullptr, makeURL( m_url_expanded, u"script.xlb"_ustr ), xCmdEnv, false /* no throw */ )) { mediaType = "application/vnd.sun.star.basic-library"; } // probe for dialog.xlb: else if (create_ucb_content( - nullptr, makeURL( m_url_expanded, "dialog.xlb" ), + nullptr, makeURL( m_url_expanded, u"dialog.xlb"_ustr ), xCmdEnv, false /* no throw */ )) mediaType = "application/vnd.sun.star.dialog-library"; @@ -1315,7 +1315,7 @@ Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem( !exc.isExtractableTo( cppu::UnoType<lang::IllegalArgumentException>::get()) ) { (void)interactContinuation( - Any( lang::WrappedTargetException("bundle item error!", + Any( lang::WrappedTargetException(u"bundle item error!"_ustr, static_cast<OWeakObject *>(this), exc ) ), cppu::UnoType<task::XInteractionApprove>::get(), xCmdEnv, nullptr, nullptr ); } @@ -1340,7 +1340,7 @@ void BackendImpl::PackageImpl::scanBundle( { OSL_ASSERT( !m_legacyBundle ); - OUString mfUrl( makeURL( m_url_expanded, "META-INF/manifest.xml" ) ); + OUString mfUrl( makeURL( m_url_expanded, u"META-INF/manifest.xml"_ustr ) ); ::ucbhelper::Content manifestContent; if (! create_ucb_content( &manifestContent, mfUrl, xCmdEnv, false /* no throw */ )) @@ -1500,7 +1500,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle( if (title.endsWithIgnoreAsciiCase("skip_registration") ) skip_registration = true; - Sequence<OUString> ar { OUString("Title"), OUString("IsFolder") }; + Sequence<OUString> ar { u"Title"_ustr, u"IsFolder"_ustr }; Reference<sdbc::XResultSet> xResultSet( ucbContent.createCursor( ar ) ); while (xResultSet->next()) { diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index 47e41a364e7b..c4567230456b 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -145,12 +145,12 @@ BackendImpl::BackendImpl( Reference<XComponentContext> const & xComponentContext ) : t_helper( args, xComponentContext ), m_xBasicLibTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.basic-library", + u"application/vnd.sun.star.basic-library"_ustr, OUString() /* no file filter */, DpResId(RID_STR_BASIC_LIB) ) ), m_xDialogLibTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.dialog-library", + u"application/vnd.sun.star.dialog-library"_ustr, OUString() /* no file filter */, DpResId(RID_STR_DIALOG_LIB) ) ), @@ -160,7 +160,7 @@ BackendImpl::BackendImpl( if (!transientMode()) { - OUString dbFile = makeURL(getCachePath(), "backenddb.xml"); + OUString dbFile = makeURL(getCachePath(), u"backenddb.xml"_ustr); m_backendDb.reset( new ScriptBackendDb(getComponentContext(), dbFile)); } @@ -170,7 +170,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.script.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.script.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -239,12 +239,12 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( { // probe for script.xlb: if (create_ucb_content( - nullptr, makeURL( url, "script.xlb" ), + nullptr, makeURL( url, u"script.xlb"_ustr ), xCmdEnv, false /* no throw */ )) mediaType = "application/vnd.sun.star.basic-library"; // probe for dialog.xlb: else if (create_ucb_content( - nullptr, makeURL( url, "dialog.xlb" ), + nullptr, makeURL( url, u"dialog.xlb"_ustr ), xCmdEnv, false /* no throw */ )) mediaType = "application/vnd.sun.star.dialog-library"; } @@ -260,7 +260,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( { if (type.equalsIgnoreAsciiCase("application")) { - OUString dialogURL( makeURL( url, "dialog.xlb" ) ); + OUString dialogURL( makeURL( url, u"dialog.xlb"_ustr ) ); if (! create_ucb_content( nullptr, dialogURL, xCmdEnv, false /* no throw */ )) { dialogURL.clear(); @@ -268,7 +268,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( if (subType.equalsIgnoreAsciiCase("vnd.sun.star.basic-library")) { - OUString scriptURL( makeURL( url, "script.xlb")); + OUString scriptURL( makeURL( url, u"script.xlb"_ustr)); if (! create_ucb_content( nullptr, scriptURL, xCmdEnv, false /* no throw */ )) { scriptURL.clear(); @@ -305,7 +305,7 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const check(); //We should never get here... throw RuntimeException( - "Failed to get the BackendImpl", + u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -406,7 +406,7 @@ void BackendImpl::PackageImpl::processPackage_( { xScriptLibs.set( xComponentContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.script.ApplicationScriptLibraryContainer", + u"com.sun.star.script.ApplicationScriptLibraryContainer"_ustr, xComponentContext ), UNO_QUERY_THROW ); } @@ -414,7 +414,7 @@ void BackendImpl::PackageImpl::processPackage_( { xDialogLibs.set( xComponentContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.script.ApplicationDialogLibraryContainer", + u"com.sun.star.script.ApplicationDialogLibraryContainer"_ustr, xComponentContext ), UNO_QUERY_THROW ); } } diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx index 530924a07864..20ae7fc081f3 100644 --- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx @@ -75,7 +75,7 @@ ParcelDescDocHandler::startElement( const OUString& aName, { if ( aName == "parcel" ) { - m_sLang = xAttribs->getValueByName( "language" ); + m_sLang = xAttribs->getValueByName( u"language"_ustr ); } ++skipIndex; } diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index b617d7fa4ed1..987406e1dd27 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -115,7 +115,7 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const //May throw a DisposedException check(); //We should never get here... - throw RuntimeException("Failed to get the BackendImpl", + throw RuntimeException(u"Failed to get the BackendImpl"_ustr, static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -165,9 +165,9 @@ BackendImpl::BackendImpl( Reference<XComponentContext> const & xComponentContext ) : PackageRegistryBackend( args, xComponentContext ), m_xTypeInfo( new Package::TypeInfo( - "application/vnd.sun.star.framework-script", + u"application/vnd.sun.star.framework-script"_ustr, OUString() /* no file filter */, - "Scripting Framework Script Library" + u"Scripting Framework Script Library"_ustr ) ) { } @@ -176,7 +176,7 @@ BackendImpl::BackendImpl( // XServiceInfo OUString BackendImpl::getImplementationName() { - return "com.sun.star.comp.deployment.sfwk.PackageRegistryBackend"; + return u"com.sun.star.comp.deployment.sfwk.PackageRegistryBackend"_ustr; } sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) @@ -217,7 +217,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( { // probe for parcel-descriptor.xml: if (create_ucb_content( - nullptr, makeURL( url, "parcel-descriptor.xml" ), + nullptr, makeURL( url, u"parcel-descriptor.xml"_ustr ), xCmdEnv, false /* no throw */ )) { mediaType = "application/vnd.sun.star.framework-script"; @@ -237,9 +237,9 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( { if (subType.equalsIgnoreAsciiCase("vnd.sun.star.framework-script")) { - OUString lang = "Script"; + OUString lang = u"Script"_ustr; OUString sParcelDescURL = makeURL( - url, "parcel-descriptor.xml" ); + url, u"parcel-descriptor.xml"_ustr ); ::ucbhelper::Content ucb_content; @@ -268,14 +268,14 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( OUString sfwkLibType = DpResId( RID_STR_SFWK_LIB ); // replace %MACRONAME placeholder with language name - OUString MACRONAME( "%MACROLANG" ); + OUString MACRONAME( u"%MACROLANG"_ustr ); sal_Int32 startOfReplace = sfwkLibType.indexOf( MACRONAME ); sal_Int32 charsToReplace = MACRONAME.getLength(); sfwkLibType = sfwkLibType.replaceAt( startOfReplace, charsToReplace, lang ); - dp_misc::TRACE("******************************\n"); + dp_misc::TRACE(u"******************************\n"_ustr); dp_misc::TRACE(" BackEnd detected lang = " + lang + "\n"); dp_misc::TRACE(" for url " + sParcelDescURL + "\n"); - dp_misc::TRACE("******************************\n"); + dp_misc::TRACE(u"******************************\n"_ustr); return new PackageImpl( this, url, sfwkLibType, bRemoved, identifier); } } @@ -297,15 +297,15 @@ void BackendImpl::PackageImpl:: initPackageHandler() if ( that->m_eContext == Context::User ) { - aContext <<= OUString("user"); + aContext <<= u"user"_ustr; } else if ( that->m_eContext == Context::Shared ) { - aContext <<= OUString("share"); + aContext <<= u"share"_ustr; } else if ( that->m_eContext == Context::Bundled ) { - aContext <<= OUString("bundled"); + aContext <<= u"bundled"_ustr; } else { @@ -350,8 +350,8 @@ void BackendImpl::PackageImpl::processPackage_( { if ( !m_xNameCntrPkgHandler.is() ) { - dp_misc::TRACE("no package handler!!!!\n"); - throw RuntimeException( "No package Handler " ); + dp_misc::TRACE(u"no package handler!!!!\n"_ustr); + throw RuntimeException( u"No package Handler "_ustr ); } if (doRegisterPackage) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 28ba524ad0eb..30d2d824e5c6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -841,19 +841,19 @@ OUString lcl_getCurrentDocumentMimeType(const LibLODocument_Impl* pDocument) { SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(pDocument->mxComponent.get()); if (!pBaseModel) - return ""; + return u""_ustr; SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell(); if (!pObjectShell) - return ""; + return u""_ustr; SfxMedium* pMedium = pObjectShell->GetMedium(); if (!pMedium) - return ""; + return u""_ustr; auto pFilter = pMedium->GetFilter(); if (!pFilter) - return ""; + return u""_ustr; return pFilter->GetMimeType(); } @@ -922,7 +922,7 @@ void ExecuteOrientationChange() getUndoManager( pViewFrm->GetFrame().GetFrameInterface() ) ); if ( mxUndoManager.is() ) - mxUndoManager->enterUndoContext( "" ); + mxUndoManager->enterUndoContext( u""_ustr ); SfxPoolItemHolder aResult; pViewFrm->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, aResult); @@ -3296,7 +3296,7 @@ void FunctionBasedURPConnection::close() SAL_INFO("lok.urp", "Requested to close FunctionBasedURPConnection"); } -OUString FunctionBasedURPConnection::getDescription() { return ""; } +OUString FunctionBasedURPConnection::getDescription() { return u""_ustr; } void FunctionBasedURPConnection::setBridge(const Reference<XBridge>& xBridge) { m_URPBridge = xBridge; } } @@ -5081,7 +5081,7 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c OutputDevice *pDevice = Application::GetDefaultDevice(); OutputDevice::ImplClearAllFontData(false); - pDevice->AddTempDevFont(sMagicFileName, ""); + pDevice->AddTempDevFont(sMagicFileName, u""_ustr); OutputDevice::ImplRefreshAllFontData(false); } #endif @@ -7546,7 +7546,7 @@ static void preloadData() std::cerr << "CheckExtensionDependencies failed" << std::endl; // inhibit forced 2nd synchronization from Main - ::rtl::Bootstrap::set( "DISABLE_EXTENSION_SYNCHRONIZATION", "true"); + ::rtl::Bootstrap::set( u"DISABLE_EXTENSION_SYNCHRONIZATION"_ustr, u"true"_ustr); std::cerr << "Preload textencodings"; // sal_textenc // Use RTL_TEXTENCODING_MS_1250 to trigger Impl_getTextEncodingData @@ -7601,7 +7601,7 @@ static void preloadData() css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = css::i18n::BreakIterator::create(xContext); css::i18n::LineBreakUserOptions aUserOptions; css::i18n::LineBreakHyphenationOptions aHyphOptions( LinguMgr::GetHyphenator(), css::uno::Sequence<beans::PropertyValue>(), 1 ); - xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], /*nMinBreakPos*/0, aHyphOptions, aUserOptions); + xBreakIterator->getLineBreak(u""_ustr, /*nMaxBreakPos*/0, aLocales[0], /*nMinBreakPos*/0, aHyphOptions, aUserOptions); } css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create( @@ -7684,7 +7684,7 @@ static void preloadData() uno::Sequence<css::beans::PropertyValue> szEmptyArgs(0); for (const auto& component : preloadComponents) { - auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, szEmptyArgs); + auto xComp = xCompLoader->loadComponentFromURL(component, u"_blank"_ustr, 0, szEmptyArgs); xComp->dispose(); } diff --git a/desktop/source/lib/lokclipboard.cxx b/desktop/source/lib/lokclipboard.cxx index f7d52ba466e2..74374b95d66c 100644 --- a/desktop/source/lib/lokclipboard.cxx +++ b/desktop/source/lib/lokclipboard.cxx @@ -77,11 +77,14 @@ LOKClipboard::LOKClipboard() Sequence<OUString> LOKClipboard::getSupportedServiceNames_static() { - Sequence<OUString> aRet{ "com.sun.star.datatransfer.clipboard.LokClipboard" }; + Sequence<OUString> aRet{ u"com.sun.star.datatransfer.clipboard.LokClipboard"_ustr }; return aRet; } -OUString LOKClipboard::getImplementationName() { return "com.sun.star.datatransfer.LOKClipboard"; } +OUString LOKClipboard::getImplementationName() +{ + return u"com.sun.star.datatransfer.LOKClipboard"_ustr; +} Sequence<OUString> LOKClipboard::getSupportedServiceNames() { @@ -156,7 +159,7 @@ LOKTransferable::LOKTransferable() { m_aContent.reserve(1); m_aFlavors = css::uno::Sequence<css::datatransfer::DataFlavor>(1); - initFlavourFromMime(m_aFlavors.getArray()[0], "text/plain"); + initFlavourFromMime(m_aFlavors.getArray()[0], u"text/plain"_ustr); uno::Any aContent; aContent <<= OUString(); m_aContent.push_back(aContent); diff --git a/desktop/source/lib/lokclipboard.hxx b/desktop/source/lib/lokclipboard.hxx index 699830756acb..0ff955a8c154 100644 --- a/desktop/source/lib/lokclipboard.hxx +++ b/desktop/source/lib/lokclipboard.hxx @@ -51,7 +51,7 @@ public: const css::uno::Reference<css::datatransfer::XTransferable>& xTransferable, const css::uno::Reference<css::datatransfer::clipboard::XClipboardOwner>& xClipboardOwner) override; - OUString SAL_CALL getName() override { return "CLIPBOARD"; } + OUString SAL_CALL getName() override { return u"CLIPBOARD"_ustr; } // XClipboardEx sal_Int8 SAL_CALL getRenderingCapabilities() override { return 0; } diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index a05091cedf5e..0680a9dd97f1 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -72,7 +72,7 @@ LOKInteractionHandler::~LOKInteractionHandler() OUString SAL_CALL LOKInteractionHandler::getImplementationName() { - return "com.sun.star.comp.uui.LOKInteractionHandler"; + return u"com.sun.star.comp.uui.LOKInteractionHandler"_ustr; } sal_Bool SAL_CALL LOKInteractionHandler::supportsService(OUString const & rServiceName) @@ -82,11 +82,11 @@ sal_Bool SAL_CALL LOKInteractionHandler::supportsService(OUString const & rServi uno::Sequence< OUString > SAL_CALL LOKInteractionHandler::getSupportedServiceNames() { - return { "com.sun.star.task.InteractionHandler", + return { u"com.sun.star.task.InteractionHandler"_ustr, // added to indicate support for configuration.backend.MergeRecoveryRequest - "com.sun.star.configuration.backend.InteractionHandler", + u"com.sun.star.configuration.backend.InteractionHandler"_ustr, // for backwards compatibility - "com.sun.star.uui.InteractionHandler" }; + u"com.sun.star.uui.InteractionHandler"_ustr }; } void SAL_CALL LOKInteractionHandler::initialize(uno::Sequence<uno::Any> const & /*rArguments*/) @@ -188,7 +188,7 @@ bool LOKInteractionHandler::handleIOException(const css::uno::Sequence<css::uno: ERRCODE_IO_WRONGVERSION, }; - postError(aIoException.Classification, "io", aErrorCode[static_cast<int>(aIoException.Code)], ""); + postError(aIoException.Classification, "io", aErrorCode[static_cast<int>(aIoException.Code)], u""_ustr); selectApproved(rContinuations); return true; diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index d6b52c806367..76c769eba0bb 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -263,7 +263,7 @@ void MigrationImpl::setMigrationCompleted() { try { uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW); - aPropertySet->setPropertyValue("MigrationCompleted", uno::Any(true)); + aPropertySet->setPropertyValue(u"MigrationCompleted"_ustr, uno::Any(true)); uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges(); } catch (...) { // fail silently @@ -276,7 +276,7 @@ bool MigrationImpl::checkMigrationCompleted() try { uno::Reference< XPropertySet > aPropertySet( getConfigAccess("org.openoffice.Setup/Office"), uno::UNO_QUERY_THROW); - aPropertySet->getPropertyValue("MigrationCompleted") >>= bMigrationCompleted; + aPropertySet->getPropertyValue(u"MigrationCompleted"_ustr) >>= bMigrationCompleted; if( !bMigrationCompleted && getenv("SAL_DISABLE_USERMIGRATION" ) ) { // migration prevented - fake its success @@ -335,7 +335,7 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName) // get migration description from org.openoffice.Setup/Migration // and build vector of migration steps - uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName("MigrationSteps"), uno::UNO_QUERY_THROW); + uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(u"MigrationSteps"_ustr), uno::UNO_QUERY_THROW); uno::Reference< XNameAccess > tmpAccess; uno::Sequence< OUString > tmpSeq; migrations_vr vrMigrations(new migrations_v); @@ -346,37 +346,37 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName) migration_step tmpStep; // read included files from current step description - if (tmpAccess->getByName("IncludedFiles") >>= tmpSeq) { + if (tmpAccess->getByName(u"IncludedFiles"_ustr) >>= tmpSeq) { for (const OUString& rSeqEntry : tmpSeq) tmpStep.includeFiles.push_back(rSeqEntry); } // excluded files... - if (tmpAccess->getByName("ExcludedFiles") >>= tmpSeq) { + if (tmpAccess->getByName(u"ExcludedFiles"_ustr) >>= tmpSeq) { for (const OUString& rSeqEntry : tmpSeq) tmpStep.excludeFiles.push_back(rSeqEntry); } // included nodes... - if (tmpAccess->getByName("IncludedNodes") >>= tmpSeq) { + if (tmpAccess->getByName(u"IncludedNodes"_ustr) >>= tmpSeq) { for (const OUString& rSeqEntry : tmpSeq) tmpStep.includeConfig.push_back(rSeqEntry); } // excluded nodes... - if (tmpAccess->getByName("ExcludedNodes") >>= tmpSeq) { + if (tmpAccess->getByName(u"ExcludedNodes"_ustr) >>= tmpSeq) { for (const OUString& rSeqEntry : tmpSeq) tmpStep.excludeConfig.push_back(rSeqEntry); } // excluded extensions... - if (tmpAccess->getByName("ExcludedExtensions") >>= tmpSeq) { + if (tmpAccess->getByName(u"ExcludedExtensions"_ustr) >>= tmpSeq) { for (const OUString& rSeqEntry : tmpSeq) tmpStep.excludeExtensions.push_back(rSeqEntry); } // generic service - tmpAccess->getByName("MigrationService") >>= tmpStep.service; + tmpAccess->getByName(u"MigrationService"_ustr) >>= tmpStep.service; vrMigrations->push_back(tmpStep); } @@ -772,17 +772,17 @@ next: OUString sMigratedColorScheme; uno::Reference<XPropertySet> aPropertySet( getConfigAccess("org.openoffice.Office.UI/ColorScheme", true), uno::UNO_QUERY_THROW); - if (aPropertySet->getPropertyValue("CurrentColorScheme") >>= sMigratedColorScheme) + if (aPropertySet->getPropertyValue(u"CurrentColorScheme"_ustr) >>= sMigratedColorScheme) { if (sMigratedColorScheme.equals(sMigratedProductName)) { - aPropertySet->setPropertyValue("CurrentColorScheme", + aPropertySet->setPropertyValue(u"CurrentColorScheme"_ustr, uno::Any(sProductName)); uno::Reference<XChangesBatch>(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges(); } else if (sMigratedColorScheme.equals(sMigratedProductNameDark)) { - aPropertySet->setPropertyValue("CurrentColorScheme", + aPropertySet->setPropertyValue(u"CurrentColorScheme"_ustr, uno::Any(sProductNameDark)); uno::Reference<XChangesBatch>(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges(); } @@ -858,9 +858,9 @@ void MigrationImpl::runServices() // Build argument array uno::Sequence< uno::Any > seqArguments(3); auto pseqArguments = seqArguments.getArray(); - pseqArguments[0] <<= NamedValue("Productname", + pseqArguments[0] <<= NamedValue(u"Productname"_ustr, uno::Any(m_aInfo.productname)); - pseqArguments[1] <<= NamedValue("UserData", + pseqArguments[1] <<= NamedValue(u"UserData"_ustr, uno::Any(m_aInfo.userdata)); @@ -880,7 +880,7 @@ void MigrationImpl::runServices() if ( nSize > 0 ) seqExtDenyList = comphelper::arrayToSequence< OUString >( rMigration.excludeExtensions.data(), nSize ); - pseqArguments[2] <<= NamedValue("ExtensionDenyList", + pseqArguments[2] <<= NamedValue(u"ExtensionDenyList"_ustr, uno::Any( seqExtDenyList )); xMigrationJob.set( diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx index 94e8677de786..aa0a8e63af3c 100644 --- a/desktop/source/migration/services/basicmigration.cxx +++ b/desktop/source/migration/services/basicmigration.cxx @@ -133,7 +133,7 @@ namespace migration OUString BasicMigration::getImplementationName() { - return "com.sun.star.comp.desktop.migration.Basic"; + return u"com.sun.star.comp.desktop.migration.Basic"_ustr; } @@ -145,7 +145,7 @@ namespace migration Sequence< OUString > BasicMigration::getSupportedServiceNames() { - return { "com.sun.star.migration.Basic" }; + return { u"com.sun.star.migration.Basic"_ustr }; } diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx index 892c651f29de..8d46ac59ccea 100644 --- a/desktop/source/migration/services/jvmfwk.cxx +++ b/desktop/source/migration/services/jvmfwk.cxx @@ -147,7 +147,7 @@ JavaMigration::~JavaMigration() OUString jvmfwk_getImplementationName() { - return IMPL_NAME; + return u"" IMPL_NAME ""_ustr; } css::uno::Sequence< OUString > jvmfwk_getSupportedServiceNames() @@ -231,7 +231,7 @@ void JavaMigration::migrateJavarc() OUString sValue; rtl::Bootstrap javaini(m_sUserDir + "/user/config/" SAL_CONFIGFILE("java")); - bool bSuccess = javaini.getFrom("Home", sValue); + bool bSuccess = javaini.getFrom(u"Home"_ustr, sValue); OSL_ENSURE(bSuccess, "[Service implementation " IMPL_NAME "] XJob::execute: Could not get Home entry from java.ini/javarc."); if (!bSuccess || sValue.isEmpty()) @@ -322,12 +322,12 @@ void SAL_CALL JavaMigration::setPropertyValue( bool val; if (!(aValue >>= val)) throw MalformedDataException( - "[Service implementation " IMPL_NAME - "] XLayerHandler::setPropertyValue received wrong type for Enable property", nullptr, Any()); + u"[Service implementation " IMPL_NAME + "] XLayerHandler::setPropertyValue received wrong type for Enable property"_ustr, nullptr, Any()); if (jfw_setEnabled(val) != JFW_E_NONE) throw WrappedTargetException( - "[Service implementation " IMPL_NAME - "] XLayerHandler::setPropertyValue: jfw_setEnabled failed.", nullptr, Any()); + u"[Service implementation " IMPL_NAME + "] XLayerHandler::setPropertyValue: jfw_setEnabled failed."_ustr, nullptr, Any()); break; } @@ -336,13 +336,13 @@ void SAL_CALL JavaMigration::setPropertyValue( OUString cp; if (!(aValue >>= cp)) throw MalformedDataException( - "[Service implementation " IMPL_NAME - "] XLayerHandler::setPropertyValue received wrong type for UserClassPath property", nullptr, Any()); + u"[Service implementation " IMPL_NAME + "] XLayerHandler::setPropertyValue received wrong type for UserClassPath property"_ustr, nullptr, Any()); if (jfw_setUserClassPath(cp) != JFW_E_NONE) throw WrappedTargetException( - "[Service implementation " IMPL_NAME - "] XLayerHandler::setPropertyValue: jfw_setUserClassPath failed.", nullptr, Any()); + u"[Service implementation " IMPL_NAME + "] XLayerHandler::setPropertyValue: jfw_setUserClassPath failed."_ustr, nullptr, Any()); break; } default: diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index d8e90abe416f..70835a3cf187 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -167,14 +167,14 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU { uno::Reference< xml::xpath::XXPathAPI > xPath = xml::xpath::XPathAPI::create(m_ctx); - xPath->registerNS("desc", xRoot->getNamespaceURI()); - xPath->registerNS("xlink", "http://www.w3.org/1999/xlink"); + xPath->registerNS(u"desc"_ustr, xRoot->getNamespaceURI()); + xPath->registerNS(u"xlink"_ustr, u"http://www.w3.org/1999/xlink"_ustr); try { uno::Reference< xml::dom::XNode > xNode( xPath->selectSingleNode( - xRoot, "desc:identifier/@value" )); + xRoot, u"desc:identifier/@value"_ustr )); if ( xNode.is() ) aExtIdentifier = xNode->getNodeValue(); } @@ -241,7 +241,7 @@ void OO3ExtensionMigration::migrateExtension( const OUString& sSourceDir ) uno::Reference< task::XAbortChannel > xAbortChannel; extMgr->addExtension( - sSourceDir, uno::Sequence<beans::NamedValue>(), "user", + sSourceDir, uno::Sequence<beans::NamedValue>(), u"user"_ustr, xAbortChannel, pCmdEnv ); } catch ( css::uno::Exception & ) @@ -258,7 +258,7 @@ void OO3ExtensionMigration::migrateExtension( const OUString& sSourceDir ) OUString OO3ExtensionMigration::getImplementationName() { - return "com.sun.star.comp.desktop.migration.OOo3Extensions"; + return u"com.sun.star.comp.desktop.migration.OOo3Extensions"_ustr; } @@ -270,7 +270,7 @@ sal_Bool OO3ExtensionMigration::supportsService(OUString const & ServiceName) Sequence< OUString > OO3ExtensionMigration::getSupportedServiceNames() { - return { "com.sun.star.migration.Extensions" }; + return { u"com.sun.star.migration.Extensions"_ustr }; } diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index a3fff8823925..59ae64908c8b 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -164,7 +164,7 @@ static bool IsUserWordbook( const OUString& rFile ) OUString WordbookMigration::getImplementationName() { - return "com.sun.star.comp.desktop.migration.Wordbooks"; + return u"com.sun.star.comp.desktop.migration.Wordbooks"_ustr; } @@ -176,7 +176,7 @@ static bool IsUserWordbook( const OUString& rFile ) Sequence< OUString > WordbookMigration::getSupportedServiceNames() { - return { "com.sun.star.migration.Wordbooks" }; + return { u"com.sun.star.migration.Wordbooks"_ustr }; } diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 9598466d9c5b..5dbecd0f1254 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -118,7 +118,7 @@ void Acceptor::run() // thus preventing the bridge from being disposed. When the remote end releases // the bridge, it will be destructed. Reference< XBridge > rBridge = m_rBridgeFactory->createBridge( - "", m_aProtocol, rConnection, rInstanceProvider); + u""_ustr, m_aProtocol, rConnection, rInstanceProvider); std::unique_lock g(m_aMutex); m_bridges.add(rBridge); } catch (const Exception&) { @@ -152,7 +152,7 @@ void Acceptor::initialize( const Sequence<Any>& aArguments ) sal_Int32 nIndex1 = m_aAcceptString.indexOf( ';' ); if (nIndex1 < 0) throw IllegalArgumentException( - "Invalid accept-string format", m_rContext, 1); + u"Invalid accept-string format"_ustr, m_rContext, 1); m_aConnectString = o3tl::trim(m_aAcceptString.subView( 0 , nIndex1 )); nIndex1++; sal_Int32 nIndex2 = m_aAcceptString.indexOf( ';' , nIndex1 ); @@ -177,18 +177,18 @@ void Acceptor::initialize( const Sequence<Any>& aArguments ) if (!bOk) { - throw IllegalArgumentException( "invalid initialization", m_rContext, 1); + throw IllegalArgumentException( u"invalid initialization"_ustr, m_rContext, 1); } } // XServiceInfo OUString Acceptor::getImplementationName() { - return "com.sun.star.office.comp.Acceptor"; + return u"com.sun.star.office.comp.Acceptor"_ustr; } Sequence<OUString> Acceptor::getSupportedServiceNames() { - return { "com.sun.star.office.Acceptor" }; + return { u"com.sun.star.office.Acceptor"_ustr }; } sal_Bool Acceptor::supportsService(OUString const & ServiceName) @@ -223,12 +223,12 @@ Reference<XInterface> AccInstanceProvider::getInstance (const OUString& aName ) else if ( aName == "StarOffice.NamingService" ) { Reference< XNamingService > rNamingService( - m_rContext->getServiceManager()->createInstanceWithContext("com.sun.star.uno.NamingService", m_rContext), + m_rContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.uno.NamingService"_ustr, m_rContext), UNO_QUERY ); if ( rNamingService.is() ) { - rNamingService->registerObject( "StarOffice.ServiceManager", m_rContext->getServiceManager() ); - rNamingService->registerObject( "StarOffice.ComponentContext", m_rContext ); + rNamingService->registerObject( u"StarOffice.ServiceManager"_ustr, m_rContext->getServiceManager() ); + rNamingService->registerObject( u"StarOffice.ComponentContext"_ustr, m_rContext ); rInstance = rNamingService; } } diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 0ecb328b7c69..d894bc77e138 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -219,23 +219,23 @@ extern "C" int unopkg_main() std::unique_ptr<utl::TempFileNamed> pUserProfileTempDir; OptionInfo const * info_shared = getOptionInfo( - s_option_infos, "shared" ); + s_option_infos, u"shared"_ustr ); OptionInfo const * info_force = getOptionInfo( - s_option_infos, "force" ); + s_option_infos, u"force"_ustr ); OptionInfo const * info_verbose = getOptionInfo( - s_option_infos, "verbose" ); + s_option_infos, u"verbose"_ustr ); OptionInfo const * info_log = getOptionInfo( - s_option_infos, "log-file" ); + s_option_infos, u"log-file"_ustr ); OptionInfo const * info_context = getOptionInfo( - s_option_infos, "deployment-context" ); + s_option_infos, u"deployment-context"_ustr ); OptionInfo const * info_help = getOptionInfo( - s_option_infos, "help" ); + s_option_infos, u"help"_ustr ); OptionInfo const * info_version = getOptionInfo( - s_option_infos, "version" ); + s_option_infos, u"version"_ustr ); OptionInfo const * info_bundled = getOptionInfo( - s_option_infos, "bundled" ); + s_option_infos, u"bundled"_ustr ); OptionInfo const * info_suppressLicense = getOptionInfo( - s_option_infos, "suppress-license" ); + s_option_infos, u"suppress-license"_ustr ); Reference<XComponentContext> xComponentContext; @@ -319,7 +319,7 @@ extern "C" int unopkg_main() } xComponentContext = getUNO(option_verbose, subcmd_gui, - pUserProfileTempDir ? pUserProfileTempDir->GetURL() : "", + pUserProfileTempDir ? pUserProfileTempDir->GetURL() : u""_ustr, xLocalComponentContext); // Initialize logging. This will log errors to the console and @@ -328,7 +328,7 @@ extern "C" int unopkg_main() const Reference<XLogger> xLogger(logger->getLogger()); xLogger->setLevel(LogLevel::WARNING); Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xLocalComponentContext)); - Sequence < beans::NamedValue > aSeq { { "Formatter", Any(xLogFormatter) } }; + Sequence < beans::NamedValue > aSeq { { u"Formatter"_ustr, Any(xLogFormatter) } }; xConsoleHandler.set(ConsoleHandler::createWithSettings(xLocalComponentContext, aSeq)); xLogger->addLogHandler(xConsoleHandler); @@ -338,7 +338,7 @@ extern "C" int unopkg_main() if (!logFile.isEmpty()) { - Sequence < beans::NamedValue > aSeq2 { { "Formatter", Any(xLogFormatter) }, {"FileURL", Any(logFile)} }; + Sequence < beans::NamedValue > aSeq2 { { u"Formatter"_ustr, Any(xLogFormatter) }, {u"FileURL"_ustr, Any(logFile)} }; xFileHandler.set(css::logging::FileHandler::createWithSettings(xLocalComponentContext, aSeq2)); xFileHandler->setLevel(LogLevel::WARNING); xLogger->addLogHandler(xFileHandler); @@ -424,8 +424,8 @@ extern "C" int unopkg_main() if (subcmd_add) { beans::NamedValue nvSuppress( - "SUPPRESS_LICENSE", option_suppressLicense ? - Any(OUString("1")):Any(OUString("0"))); + u"SUPPRESS_LICENSE"_ustr, option_suppressLicense ? + Any(u"1"_ustr):Any(u"0"_ustr)); xExtensionManager->addExtension( cmdPackage, Sequence<beans::NamedValue>(&nvSuppress, 1), repository, Reference<task::XAbortChannel>(), xCmdEnv); @@ -616,18 +616,18 @@ extern "C" int unopkg_main() } catch (const ucb::CommandFailedException &e) { - logFatal(logger.get(), LogLevel::SEVERE, "Exception occurred: $1$", e.Message); + logFatal(logger.get(), LogLevel::SEVERE, u"Exception occurred: $1$"_ustr, e.Message); } catch (const ucb::CommandAbortedException &) { - logFatal(logger.get(), LogLevel::SEVERE, "$1$ aborted.", APP_NAME); + logFatal(logger.get(), LogLevel::SEVERE, u"$1$ aborted."_ustr, u"" APP_NAME ""_ustr); bShowFailedMsg = false; } catch (const deployment::DeploymentException & exc) { - logFatal(logger.get(), LogLevel::SEVERE, "Exception occurred: $1$", exc.Message); + logFatal(logger.get(), LogLevel::SEVERE, u"Exception occurred: $1$"_ustr, exc.Message); logFatal( - logger.get(), LogLevel::INFO, " Cause: $1$", comphelper::anyToString(exc.Cause)); + logger.get(), LogLevel::INFO, u" Cause: $1$"_ustr, comphelper::anyToString(exc.Cause)); } catch (const LockFileException & e) { @@ -638,11 +638,11 @@ extern "C" int unopkg_main() catch (const css::uno::Exception & e ) { Any exc( ::cppu::getCaughtException() ); - logFatal(logger.get(), LogLevel::SEVERE, "Exception occurred: $1$", e.Message); - logFatal(logger.get(), LogLevel::INFO, " Cause: $1$", comphelper::anyToString(exc)); + logFatal(logger.get(), LogLevel::SEVERE, u"Exception occurred: $1$"_ustr, e.Message); + logFatal(logger.get(), LogLevel::INFO, u" Cause: $1$"_ustr, comphelper::anyToString(exc)); } if (bShowFailedMsg) - logFatal(logger.get(), LogLevel::SEVERE, "$1$ failed.", APP_NAME); + logFatal(logger.get(), LogLevel::SEVERE, u"$1$ failed."_ustr, u"" APP_NAME ""_ustr); dp_misc::disposeBridges(xLocalComponentContext); if (xLocalComponentContext.is()) { css::uno::Reference<css::lang::XComponent>( diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 581922a3c365..719d09466a58 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -108,7 +108,7 @@ CommandEnvironmentImpl::CommandEnvironmentImpl( m_xLogFile.set( xComponentContext->getServiceManager() ->createInstanceWithArgumentsAndContext( - "com.sun.star.comp.deployment.ProgressLog", + u"com.sun.star.comp.deployment.ProgressLog"_ustr, Sequence<Any>(), xComponentContext ), UNO_QUERY_THROW ); } @@ -140,7 +140,7 @@ void CommandEnvironmentImpl::printLicense( OUString sNO = DpResId(RID_STR_UNOPKG_ACCEPT_LIC_NO); OUString sN = DpResId(RID_STR_UNOPKG_ACCEPT_LIC_N); - OUString sNewLine("\n"); + OUString sNewLine(u"\n"_ustr); dp_misc::writeConsole(Concat2View(sNewLine + sNewLine + s1 + sNewLine + sNewLine)); dp_misc::writeConsole(Concat2View(sLicense + sNewLine + sNewLine)); diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 051ed782e38a..5577a840faf6 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -162,7 +162,7 @@ OUString const & getExecutableDir() { OUString path; if (osl_getExecutableFile( &path.pData ) != osl_Process_E_None) { - throw RuntimeException("cannot locate executable directory!",nullptr); + throw RuntimeException(u"cannot locate executable directory!"_ustr,nullptr); } return path.copy( 0, path.lastIndexOf( '/' ) ); }(); @@ -350,7 +350,7 @@ Reference<XComponentContext> connectToOffice( { OUString pipeId( ::dp_misc::generateRandomPipeId() ); - Sequence<OUString> args { "--nologo", "--nodefault", "--accept=pipe,name=" + pipeId + ";urp;" }; + Sequence<OUString> args { u"--nologo"_ustr, u"--nodefault"_ustr, "--accept=pipe,name=" + pipeId + ";urp;" }; OUString appURL( getExecutableDir() + "/soffice" ); if (verbose) @@ -385,11 +385,11 @@ Reference<XComponentContext> connectToOffice( static OUString getLockFilePath() { OUString ret; - OUString sBootstrap("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}"); + OUString sBootstrap(u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}"_ustr); rtl::Bootstrap::expandMacros(sBootstrap); OUString sAbs; if (::osl::File::E_None == ::osl::File::getAbsoluteFileURL( - sBootstrap, ".lock", sAbs)) + sBootstrap, u".lock"_ustr, sAbs)) { if (::osl::File::E_None == ::osl::File::getSystemPathFromFileURL(sAbs, sBootstrap)) @@ -407,7 +407,7 @@ Reference<XComponentContext> getUNO( { // do not create any user data (for the root user) in --shared mode: if (!sTempDir.isEmpty()) - rtl::Bootstrap::set("UserInstallation", sTempDir); + rtl::Bootstrap::set(u"UserInstallation"_ustr, sTempDir); // hold lock during process runtime: static ::desktop::Lockfile s_lockfile( false /* no IPC server */ ); @@ -431,7 +431,7 @@ Reference<XComponentContext> getUNO( //We show a message box or print to the console that there //is another instance already running if ( ! InitVCL() ) - throw RuntimeException( "Cannot initialize VCL!" ); + throw RuntimeException( u"Cannot initialize VCL!"_ustr ); { std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, VclMessageType::Warning, VclButtonsType::Ok, diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 01a2ed3f0bf8..3392e9f5e886 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -110,13 +110,13 @@ public: virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any>& aArguments ) override; virtual OUString SAL_CALL getImplementationName() override - { return "com.sun.star.office.comp.SplashScreen"; } + { return u"com.sun.star.office.comp.SplashScreen"_ustr; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override - { return { "com.sun.star.office.SplashScreen" }; } + { return { u"com.sun.star.office.SplashScreen"_ustr }; } }; SplashScreenWindow::SplashScreenWindow(SplashScreen *pSplash) @@ -343,16 +343,16 @@ OUString implReadBootstrapKey( const OUString& _rKey ) void SplashScreen::loadConfig() { - _bShowLogo = implReadBootstrapKey( "Logo" ) != "0"; - - OUString sProgressFrameColor = implReadBootstrapKey( "ProgressFrameColor" ); - OUString sProgressBarColor = implReadBootstrapKey( "ProgressBarColor" ); - OUString sProgressTextColor = implReadBootstrapKey( "ProgressTextColor" ); - OUString sProgressTextBaseline = implReadBootstrapKey( "ProgressTextBaseline" ); - OUString sSize = implReadBootstrapKey( "ProgressSize" ); - OUString sPosition = implReadBootstrapKey( "ProgressPosition" ); - OUString sFullScreenSplash = implReadBootstrapKey( "FullScreenSplash" ); - OUString sNativeProgress = implReadBootstrapKey( "NativeProgress" ); + _bShowLogo = implReadBootstrapKey( u"Logo"_ustr ) != "0"; + + OUString sProgressFrameColor = implReadBootstrapKey( u"ProgressFrameColor"_ustr ); + OUString sProgressBarColor = implReadBootstrapKey( u"ProgressBarColor"_ustr ); + OUString sProgressTextColor = implReadBootstrapKey( u"ProgressTextColor"_ustr ); + OUString sProgressTextBaseline = implReadBootstrapKey( u"ProgressTextBaseline"_ustr ); + OUString sSize = implReadBootstrapKey( u"ProgressSize"_ustr ); + OUString sPosition = implReadBootstrapKey( u"ProgressPosition"_ustr ); + OUString sFullScreenSplash = implReadBootstrapKey( u"FullScreenSplash"_ustr ); + OUString sNativeProgress = implReadBootstrapKey( u"NativeProgress"_ustr ); // Determine full screen splash mode diff --git a/desktop/source/splash/unxsplash.cxx b/desktop/source/splash/unxsplash.cxx index b218b75919b9..2e07921bc3ba 100644 --- a/desktop/source/splash/unxsplash.cxx +++ b/desktop/source/splash/unxsplash.cxx @@ -103,7 +103,7 @@ UnxSplashScreen::initialize( const css::uno::Sequence< css::uno::Any>& ) OUString UnxSplashScreen::getImplementationName() { - return "com.sun.star.office.comp.PipeSplashScreen"; + return u"com.sun.star.office.comp.PipeSplashScreen"_ustr; } sal_Bool UnxSplashScreen::supportsService(OUString const & ServiceName) @@ -113,7 +113,7 @@ sal_Bool UnxSplashScreen::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> UnxSplashScreen::getSupportedServiceNames() { - return { "com.sun.star.office.PipeSplashScreen" }; + return { u"com.sun.star.office.PipeSplashScreen"_ustr }; } } |