include/sfx2/basedlgs.hxx | 4 include/sfx2/tplpitem.hxx | 2 sfx2/inc/preventduplicateinteraction.hxx | 2 sfx2/qa/cppunit/doc.cxx | 36 +-- sfx2/qa/cppunit/test_classification.cxx | 38 +-- sfx2/qa/cppunit/test_metadatable.cxx | 12 - sfx2/qa/cppunit/test_misc.cxx | 18 - sfx2/qa/cppunit/view.cxx | 4 sfx2/source/appl/app.cxx | 2 sfx2/source/appl/appdata.cxx | 2 sfx2/source/appl/appdispatchprovider.cxx | 6 sfx2/source/appl/appinit.cxx | 4 sfx2/source/appl/appmisc.cxx | 2 sfx2/source/appl/appopen.cxx | 36 +-- sfx2/source/appl/appserv.cxx | 68 +++--- sfx2/source/appl/appuno.cxx | 56 ++-- sfx2/source/appl/childwin.cxx | 4 sfx2/source/appl/fileobj.cxx | 4 sfx2/source/appl/helpinterceptor.cxx | 2 sfx2/source/appl/impldde.cxx | 12 - sfx2/source/appl/linkmgr2.cxx | 4 sfx2/source/appl/lnkbase2.cxx | 2 sfx2/source/appl/macroloader.cxx | 8 sfx2/source/appl/newhelp.cxx | 182 ++++++++-------- sfx2/source/appl/newhelp.hxx | 8 sfx2/source/appl/sfxhelp.cxx | 36 +-- sfx2/source/appl/shutdownicon.cxx | 18 - sfx2/source/appl/workwin.cxx | 2 sfx2/source/appl/xpackcreator.cxx | 4 sfx2/source/bastyp/fltfnc.cxx | 20 - sfx2/source/bastyp/frmhtmlw.cxx | 18 - sfx2/source/bastyp/helper.cxx | 8 sfx2/source/bastyp/sfxhtml.cxx | 2 sfx2/source/commandpopup/CommandPopup.cxx | 11 sfx2/source/config/evntconf.cxx | 2 sfx2/source/control/bindings.cxx | 2 sfx2/source/control/charmapcontrol.cxx | 16 - sfx2/source/control/charwin.cxx | 13 - sfx2/source/control/dispatch.cxx | 18 - sfx2/source/control/listview.cxx | 8 sfx2/source/control/recentdocsviewitem.cxx | 10 sfx2/source/control/request.cxx | 2 sfx2/source/control/statcach.cxx | 2 sfx2/source/control/templatedefaultview.cxx | 4 sfx2/source/control/templatedlglocalview.cxx | 46 ++-- sfx2/source/control/templatelocalview.cxx | 2 sfx2/source/control/thumbnailview.cxx | 8 sfx2/source/control/thumbnailviewacc.cxx | 8 sfx2/source/control/thumbnailviewitem.cxx | 2 sfx2/source/control/unoctitm.cxx | 2 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx | 16 - sfx2/source/devtools/DocumentModelTreeHandler.cxx | 10 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx | 25 +- sfx2/source/devtools/ObjectInspectorWidgets.cxx | 18 - sfx2/source/dialog/StyleList.cxx | 50 ++-- sfx2/source/dialog/alienwarn.cxx | 11 sfx2/source/dialog/backingcomp.cxx | 24 +- sfx2/source/dialog/backingwindow.cxx | 92 ++++---- sfx2/source/dialog/backingwindow.hxx | 2 sfx2/source/dialog/basedlgs.cxx | 8 sfx2/source/dialog/charmappopup.cxx | 4 sfx2/source/dialog/checkin.cxx | 8 sfx2/source/dialog/dinfdlg.cxx | 204 +++++++++--------- sfx2/source/dialog/documentfontsdialog.cxx | 36 +-- sfx2/source/dialog/filedlghelper.cxx | 142 ++++++------ sfx2/source/dialog/filtergrouping.cxx | 4 sfx2/source/dialog/infobar.cxx | 20 - sfx2/source/dialog/inputdlg.cxx | 12 - sfx2/source/dialog/mailmodel.cxx | 28 +- sfx2/source/dialog/mgetempl.cxx | 24 +- sfx2/source/dialog/navigat.cxx | 2 sfx2/source/dialog/newstyle.cxx | 6 sfx2/source/dialog/partwnd.cxx | 2 sfx2/source/dialog/passwd.cxx | 40 +-- sfx2/source/dialog/printopt.cxx | 86 +++---- sfx2/source/dialog/recfloat.cxx | 6 sfx2/source/dialog/securitypage.cxx | 10 sfx2/source/dialog/srchdlg.cxx | 18 - sfx2/source/dialog/styledlg.cxx | 4 sfx2/source/dialog/tabdlg.cxx | 16 - sfx2/source/dialog/templdlg.cxx | 92 ++++---- sfx2/source/dialog/versdlg.cxx | 40 +-- sfx2/source/doc/DocumentMetadataAccess.cxx | 142 ++++++------ sfx2/source/doc/DocumentSigner.cxx | 4 sfx2/source/doc/Metadatable.cxx | 22 - sfx2/source/doc/QuerySaveDocument.cxx | 5 sfx2/source/doc/SfxDocumentMetaData.cxx | 190 ++++++++-------- sfx2/source/doc/SfxRedactionHelper.cxx | 69 +++--- sfx2/source/doc/autoredactdialog.cxx | 56 ++-- sfx2/source/doc/docfac.cxx | 20 - sfx2/source/doc/docfile.cxx | 50 ++-- sfx2/source/doc/docfilt.cxx | 14 - sfx2/source/doc/docinf.cxx | 4 sfx2/source/doc/doctempl.cxx | 10 sfx2/source/doc/doctemplates.cxx | 38 +-- sfx2/source/doc/doctemplateslocal.cxx | 8 sfx2/source/doc/graphhelp.cxx | 6 sfx2/source/doc/guisaveas.cxx | 144 ++++++------ sfx2/source/doc/iframe.cxx | 16 - sfx2/source/doc/new.cxx | 28 +- sfx2/source/doc/objmisc.cxx | 26 +- sfx2/source/doc/objserv.cxx | 86 +++---- sfx2/source/doc/objstor.cxx | 70 +++--- sfx2/source/doc/objxtor.cxx | 8 sfx2/source/doc/ownsubfilterservice.cxx | 4 sfx2/source/doc/printhelper.cxx | 16 - sfx2/source/doc/saveastemplatedlg.cxx | 10 sfx2/source/doc/sfxbasemodel.cxx | 126 +++++------ sfx2/source/doc/sfxmodelfactory.cxx | 6 sfx2/source/doc/templatedlg.cxx | 64 ++--- sfx2/source/doc/watermarkitem.cxx | 4 sfx2/source/explorer/nochaos.cxx | 2 sfx2/source/inet/inettbc.cxx | 14 - sfx2/source/notebookbar/NotebookbarTabControl.cxx | 6 sfx2/source/notebookbar/SfxNotebookBar.cxx | 16 - sfx2/source/notify/globalevents.cxx | 10 sfx2/source/safemode/safemode.cxx | 19 - sfx2/source/sidebar/Deck.cxx | 8 sfx2/source/sidebar/DeckTitleBar.cxx | 8 sfx2/source/sidebar/Panel.cxx | 6 sfx2/source/sidebar/PanelTitleBar.cxx | 4 sfx2/source/sidebar/ResourceManager.cxx | 16 - sfx2/source/sidebar/Sidebar.cxx | 2 sfx2/source/sidebar/SidebarController.cxx | 36 +-- sfx2/source/sidebar/TabBar.cxx | 36 +-- sfx2/source/sidebar/Theme.cxx | 30 +- sfx2/source/sidebar/TitleBar.cxx | 8 sfx2/source/sidebar/Tools.cxx | 2 sfx2/source/sidebar/UnoSidebar.cxx | 2 sfx2/source/sidebar/uiobject.cxx | 10 sfx2/source/toolbox/tbxitem.cxx | 2 sfx2/source/view/classificationcontroller.cxx | 18 - sfx2/source/view/classificationhelper.cxx | 78 +++--- sfx2/source/view/frame2.cxx | 24 +- sfx2/source/view/frmload.cxx | 92 ++++---- sfx2/source/view/ipclient.cxx | 8 sfx2/source/view/lokhelper.cxx | 6 sfx2/source/view/lokstarmathhelper.cxx | 2 sfx2/source/view/printer.cxx | 4 sfx2/source/view/sfxbasecontroller.cxx | 18 - sfx2/source/view/viewfac.cxx | 2 sfx2/source/view/viewfrm.cxx | 60 ++--- sfx2/source/view/viewfrm2.cxx | 2 sfx2/source/view/viewprn.cxx | 24 +- sfx2/source/view/viewsh.cxx | 44 +-- 145 files changed, 1858 insertions(+), 1849 deletions(-)
New commits: commit ca5c9591ba38ad83415a2d4ced98bfc74d30b032 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri May 10 13:18:37 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri May 10 18:42:35 2024 +0200 loplugin:ostr in sfx2 Change-Id: I6306260d03c1208ec250c2f9a3860fa569f6d9c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167448 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 0805e55264e7..0a7f653b0180 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -105,8 +105,8 @@ private: public: SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet, - const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"), - const OUString& rID = OUString("SingleTabDialog")); + const OUString& rUIXMLDescription = u"sfx/ui/singletabdialog.ui"_ustr, + const OUString& rID = u"SingleTabDialog"_ustr); SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet, const OUString& rContainerId, const OUString& rUIXMLDescription, diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx index d367daa8bb3e..d61981b44de8 100644 --- a/include/sfx2/tplpitem.hxx +++ b/include/sfx2/tplpitem.hxx @@ -34,7 +34,7 @@ public: SfxTemplateItem(); SfxTemplateItem( sal_uInt16 nWhich, OUString aStyle, - OUString aStyleIdentifier = "" ); + OUString aStyleIdentifier = u""_ustr ); const OUString& GetStyleName() const { return aStyle; } const OUString& GetStyleIdentifier() const { return aStyleIdentifier; } diff --git a/sfx2/inc/preventduplicateinteraction.hxx b/sfx2/inc/preventduplicateinteraction.hxx index b4015d0f7040..9d53141516bd 100644 --- a/sfx2/inc/preventduplicateinteraction.hxx +++ b/sfx2/inc/preventduplicateinteraction.hxx @@ -99,7 +99,7 @@ public: { SolarMutexGuard aSolarGuard; m_xWin = VclPtr<WorkWindow>::Create(nullptr, WB_STDWORK); - m_xWin->SetText("dialog parent for warning dialogs during load"); + m_xWin->SetText(u"dialog parent for warning dialogs during load"_ustr); m_xInterface = VCLUnoHelper::GetInterface(m_xWin); } diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx index 9eea6d29390d..555c5f5aea78 100644 --- a/sfx2/qa/cppunit/doc.cxx +++ b/sfx2/qa/cppunit/doc.cxx @@ -31,7 +31,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sfx2/qa/cppunit/data/") + : UnoApiTest(u"/sfx2/qa/cppunit/data/"_ustr) { } }; @@ -39,9 +39,9 @@ public: CPPUNIT_TEST_FIXTURE(Test, testNoGrabBagShape) { // Load a document and select the first shape. - css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue("ReadOnly", - true) }; - mxComponent = loadFromDesktop("private:factory/simpress", "", aArgs); + css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( + u"ReadOnly"_ustr, true) }; + mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, u""_ustr, aArgs); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(xModel, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDrawPage( @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoGrabBagShape) CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) { // Create a test file in a directory that contains the URL-encoded "testÿ" string. - mxComponent = loadFromDesktop("private:factory/swriter"); + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); auto pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); OUString aTargetDir @@ -73,7 +73,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) osl::Directory::create(aTargetDir); OUString aTargetFile = aTargetDir + "/test.odt"; css::uno::Sequence<css::beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - "FilterName", OUString("writer8")) }; + u"FilterName"_ustr, u"writer8"_ustr) }; pBaseModel->storeAsURL(aTargetFile, aArgs); mxComponent->dispose(); @@ -82,7 +82,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); OUString aPdfTarget = aTargetDir + "/test.pdf"; css::uno::Sequence<css::beans::PropertyValue> aPdfArgs{ comphelper::makePropertyValue( - "FilterName", OUString("writer_pdf_Export")) }; + u"FilterName"_ustr, u"writer_pdf_Export"_ustr) }; // Without the accompanying fix in place, this test would have failed on Windows with: // An uncaught exception of type com.sun.star.io.IOException // because we first tried to create a temp file next to test.odt in a directory named @@ -93,16 +93,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTempFilePath) CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate) { // Given a document with 3 custom props, 2 Zotero ones and one other: - mxComponent = loadFromDesktop("private:factory/swriter"); + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); auto pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get()); CPPUNIT_ASSERT(pBaseModel); uno::Reference<document::XDocumentProperties> xDP = pBaseModel->getDocumentProperties(); uno::Reference<beans::XPropertyContainer> xUDP = xDP->getUserDefinedProperties(); - xUDP->addProperty("ZOTERO_PREF_1", beans::PropertyAttribute::REMOVABLE, - uno::Any(OUString("foo"))); - xUDP->addProperty("ZOTERO_PREF_2", beans::PropertyAttribute::REMOVABLE, - uno::Any(OUString("bar"))); - xUDP->addProperty("OTHER", beans::PropertyAttribute::REMOVABLE, uno::Any(OUString("baz"))); + xUDP->addProperty(u"ZOTERO_PREF_1"_ustr, beans::PropertyAttribute::REMOVABLE, + uno::Any(u"foo"_ustr)); + xUDP->addProperty(u"ZOTERO_PREF_2"_ustr, beans::PropertyAttribute::REMOVABLE, + uno::Any(u"bar"_ustr)); + xUDP->addProperty(u"OTHER"_ustr, beans::PropertyAttribute::REMOVABLE, uno::Any(u"baz"_ustr)); // When updating the Zotero ones (1 update, 1 removal): std::vector<beans::PropertyValue> aArgsVec = comphelper::JsonToPropertyValues(R"json( @@ -128,21 +128,21 @@ CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate) } )json"_ostr); uno::Sequence<beans::PropertyValue> aArgs = comphelper::containerToSequence(aArgsVec); - dispatchCommand(mxComponent, ".uno:SetDocumentProperties", aArgs); + dispatchCommand(mxComponent, u".uno:SetDocumentProperties"_ustr, aArgs); // Then make sure that OTHER is still there and that ZOTERO_PREF_1 + ZOTERO_PREF_2 gets updated // to the new value of a single ZOTERO_PREF_1: uno::Reference<beans::XPropertyAccess> xUDPAccess(xUDP, uno::UNO_QUERY); comphelper::SequenceAsHashMap aMap(xUDPAccess->getPropertyValues()); - auto it = aMap.find("ZOTERO_PREF_1"); + auto it = aMap.find(u"ZOTERO_PREF_1"_ustr); CPPUNIT_ASSERT(it != aMap.end()); // Without the accompanying fix in place, this test would have failed with: // - Expected: test // - Actual : foo // i.e. ZOTERO_PREF_1 was not updated. - CPPUNIT_ASSERT_EQUAL(OUString("test"), it->second.get<OUString>()); - CPPUNIT_ASSERT(bool(aMap.find("ZOTERO_PREF_2") == aMap.end())); - CPPUNIT_ASSERT(aMap.find("OTHER") != aMap.end()); + CPPUNIT_ASSERT_EQUAL(u"test"_ustr, it->second.get<OUString>()); + CPPUNIT_ASSERT(bool(aMap.find(u"ZOTERO_PREF_2"_ustr) == aMap.end())); + CPPUNIT_ASSERT(aMap.find(u"OTHER"_ustr) != aMap.end()); } } diff --git a/sfx2/qa/cppunit/test_classification.cxx b/sfx2/qa/cppunit/test_classification.cxx index ffa90089fd8d..d94d52ef5eb1 100644 --- a/sfx2/qa/cppunit/test_classification.cxx +++ b/sfx2/qa/cppunit/test_classification.cxx @@ -29,7 +29,7 @@ class ClassificationTest : public UnoApiTest public: ClassificationTest() - : UnoApiTest("/sfx2/qa/cppunit/data/") + : UnoApiTest(u"/sfx2/qa/cppunit/data/"_ustr) { } @@ -48,41 +48,41 @@ void ClassificationTest::testClassification() { uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( { - {"Name", uno::Any(OUString("Non-Business"))}, - {"Type", uno::Any(OUString("urn:bails:ExportControl:"))}, + {"Name", uno::Any(u"Non-Business"_ustr)}, + {"Type", uno::Any(u"urn:bails:ExportControl:"_ustr)}, })); - dispatchCommand(mxComponent, ".uno:ClassificationApply", aPropertyValues); + dispatchCommand(mxComponent, u".uno:ClassificationApply"_ustr, aPropertyValues); uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xDocumentPropertiesSupplier.is()); uno::Reference<document::XDocumentProperties> xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); uno::Reference<beans::XPropertySet> xPropertySet(xDocumentProperties->getUserDefinedProperties(), uno::UNO_QUERY); - uno::Any aAny = xPropertySet->getPropertyValue("urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier"); - CPPUNIT_ASSERT_EQUAL(OUString("urn:example:tscp:1:non-business"), aAny.get<OUString>()); + uno::Any aAny = xPropertySet->getPropertyValue(u"urn:bails:ExportControl:BusinessAuthorizationCategory:Identifier"_ustr); + CPPUNIT_ASSERT_EQUAL(u"urn:example:tscp:1:non-business"_ustr, aAny.get<OUString>()); aPropertyValues = comphelper::InitPropertySequence( { - {"Name", uno::Any(OUString("Confidential"))}, - {"Type", uno::Any(OUString("urn:bails:NationalSecurity:"))}, + {"Name", uno::Any(u"Confidential"_ustr)}, + {"Type", uno::Any(u"urn:bails:NationalSecurity:"_ustr)}, }); - dispatchCommand(mxComponent, ".uno:ClassificationApply", aPropertyValues); - aAny = xPropertySet->getPropertyValue("urn:bails:NationalSecurity:BusinessAuthorizationCategory:Identifier"); - CPPUNIT_ASSERT_EQUAL(OUString("urn:example:tscp:1:confidential"), aAny.get<OUString>()); + dispatchCommand(mxComponent, u".uno:ClassificationApply"_ustr, aPropertyValues); + aAny = xPropertySet->getPropertyValue(u"urn:bails:NationalSecurity:BusinessAuthorizationCategory:Identifier"_ustr); + CPPUNIT_ASSERT_EQUAL(u"urn:example:tscp:1:confidential"_ustr, aAny.get<OUString>()); aPropertyValues = comphelper::InitPropertySequence( { - {"Name", uno::Any(OUString("Internal Only"))}, - {"Type", uno::Any(OUString("urn:bails:IntellectualProperty:"))}, + {"Name", uno::Any(u"Internal Only"_ustr)}, + {"Type", uno::Any(u"urn:bails:IntellectualProperty:"_ustr)}, }); - dispatchCommand(mxComponent, ".uno:ClassificationApply", aPropertyValues); - aAny = xPropertySet->getPropertyValue("urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier"); - CPPUNIT_ASSERT_EQUAL(OUString("urn:example:tscp:1:internal-only"), aAny.get<OUString>()); + dispatchCommand(mxComponent, u".uno:ClassificationApply"_ustr, aPropertyValues); + aAny = xPropertySet->getPropertyValue(u"urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier"_ustr); + CPPUNIT_ASSERT_EQUAL(u"urn:example:tscp:1:internal-only"_ustr, aAny.get<OUString>()); } void ClassificationTest::testWriter() { // Test SID_CLASSIFICATION_APPLY handling in SwDocShell::Execute(). - mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } @@ -90,7 +90,7 @@ void ClassificationTest::testWriter() void ClassificationTest::testCalc() { // Test SID_CLASSIFICATION_APPLY handling in ScFormatShell::ExecuteStyle(). - mxComponent = loadFromDesktop("private:factory/scalc", "com.sun.star.sheet.SpreadsheetDocument"); + mxComponent = loadFromDesktop(u"private:factory/scalc"_ustr, u"com.sun.star.sheet.SpreadsheetDocument"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } @@ -98,7 +98,7 @@ void ClassificationTest::testCalc() void ClassificationTest::testImpress() { // Test SID_CLASSIFICATION_APPLY handling in sd::DrawViewShell::FuTemporary(). - mxComponent = loadFromDesktop("private:factory/simpress", "com.sun.star.presentation.PresentationDocument"); + mxComponent = loadFromDesktop(u"private:factory/simpress"_ustr, u"com.sun.star.presentation.PresentationDocument"_ustr); // This resulted in a beans::UnknownPropertyException when the request wasn't handled. testClassification(); } diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx index 459f635d0056..8178717bce5e 100644 --- a/sfx2/qa/cppunit/test_metadatable.cxx +++ b/sfx2/qa/cppunit/test_metadatable.cxx @@ -83,13 +83,13 @@ void MetadatableTest::test() MockMetadatable m4(*pReg); MockMetadatable m5(*pReg); OUString empty; - OUString content( "content.xml" ); - OUString sid3( "id3" ); - OUString sid4( "id4" ); - beans::StringPair id1(content, "id1"); - beans::StringPair id2(content, "id2"); + OUString content( u"content.xml"_ustr ); + OUString sid3( u"id3"_ustr ); + OUString sid4( u"id4"_ustr ); + beans::StringPair id1(content, u"id1"_ustr); + beans::StringPair id2(content, u"id2"_ustr); beans::StringPair id3(content, sid3); - beans::StringPair id4("styles.xml", sid4); + beans::StringPair id4(u"styles.xml"_ustr, sid4); beans::StringPair id3e(empty, sid3); beans::StringPair id4e(empty, sid4); m1.SetMetadataReference(id1); diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx index d80a037f6f07..47c663a0246b 100644 --- a/sfx2/qa/cppunit/test_misc.cxx +++ b/sfx2/qa/cppunit/test_misc.cxx @@ -45,7 +45,7 @@ class MiscTest { public: MiscTest() - : UnoApiXmlTest("/sfx2/qa/cppunit/misc/") + : UnoApiXmlTest(u"/sfx2/qa/cppunit/misc/"_ustr) { } @@ -68,19 +68,19 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testODFCustomMetadata) OUString const url(m_directories.getURLFromSrc(u"/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt")); xProps->loadFromMedium(url, uno::Sequence<beans::PropertyValue>()); - CPPUNIT_ASSERT_EQUAL(OUString(""), xProps->getAuthor()); + CPPUNIT_ASSERT_EQUAL(u""_ustr, xProps->getAuthor()); uno::Sequence<beans::PropertyValue> mimeArgs({ - beans::PropertyValue("MediaType", -1, uno::Any(OUString("application/vnd.oasis.opendocument.text")), beans::PropertyState_DIRECT_VALUE) + beans::PropertyValue(u"MediaType"_ustr, -1, uno::Any(u"application/vnd.oasis.opendocument.text"_ustr), beans::PropertyState_DIRECT_VALUE) }); xProps->storeToMedium(maTempFile.GetURL(), mimeArgs); // check that custom metadata is preserved - xmlDocUniquePtr pXmlDoc = parseExport("meta.xml"); - assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/bork"_ostr, "bork"); + xmlDocUniquePtr pXmlDoc = parseExport(u"meta.xml"_ustr); + assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/bork"_ostr, u"bork"_ustr); assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar"_ostr, 1); assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar/baz:foo"_ostr, 1); assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar/baz:foo[@baz:bar='foo']"_ostr); - assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/foo:bar/foo:baz"_ostr, "bar"); + assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/foo:bar/foo:baz"_ostr, u"bar"_ustr); } CPPUNIT_TEST_FIXTURE(MiscTest, testNoThumbnail) @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testNoThumbnail) xStorable->storeToURL(maTempFile.GetURL(), aProperties); uno::Reference<packages::zip::XZipFileAccess2> xZipFile = packages::zip::ZipFileAccess::createWithURL(m_xContext, maTempFile.GetURL()); - CPPUNIT_ASSERT(!xZipFile->hasByName("Thumbnails/thumbnail.png")); + CPPUNIT_ASSERT(!xZipFile->hasByName(u"Thumbnails/thumbnail.png"_ustr)); #ifndef _WIN32 // Check permissions of the URL after store. @@ -141,7 +141,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testHardLinks) int nRet = link(aOld.getStr(), aNew.getStr()); CPPUNIT_ASSERT_EQUAL(0, nRet); - mxComponent = loadFromDesktop(aURL, "com.sun.star.text.TextDocument"); + mxComponent = loadFromDesktop(aURL, u"com.sun.star.text.TextDocument"_ustr); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->store(); @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testOverwrite) { // tdf#60237 - try to overwrite an existing file using the different settings of the Overwrite option mxComponent - = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument"); + = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xStorable.is()); diff --git a/sfx2/qa/cppunit/view.cxx b/sfx2/qa/cppunit/view.cxx index 725cb5d02cea..e0e8c69b2a36 100644 --- a/sfx2/qa/cppunit/view.cxx +++ b/sfx2/qa/cppunit/view.cxx @@ -27,7 +27,7 @@ class Sfx2ViewTest : public UnoApiTest { public: Sfx2ViewTest() - : UnoApiTest("/sfx2/qa/cppunit/data/") + : UnoApiTest(u"/sfx2/qa/cppunit/data/"_ustr) { } }; @@ -50,7 +50,7 @@ CPPUNIT_TEST_FIXTURE(Sfx2ViewTest, testReloadPage) uno::Reference<drawing::XDrawView> xController(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPage(xController->getCurrentPage(), uno::UNO_QUERY); sal_Int32 nPage{}; - xPage->getPropertyValue("Number") >>= nPage; + xPage->getPropertyValue(u"Number"_ustr) >>= nPage; // Without the accompanying fix in place, this test would have failed with: // - Expected: 2 diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index b37da185d3f2..3f3191a29a1f 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -129,7 +129,7 @@ SfxApplication* SfxApplication::GetOrCreate() SfxApplication::SfxApplication() : pImpl( new SfxAppData_Impl ) { - SetName( "StarOffice" ); + SetName( u"StarOffice"_ustr ); SAL_INFO( "sfx.appl", "{ initialize DDE" ); diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx index 819d7037824f..06d524c9330b 100644 --- a/sfx2/source/appl/appdata.cxx +++ b/sfx2/source/appl/appdata.cxx @@ -120,7 +120,7 @@ void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& _rBasicMan // global constants, additionally to the ones already added by createApplicationBasicManager: // ThisComponent Reference< XInterface > xCurrentComponent = SfxObjectShell::GetCurrentComponent(); - _rBasicManager.SetGlobalUNOConstant( "ThisComponent", css::uno::Any( xCurrentComponent ) ); + _rBasicManager.SetGlobalUNOConstant( u"ThisComponent"_ustr, css::uno::Any( xCurrentComponent ) ); #endif } diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx index 363aa391d568..9cdc6f21ba25 100644 --- a/sfx2/source/appl/appdispatchprovider.cxx +++ b/sfx2/source/appl/appdispatchprovider.cxx @@ -80,7 +80,7 @@ void SfxAppDispatchProvider::initialize( css::uno::Reference<css::frame::XFrame> f; if (aArguments.getLength() != 1 || !(aArguments[0] >>= f)) { throw css::lang::IllegalArgumentException( - "SfxAppDispatchProvider::initialize expects one XFrame argument", + u"SfxAppDispatchProvider::initialize expects one XFrame argument"_ustr, getXWeak(), 0); } m_xFrame = f; @@ -88,7 +88,7 @@ void SfxAppDispatchProvider::initialize( OUString SAL_CALL SfxAppDispatchProvider::getImplementationName() { - return "com.sun.star.comp.sfx2.AppDispatchProvider"; + return u"com.sun.star.comp.sfx2.AppDispatchProvider"_ustr; } sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServiceName ) @@ -98,7 +98,7 @@ sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServ css::uno::Sequence< OUString > SAL_CALL SfxAppDispatchProvider::getSupportedServiceNames() { - return { "com.sun.star.frame.ProtocolHandler", "com.sun.star.frame.AppDispatchProvider" }; + return { u"com.sun.star.frame.ProtocolHandler"_ustr, u"com.sun.star.frame.AppDispatchProvider"_ustr }; } Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch( diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 78e938462833..3704a31ea994 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -105,7 +105,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a OUString SAL_CALL SfxTerminateListener_Impl::getImplementationName() { - return "com.sun.star.comp.sfx2.SfxTerminateListener"; + return u"com.sun.star.comp.sfx2.SfxTerminateListener"_ustr; } sal_Bool SAL_CALL SfxTerminateListener_Impl::supportsService( const OUString& sServiceName ) @@ -121,7 +121,7 @@ Sequence< OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServiceName // The desktop must know, which listener will terminate the SfxApplication in real ! // It must call this special listener as last one ... otherwise we shutdown the SfxApplication BEFORE other listener // can react ... - return { "com.sun.star.frame.TerminateListener" }; + return { u"com.sun.star.frame.TerminateListener"_ustr }; } diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index cb793022a62f..7e11a74b5464 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -113,7 +113,7 @@ static bool FileExists( const INetURLObject& rURL ) ::ucbhelper::Content aCnt( rURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); OUString aTitle; - aCnt.getPropertyValue("Title") >>= aTitle; + aCnt.getPropertyValue(u"Title"_ustr) >>= aTitle; bRet = ( !aTitle.isEmpty() ); } catch(const Exception&) diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 7ea6fca57d8d..c627056160c4 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -155,7 +155,7 @@ private: if (!m_rMedium.TryEncryptedInnerPackage(mxStorage)) { // ... old ODF encryption: mxStorage->openStreamElement( - "content.xml", + u"content.xml"_ustr, embed::ElementModes::READ | embed::ElementModes::NOCREATE ); } @@ -203,9 +203,9 @@ ErrCode CheckPasswd_Impl bool bIsEncrypted = false; uno::Sequence< uno::Sequence< beans::NamedValue > > aGpgProperties; try { - xStorageProps->getPropertyValue("HasEncryptedEntries") + xStorageProps->getPropertyValue(u"HasEncryptedEntries"_ustr) >>= bIsEncrypted; - xStorageProps->getPropertyValue("EncryptionGpGProperties") + xStorageProps->getPropertyValue(u"EncryptionGpGProperties"_ustr) >>= aGpgProperties; } catch( uno::Exception& ) { @@ -252,7 +252,7 @@ ErrCode CheckPasswd_Impl { aEncryptionData = comphelper::concatSequences( aEncryptionData, std::initializer_list<beans::NamedValue>{ - { "ForSalvage", css::uno::Any(true) } }); + { u"ForSalvage"_ustr, css::uno::Any(true) } }); } SfxDocPasswordVerifier aVerifier(*pFile); @@ -324,8 +324,8 @@ ErrCodeMsg SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStrin { DBG_ASSERT( !xDoc.Is(), "Sorry, not implemented!" ); SfxStringItem aName( SID_FILE_NAME, rFileName ); - SfxStringItem aReferer( SID_REFERER, "private:user" ); - SfxStringItem aFlags( SID_OPTIONS, "T" ); + SfxStringItem aReferer( SID_REFERER, u"private:user"_ustr ); + SfxStringItem aFlags( SID_OPTIONS, u"T"_ustr ); SfxBoolItem aHidden( SID_HIDDEN, true ); const SfxPoolItemHolder aRet(GetDispatcher_Impl()->ExecuteList( SID_OPENDOC, SfxCallMode::SYNCHRON, @@ -424,7 +424,7 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq ) SfxRequest aReq( SID_OPENDOC, SfxCallMode::SYNCHRON, GetPool() ); aReq.AppendItem( SfxStringItem( SID_FILE_NAME, "private:factory/" + aFactName ) ); aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) ); - aReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) ); + aReq.AppendItem( SfxStringItem( SID_TARGETNAME, u"_default"_ustr ) ); // TODO/LATER: Should the other arguments be transferred as well? const SfxStringItem* pDefaultPathItem = rReq.GetArg<SfxStringItem>(SID_DEFAULTFILEPATH); @@ -535,8 +535,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) { SfxCallMode eMode = SfxCallMode::SYNCHRON; SfxPoolItemHolder aResult; - SfxStringItem aReferer( SID_REFERER, "private:user" ); - SfxStringItem aTarget( SID_TARGETNAME, "_default" ); + SfxStringItem aReferer( SID_REFERER, u"private:user"_ustr ); + SfxStringItem aTarget( SID_TARGETNAME, u"_default"_ustr ); if ( !aTemplateFileName.isEmpty() ) { DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Illegal URL!" ); @@ -549,7 +549,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) } else { - SfxStringItem aName( SID_FILE_NAME, "private:factory" ); + SfxStringItem aName( SID_FILE_NAME, u"private:factory"_ustr ); aResult = GetDispatcher_Impl()->ExecuteList(SID_OPENDOC, eMode, { &aName, &aTarget, &aReferer } ); } @@ -670,8 +670,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) rReq.SetArgs( *pSet ); if ( !aFilter.isEmpty() ) rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) ); - rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, u"_default"_ustr ) ); + rReq.AppendItem( SfxStringItem( SID_REFERER, u"private:user"_ustr ) ); pSet.reset(); if(!aURLList.empty()) @@ -825,7 +825,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( bHyperlinkUsed && !aFileName.isEmpty() && aFileName[0] != '#' ) { uno::Reference<document::XTypeDetection> xTypeDetection( - comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), UNO_QUERY); + comphelper::getProcessServiceFactory()->createInstance(u"com.sun.star.document.TypeDetection"_ustr), UNO_QUERY); if ( xTypeDetection.is() ) { @@ -869,7 +869,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // don't dispatch mailto hyperlink to desktop dispatcher rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_self" ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, u"_self"_ustr ) ); } else if ( aINetProtocol == INetProtocol::Ftp || aINetProtocol == INetProtocol::Http || @@ -882,7 +882,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // check for "internal" protocols that should not be forwarded to the system // add special protocols that always should be treated as internal - std::vector < OUString > aProtocols { "private:*", "vnd.sun.star.*" }; + std::vector < OUString > aProtocols { u"private:*"_ustr, u"vnd.sun.star.*"_ustr }; // get registered protocol handlers from configuration Reference < XNameAccess > xAccess(officecfg::Office::ProtocolHandler::HandlerSet::get()); @@ -895,7 +895,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) if ( xSet.is() ) { // copy protocols - aRet = xSet->getPropertyValue("Protocols"); + aRet = xSet->getPropertyValue(u"Protocols"_ustr); Sequence < OUString > aTmp; aRet >>= aTmp; @@ -925,7 +925,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) catch ( css::system::SystemShellExecuteException& ) { rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, u"_default"_ustr ) ); bLoadInternal = true; } if ( !bLoadInternal ) @@ -937,7 +937,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) { // hyperlink document must be loaded into a new frame rReq.RemoveItem( SID_TARGETNAME ); - rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) ); + rReq.AppendItem( SfxStringItem( SID_TARGETNAME, u"_default"_ustr ) ); } } } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index b7fa6c9f608f..28a3b325cc2a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -129,17 +129,17 @@ namespace switch ( eApp ) { case vcl::EnumContext::Application::Writer: - return "Writer"; + return u"Writer"_ustr; case vcl::EnumContext::Application::Calc: - return "Calc"; + return u"Calc"_ustr; case vcl::EnumContext::Application::Impress: - return "Impress"; + return u"Impress"_ustr; case vcl::EnumContext::Application::Draw: - return "Draw"; + return u"Draw"_ustr; case vcl::EnumContext::Application::Formula: - return "Formula"; + return u"Formula"_ustr; case vcl::EnumContext::Application::Base: - return "Base"; + return u"Base"_ustr; default: return OUString(); } @@ -173,7 +173,7 @@ namespace using namespace org::freedesktop::PackageKit; using namespace svtools; Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); - Sequence< OUString > vPackages { "libreoffice-base" }; + Sequence< OUString > vPackages { u"libreoffice-base"_ustr }; xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString()); // I'll be back (hopefully)! SolarMutexGuard aGuard; @@ -189,9 +189,9 @@ namespace try // fdo#48775 { - SfxStringItem aURL(SID_FILE_NAME, ".component:Bibliography/View1"); - SfxStringItem aRef(SID_REFERER, "private:user"); - SfxStringItem aTarget(SID_TARGETNAME, "_blank"); + SfxStringItem aURL(SID_FILE_NAME, u".component:Bibliography/View1"_ustr); + SfxStringItem aRef(SID_REFERER, u"private:user"_ustr); + SfxStringItem aTarget(SID_TARGETNAME, u"_blank"_ustr); if (const SfxViewFrame* pViewFrame = SfxViewFrame::Current()) { pViewFrame->GetDispatcher()->ExecuteList(SID_OPENDOC, @@ -269,7 +269,7 @@ static void showDocument( const char* pBaseName ) if ( checkURL ( pBaseName, ".fodt", aURL ) || checkURL ( pBaseName, ".html", aURL ) || checkURL ( pBaseName, "", aURL ) ) { - xDesktop->loadComponentFromURL( aURL, "_blank", 0, args ); + xDesktop->loadComponentFromURL( aURL, u"_blank"_ustr, 0, args ); } } catch (const css::uno::Exception &) { } @@ -300,7 +300,7 @@ namespace { public: LicenseDialog(weld::Window* pParent) - : GenericDialogController(pParent, "sfx/ui/licensedialog.ui", "LicenseDialog") + : GenericDialogController(pParent, u"sfx/ui/licensedialog.ui"_ustr, u"LicenseDialog"_ustr) { } @@ -317,7 +317,7 @@ namespace { public: SafeModeQueryDialog(weld::Window* pParent) - : MessageDialogController(pParent, "sfx/ui/safemodequerydialog.ui", "SafeModeQueryDialog") + : MessageDialogController(pParent, u"sfx/ui/safemodequerydialog.ui"_ustr, u"SafeModeQueryDialog"_ustr) { } @@ -396,8 +396,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) return; } - SfxStringItem aNameItem( SID_FILE_NAME, "vnd.sun.star.cmd:logout" ); - SfxStringItem aReferer( SID_REFERER, "private/user" ); + SfxStringItem aNameItem( SID_FILE_NAME, u"vnd.sun.star.cmd:logout"_ustr ); + SfxStringItem aReferer( SID_REFERER, u"private/user"_ustr ); pImpl->pAppDispat->ExecuteList(SID_OPENDOC, SfxCallMode::SLOT, { &aNameItem, &aReferer }); return; @@ -456,12 +456,12 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) else if (rReq.GetSlot() == SID_CONFIGEVENT) { aSet.Put( SfxStringItem( - SID_CONFIG, "private:resource/event/" ) ); + SID_CONFIG, u"private:resource/event/"_ustr ) ); } else if (rReq.GetSlot() == SID_TOOLBOXOPTIONS) { aSet.Put( SfxStringItem( - SID_CONFIG, "private:resource/toolbar/" ) ); + SID_CONFIG, u"private:resource/toolbar/"_ustr ) ); } #if HAVE_FEATURE_SCRIPTING @@ -621,7 +621,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { const SfxStringItem* pNewThemeArg = rReq.GetArg<SfxStringItem>(FN_PARAM_NEW_THEME); OUString sSchemeName - = pNewThemeArg ? pNewThemeArg->GetValue() : "COLOR_SCHEME_LIBREOFFICE_AUTOMATIC"; + = pNewThemeArg ? pNewThemeArg->GetValue() : u"COLOR_SCHEME_LIBREOFFICE_AUTOMATIC"_ustr; if (!pNewThemeArg) { // toggle between light and dark mode @@ -680,7 +680,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help* pHelp = Application::GetHelp(); if ( pHelp ) { - pHelp->Start(".uno:HelpIndex", rReq.GetFrameWeld()); // show start page + pHelp->Start(u".uno:HelpIndex"_ustr, rReq.GetFrameWeld()); // show start page bDone = true; } break; @@ -938,7 +938,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { try { - Any aValue = xPropSet->getPropertyValue( "LayoutManager" ); + Any aValue = xPropSet->getPropertyValue( u"LayoutManager"_ustr ); aValue >>= xLayoutManager; } catch ( const css::uno::RuntimeException& ) @@ -1002,8 +1002,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { OUString aResName; sal_Int16 nType( -1 ); - xPropertySet->getPropertyValue( "Type" ) >>= nType; - xPropertySet->getPropertyValue( "ResourceURL" ) >>= aResName; + xPropertySet->getPropertyValue( u"Type"_ustr ) >>= nType; + xPropertySet->getPropertyValue( u"ResourceURL"_ustr ) >>= aResName; if (( nType == css::ui::UIElementType::TOOLBAR ) && !aResName.isEmpty() ) @@ -1120,7 +1120,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { try { - Any aValue = xPropSet->getPropertyValue("LayoutManager"); + Any aValue = xPropSet->getPropertyValue(u"LayoutManager"_ustr); aValue >>= xLayoutManager; } catch ( const css::uno::RuntimeException& ) @@ -1206,7 +1206,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create(xContext); const utl::OConfigurationTreeRoot aAppNode( - xContext, "org.openoffice.Office.UI.GlobalSettings/Toolbars/States", true); + xContext, u"org.openoffice.Office.UI.GlobalSettings/Toolbars/States"_ustr, true); if (aAppNode.isValid()) { bool isLocked = comphelper::getBOOL(aAppNode.getNodeValue("Locked")); @@ -1362,7 +1362,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) { try { - Any aValue = xPropSet->getPropertyValue("LayoutManager"); + Any aValue = xPropSet->getPropertyValue(u"LayoutManager"_ustr); aValue >>= xLayoutManager; } catch ( const css::uno::RuntimeException& ) @@ -1377,9 +1377,9 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) if ( xLayoutManager.is() ) { const bool bState - = xLayoutManager->getElement("private:resource/menubar/menubar").is() + = xLayoutManager->getElement(u"private:resource/menubar/menubar"_ustr).is() && xLayoutManager->isElementVisible( - "private:resource/menubar/menubar"); + u"private:resource/menubar/menubar"_ustr); SfxBoolItem aItem( SID_MENUBAR, bState ); rSet.Put( aItem ); @@ -1597,8 +1597,8 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_MORE_DICTIONARIES: { uno::Sequence<beans::PropertyValue> aArgs{ comphelper::makePropertyValue( - "AdditionsTag", OUString("Dictionary")) }; - comphelper::dispatchCommand(".uno:AdditionsDialog", aArgs); + u"AdditionsTag"_ustr, u"Dictionary"_ustr) }; + comphelper::dispatchCommand(u".uno:AdditionsDialog"_ustr, aArgs); break; } #if HAVE_FEATURE_SCRIPTING @@ -1607,7 +1607,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) SfxViewFrame* pView = lcl_getBasicIDEViewFrame( nullptr ); if ( !pView ) { - SfxObjectShell* pBasicIDE = SfxObjectShell::CreateObject( "com.sun.star.script.BasicIDE" ); + SfxObjectShell* pBasicIDE = SfxObjectShell::CreateObject( u"com.sun.star.script.BasicIDE"_ustr ); pBasicIDE->DoInitNew(); pBasicIDE->SetModified( false ); try @@ -1620,11 +1620,11 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) // mechanism, and the type detection (which doesn't know about the Basic IDE). Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XSynchronousFrameLoader > xLoader( - xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.office.FrameLoader", xContext), + xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.comp.office.FrameLoader"_ustr, xContext), UNO_QUERY_THROW ); ::comphelper::NamedValueCollection aLoadArgs; - aLoadArgs.put( "Model", pBasicIDE->GetModel() ); - aLoadArgs.put( "URL", OUString( "private:factory/sbasic" ) ); + aLoadArgs.put( u"Model"_ustr, pBasicIDE->GetModel() ); + aLoadArgs.put( u"URL"_ustr, u"private:factory/sbasic"_ustr ); Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( xContext ) ); if ( !xTargetFrame.is() ) @@ -1640,7 +1640,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) pView = lcl_getBasicIDEViewFrame( pBasicIDE ); if ( pView ) - pView->SetName( "BASIC:1" ); + pView->SetName( u"BASIC:1"_ustr ); } if ( pView ) diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 75104462e777..6c0ba8c053bc 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -60,37 +60,37 @@ using namespace ::com::sun::star::io; // needs to be converted to a better data structure SfxFormalArgument const aFormalArgs[] = { - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "SuggestedSaveAsName", SID_DEFAULTFILENAME }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "SuggestedSaveAsDir", SID_DEFAULTFILEPATH }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "VersionAuthor", SID_DOCINFO_AUTHOR }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "VersionComment", SID_DOCINFO_COMMENTS }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "DontTerminateEdit", FN_PARAM_1 }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "VersionMajor", SID_DOCINFO_MAJOR }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "FilterOptions", SID_FILE_FILTEROPTIONS }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "FilterName", SID_FILTER_NAME }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Margin1", SID_RULER_MARGIN1 }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Margin2", SID_RULER_MARGIN2 }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"SuggestedSaveAsName"_ustr, SID_DEFAULTFILENAME }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"SuggestedSaveAsDir"_ustr, SID_DEFAULTFILEPATH }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"VersionAuthor"_ustr, SID_DOCINFO_AUTHOR }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"VersionComment"_ustr, SID_DOCINFO_COMMENTS }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"DontTerminateEdit"_ustr, FN_PARAM_1 }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"VersionMajor"_ustr, SID_DOCINFO_MAJOR }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"FilterOptions"_ustr, SID_FILE_FILTEROPTIONS }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"FilterName"_ustr, SID_FILTER_NAME }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"Margin1"_ustr, SID_RULER_MARGIN1 }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"Margin2"_ustr, SID_RULER_MARGIN2 }, // { static_cast<const SfxType*>(&aSfxStringItem_Impl), "FileName", SID_FILE_NAME }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "URL", SID_FILE_NAME }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "OpenFlags", SID_OPTIONS }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "Overwrite", SID_OVERWRITE }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Password", SID_PASSWORD }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "PasswordInteraction", SID_PASSWORDINTERACTION }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Referer", SID_REFERER }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "SaveTo", SID_SAVETO }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "TemplateName", SID_TEMPLATE_NAME }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "TemplateRegion", SID_TEMPLATE_REGIONNAME }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"URL"_ustr, SID_FILE_NAME }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"OpenFlags"_ustr, SID_OPTIONS }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"Overwrite"_ustr, SID_OVERWRITE }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"Password"_ustr, SID_PASSWORD }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"PasswordInteraction"_ustr, SID_PASSWORDINTERACTION }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"Referer"_ustr, SID_REFERER }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"SaveTo"_ustr, SID_SAVETO }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"TemplateName"_ustr, SID_TEMPLATE_NAME }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"TemplateRegion"_ustr, SID_TEMPLATE_REGIONNAME }, // { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Region", SID_TEMPLATE_REGIONNAME }, // { static_cast<const SfxType*>(&aSfxStringItem_Impl), "Name", SID_TEMPLATE_NAME }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "Unpacked", SID_UNPACK }, - { static_cast<const SfxType*>(&aSfxInt16Item_Impl), "Version", SID_VERSION }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "SaveACopy", SID_SAVEACOPYITEM }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "NoFileSync", SID_NO_FILE_SYNC }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "NoThumbnail", SID_NO_THUMBNAIL }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "NoEmbDataSet", SID_NO_EMBEDDED_DS }, - { static_cast<const SfxType*>(&aSfxBoolItem_Impl), "IsRedactMode", SID_IS_REDACT_MODE }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "RedactionStyle", SID_REDACTION_STYLE }, - { static_cast<const SfxType*>(&aSfxStringItem_Impl), "AdditionsTag", FN_PARAM_ADDITIONS_TAG }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"Unpacked"_ustr, SID_UNPACK }, + { static_cast<const SfxType*>(&aSfxInt16Item_Impl), u"Version"_ustr, SID_VERSION }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"SaveACopy"_ustr, SID_SAVEACOPYITEM }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"NoFileSync"_ustr, SID_NO_FILE_SYNC }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"NoThumbnail"_ustr, SID_NO_THUMBNAIL }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"NoEmbDataSet"_ustr, SID_NO_EMBEDDED_DS }, + { static_cast<const SfxType*>(&aSfxBoolItem_Impl), u"IsRedactMode"_ustr, SID_IS_REDACT_MODE }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"RedactionStyle"_ustr, SID_REDACTION_STYLE }, + { static_cast<const SfxType*>(&aSfxStringItem_Impl), u"AdditionsTag"_ustr, FN_PARAM_ADDITIONS_TAG }, }; sal_uInt16 const nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs); diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 9dd6da83d235..24b114a706b3 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -269,7 +269,7 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) { sal_uInt16 nID = GetType(); - OUString aInfoVisible = rInfo.bVisible ? OUString("V") : OUString("H"); + OUString aInfoVisible = rInfo.bVisible ? u"V"_ustr : u"H"_ustr; OUString aWinData = "V" + OUString::number(static_cast<sal_Int32>(nVersion)) @@ -290,7 +290,7 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) aWinOpt.SetWindowState(rInfo.aWinState); css::uno::Sequence < css::beans::NamedValue > aSeq - { { "Data", css::uno::Any(aWinData) } }; + { { u"Data"_ustr, css::uno::Any(aWinData) } }; aWinOpt.SetUserData( aSeq ); // ... but save status at runtime! diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 69d9abcb9fb6..2d4aa100d9d3 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -207,7 +207,7 @@ static OUString impl_getFilter( const OUString& _rURL ) try { css::uno::Reference< css::document::XTypeDetection > xTypeDetection( - ::comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.document.TypeDetection" ), + ::comphelper::getProcessServiceFactory()->createInstance( u"com.sun.star.document.TypeDetection"_ustr ), css::uno::UNO_QUERY ); if ( xTypeDetection.is() ) { @@ -238,7 +238,7 @@ static OUString impl_getFilter( const OUString& _rURL ) * property value (since? expected?) */ ::comphelper::SequenceAsHashMap lTypeProps( xTypeCont->getByName( sType ) ); sFilter = lTypeProps.getUnpackedValueOrDefault( - "PreferredFilter", OUString() ); + u"PreferredFilter"_ustr, OUString() ); } } } diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index a9ff76101510..b8e1e18bff33 100644 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -167,7 +167,7 @@ void SAL_CALL HelpInterceptor_Impl::setMasterDispatchProvider( const Reference< Sequence< OUString > SAL_CALL HelpInterceptor_Impl::getInterceptedURLs() { - Sequence<OUString> aURLList { "vnd.sun.star.help://*" }; + Sequence<OUString> aURLList { u"vnd.sun.star.help://*"_ustr }; return aURLList; } diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index c70cb4cb6a19..3fb402b4604d 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -61,11 +61,11 @@ public: } SvDDELinkEditDialog::SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const * pLink) - : GenericDialogController(pParent, "sfx/ui/linkeditdialog.ui", "LinkEditDialog") - , m_xEdDdeApp(m_xBuilder->weld_entry("app")) - , m_xEdDdeTopic(m_xBuilder->weld_entry("file")) - , m_xEdDdeItem(m_xBuilder->weld_entry("category")) - , m_xOKButton(m_xBuilder->weld_button("ok")) + : GenericDialogController(pParent, u"sfx/ui/linkeditdialog.ui"_ustr, u"LinkEditDialog"_ustr) + , m_xEdDdeApp(m_xBuilder->weld_entry(u"app"_ustr)) + , m_xEdDdeTopic(m_xBuilder->weld_entry(u"file"_ustr)) + , m_xEdDdeItem(m_xBuilder->weld_entry(u"category"_ustr)) + , m_xOKButton(m_xBuilder->weld_button(u"ok"_ustr)) { OUString sServer, sTopic, sItem; sfx2::LinkManager::GetDisplayNames( pLink, &sServer, &sTopic, &sItem ); @@ -195,7 +195,7 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink ) bool bSysTopic = false; if (!sTopic.equalsIgnoreAsciiCase("SYSTEM")) { - DdeConnection aTmp(sServer, "SYSTEM"); + DdeConnection aTmp(sServer, u"SYSTEM"_ustr); bSysTopic = !aTmp.GetError(); } diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 01a88afd355f..f041b28a12cc 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -512,7 +512,7 @@ SotClipboardFormatId LinkManager::RegisterStatusInfoId() if( nFormat == SotClipboardFormatId::NONE ) { nFormat = SotExchange::RegisterFormatName( - "StatusInfo from SvxInternalLink"); + u"StatusInfo from SvxInternalLink"_ustr); } return nFormat; } @@ -685,7 +685,7 @@ bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) SfxStringItem aName( SID_FILE_NAME, sTopic ); SfxBoolItem aMinimized(SID_MINIMIZED, true); SfxBoolItem aHidden(SID_HIDDEN, true); - SfxStringItem aTarget( SID_TARGETNAME, "_blank" ); + SfxStringItem aTarget( SID_TARGETNAME, u"_blank"_ustr ); SfxStringItem aReferer( SID_REFERER, sReferer ); SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode ); SfxBoolItem aReadOnly(SID_DOC_READONLY, false); diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index eea1751cd57e..4b4f297b62a7 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -586,7 +586,7 @@ void ImplDdeItem::AdviseLoop( bool bOpen ) // A connection is re-established if( SvBaseLinkObjectType::DdeExternal == pLink->GetObjType() ) { - pLink->GetObj()->AddDataAdvise( pLink, "text/plain;charset=utf-16", ADVISEMODE_NODATA ); + pLink->GetObj()->AddDataAdvise( pLink, u"text/plain;charset=utf-16"_ustr, ADVISEMODE_NODATA ); pLink->GetObj()->AddConnectAdvise( pLink ); } } diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index da9f83a2b7c1..778b98c6a6a7 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -55,7 +55,7 @@ SfxMacroLoader::SfxMacroLoader(const css::uno::Sequence< css::uno::Any >& aArgum OUString SAL_CALL SfxMacroLoader::getImplementationName() { - return "com.sun.star.comp.sfx2.SfxMacroLoader"; + return u"com.sun.star.comp.sfx2.SfxMacroLoader"_ustr; } sal_Bool SAL_CALL SfxMacroLoader::supportsService(OUString const & ServiceName) @@ -65,7 +65,7 @@ sal_Bool SAL_CALL SfxMacroLoader::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> SAL_CALL SfxMacroLoader::getSupportedServiceNames() { - return { "com.sun.star.frame.ProtocolHandler" }; + return { u"com.sun.star.frame.ProtocolHandler"_ustr }; } SfxObjectShell* SfxMacroLoader::GetObjectShell(const Reference <XFrame>& xFrame) @@ -280,7 +280,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, if ( bSetGlobalThisComponent ) { // document is executed via AppBASIC, adjust ThisComponent variable - pAppMgr->SetGlobalUNOConstant( "ThisComponent", Any( pDoc->GetModel() ), &aOldThisComponent ); + pAppMgr->SetGlobalUNOConstant( u"ThisComponent"_ustr, Any( pDoc->GetModel() ), &aOldThisComponent ); } // just to let the shell be alive @@ -301,7 +301,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, if ( bSetGlobalThisComponent ) { - pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); + pAppMgr->SetGlobalUNOConstant( u"ThisComponent"_ustr, aOldThisComponent ); } if ( bSetDocMacroMode ) diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 048cfd9538c4..c41e53457679 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -214,7 +214,7 @@ struct ContentEntry_Impl void ContentTabPage_Impl::InitRoot() { std::vector< OUString > aList = - SfxContentHelper::GetHelpTreeViewContents( "vnd.sun.star.hier://com.sun.star.help.TreeView/" ); + SfxContentHelper::GetHelpTreeViewContents( u"vnd.sun.star.hier://com.sun.star.help.TreeView/"_ustr ); for (const OUString & aRow : aList) { @@ -270,7 +270,7 @@ IMPL_LINK(ContentTabPage_Impl, ExpandingHdl, const weld::TreeIter&, rIter, bool) } else { - Any aAny( ::utl::UCBContentHelper::GetProperty( aURL, "TargetURL" ) ); + Any aAny( ::utl::UCBContentHelper::GetProperty( aURL, u"TargetURL"_ustr ) ); OUString sId; OUString aTargetURL; if ( aAny >>= aTargetURL ) @@ -325,9 +325,9 @@ HelpTabPage_Impl::~HelpTabPage_Impl() // class ContentTabPage_Impl --------------------------------------------- ContentTabPage_Impl::ContentTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_Impl* pIdxWin) - : HelpTabPage_Impl(pParent, pIdxWin, "HelpContentPage", - "sfx/ui/helpcontentpage.ui") - , m_xContentBox(m_xBuilder->weld_tree_view("content")) + : HelpTabPage_Impl(pParent, pIdxWin, u"HelpContentPage"_ustr, + u"sfx/ui/helpcontentpage.ui"_ustr) + , m_xContentBox(m_xBuilder->weld_tree_view(u"content"_ustr)) , m_xScratchIter(m_xContentBox->make_iterator()) , aOpenBookImage(BMP_HELP_CONTENT_BOOK_OPEN) , aClosedBookImage(BMP_HELP_CONTENT_BOOK_CLOSED) @@ -387,10 +387,10 @@ void IndexTabPage_Impl::SelectExecutableEntry() // class IndexTabPage_Impl ----------------------------------------------- IndexTabPage_Impl::IndexTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_Impl* pIdxWin) - : HelpTabPage_Impl(pParent, pIdxWin, "HelpIndexPage", "sfx/ui/helpindexpage.ui") - , m_xIndexEntry(m_xBuilder->weld_entry("termentry")) - , m_xIndexList(m_xBuilder->weld_tree_view("termlist")) - , m_xOpenBtn(m_xBuilder->weld_button("display")) + : HelpTabPage_Impl(pParent, pIdxWin, u"HelpIndexPage"_ustr, u"sfx/ui/helpindexpage.ui"_ustr) + , m_xIndexEntry(m_xBuilder->weld_entry(u"termentry"_ustr)) + , m_xIndexList(m_xBuilder->weld_tree_view(u"termlist"_ustr)) + , m_xOpenBtn(m_xBuilder->weld_button(u"display"_ustr)) , aFactoryIdle("sfx2 appl IndexTabPage_Impl Factory") , aAutoCompleteIdle("sfx2 appl IndexTabPage_Impl AutoComplete") , aKeywordTimer("sfx2::IndexTabPage_Impl aKeywordTimer") @@ -894,14 +894,14 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, ActivateHdl, weld::ComboBox&, bool) // class SearchTabPage_Impl ---------------------------------------------- SearchTabPage_Impl::SearchTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_Impl* pIdxWin) - : HelpTabPage_Impl(pParent, pIdxWin, "HelpSearchPage", - "sfx/ui/helpsearchpage.ui") - , m_xSearchED(m_xBuilder->weld_combo_box("search")) - , m_xSearchBtn(m_xBuilder->weld_button("find")) - , m_xFullWordsCB(m_xBuilder->weld_check_button("completewords")) - , m_xScopeCB(m_xBuilder->weld_check_button("headings")) - , m_xResultsLB(m_xBuilder->weld_tree_view("results")) - , m_xOpenBtn(m_xBuilder->weld_button("display")) + : HelpTabPage_Impl(pParent, pIdxWin, u"HelpSearchPage"_ustr, + u"sfx/ui/helpsearchpage.ui"_ustr) + , m_xSearchED(m_xBuilder->weld_combo_box(u"search"_ustr)) + , m_xSearchBtn(m_xBuilder->weld_button(u"find"_ustr)) + , m_xFullWordsCB(m_xBuilder->weld_check_button(u"completewords"_ustr)) + , m_xScopeCB(m_xBuilder->weld_check_button(u"headings"_ustr)) + , m_xResultsLB(m_xBuilder->weld_tree_view(u"results"_ustr)) + , m_xOpenBtn(m_xBuilder->weld_button(u"display"_ustr)) , xBreakIterator(vcl::unohelper::CreateBreakIterator()) { m_xResultsLB->set_size_request(m_xResultsLB->get_approximate_digit_width() * 30, @@ -1122,8 +1122,8 @@ IMPL_LINK(BookmarksTabPage_Impl, CommandHdl, const CommandEvent&, rCEvt, bool) if (rCEvt.GetCommand() != CommandEventId::ContextMenu) return false; - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xBookmarksBox.get(), "sfx/ui/bookmarkmenu.ui")); - std::unique_ptr<weld::Menu> xMenu = xBuilder->weld_menu("menu"); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xBookmarksBox.get(), u"sfx/ui/bookmarkmenu.ui"_ustr)); + std::unique_ptr<weld::Menu> xMenu = xBuilder->weld_menu(u"menu"_ustr); OUString sIdent = xMenu->popup_at_rect(m_xBookmarksBox.get(), ::tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))); if (!sIdent.isEmpty()) @@ -1145,10 +1145,10 @@ IMPL_LINK(BookmarksTabPage_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool) // class BookmarksTabPage_Impl ------------------------------------------- BookmarksTabPage_Impl::BookmarksTabPage_Impl(weld::Widget* pParent, SfxHelpIndexWindow_Impl* _pIdxWin) - : HelpTabPage_Impl(pParent, _pIdxWin, "HelpBookmarkPage", - "sfx/ui/helpbookmarkpage.ui") - , m_xBookmarksBox(m_xBuilder->weld_tree_view("bookmarks")) - , m_xBookmarksPB(m_xBuilder->weld_button("display")) + : HelpTabPage_Impl(pParent, _pIdxWin, u"HelpBookmarkPage"_ustr, + u"sfx/ui/helpbookmarkpage.ui"_ustr) + , m_xBookmarksBox(m_xBuilder->weld_tree_view(u"bookmarks"_ustr)) + , m_xBookmarksPB(m_xBuilder->weld_button(u"display"_ustr)) { m_xBookmarksBox->set_size_request(m_xBookmarksBox->get_approximate_digit_width() * 30, m_xBookmarksBox->get_height_rows(20)); @@ -1173,7 +1173,7 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl() const sal_Int32 nCount = m_xBookmarksBox->n_children(); for (sal_Int32 i = 0; i < nCount; ++i) { - SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", + SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), u""_ustr, m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt); } @@ -1248,7 +1248,7 @@ void SfxHelpWindow_Impl::loadHelpContent(const OUString& sHelpURL, bool bAddToHi { try { - Reference< XComponent > xContent = xLoader->loadComponentFromURL(sHelpURL, "_self", 0, Sequence< PropertyValue >()); + Reference< XComponent > xContent = xLoader->loadComponentFromURL(sHelpURL, u"_self"_ustr, 0, Sequence< PropertyValue >()); if (xContent.is()) { bSuccess = true; @@ -1274,10 +1274,10 @@ IMPL_LINK(SfxHelpIndexWindow_Impl, ActivatePageHdl, const OUString&, rPage, void } SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent, weld::Container* pContainer) - : m_xBuilder(Application::CreateBuilder(pContainer, "sfx/ui/helpcontrol.ui")) - , m_xContainer(m_xBuilder->weld_container("HelpControl")) - , m_xActiveLB(m_xBuilder->weld_combo_box("active")) - , m_xTabCtrl(m_xBuilder->weld_notebook("tabcontrol")) + : m_xBuilder(Application::CreateBuilder(pContainer, u"sfx/ui/helpcontrol.ui"_ustr)) + , m_xContainer(m_xBuilder->weld_container(u"HelpControl"_ustr)) + , m_xActiveLB(m_xBuilder->weld_combo_box(u"active"_ustr)) + , m_xTabCtrl(m_xBuilder->weld_notebook(u"tabcontrol"_ustr)) , aIdle("sfx2 appl SfxHelpIndexWindow_Impl") , aIndexKeywordLink(LINK(this, SfxHelpIndexWindow_Impl, KeywordHdl)) , pParentWin(_pParent) @@ -1289,7 +1289,7 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent, w GetSearchPage(); GetBookmarksPage(); - OUString sPageId("index"); + OUString sPageId(u"index"_ustr); SvtViewOptions aViewOpt( EViewType::TabDialog, CONFIGNAME_INDEXWIN ); if ( aViewOpt.Exists() ) { @@ -1414,7 +1414,7 @@ IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, KeywordHdl, IndexTabPage_Impl&, void) if( !bIndex) bIndex = xIPage->HasKeywordIgnoreCase(); // then set index or search page as current. - OUString sPageId = bIndex ? OUString("index") : OUString("find"); + OUString sPageId = bIndex ? u"index"_ustr : u"find"_ustr; if (sPageId != m_xTabCtrl->get_current_page_ident()) m_xTabCtrl->set_current_page(sPageId); @@ -1598,9 +1598,9 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl(SfxHelpWindow_Impl* pHelpWin, wel Window( pParent, WB_CLIPCHILDREN | WB_TABSTOP | WB_DIALOGCONTROL ), - xToolBox ( rBuilder.weld_toolbar("toolbar") ), - xOnStartupCB ( rBuilder.weld_check_button("checkbutton") ), - xMenu ( rBuilder.weld_menu("menu") ), + xToolBox ( rBuilder.weld_toolbar(u"toolbar"_ustr) ), + xOnStartupCB ( rBuilder.weld_check_button(u"checkbutton"_ustr) ), + xMenu ( rBuilder.weld_menu(u"menu"_ustr) ), aSelectIdle ( "sfx2 appl SfxHelpTextWindow_Impl Select" ), aIndexOnImage ( BMP_HELP_TOOLBOX_INDEX_ON ), aIndexOffImage ( BMP_HELP_TOOLBOX_INDEX_OFF ), @@ -1616,19 +1616,19 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl(SfxHelpWindow_Impl* pHelpWin, wel { xFrame = Frame::create( ::comphelper::getProcessComponentContext() ); xFrame->initialize( VCLUnoHelper::GetInterface ( pTextWin ) ); - xFrame->setName( "OFFICE_HELP" ); + xFrame->setName( u"OFFICE_HELP"_ustr ); lcl_disableLayoutOfFrame(xFrame); xToolBox->set_help_id(HID_HELP_TOOLBOX); - xToolBox->set_item_tooltip_text("index", aIndexOffText ); - xToolBox->set_item_help_id("index", HID_HELP_TOOLBOXITEM_INDEX); - xToolBox->set_item_help_id("backward", HID_HELP_TOOLBOXITEM_BACKWARD); - xToolBox->set_item_help_id("forward", HID_HELP_TOOLBOXITEM_FORWARD); - xToolBox->set_item_help_id("start", HID_HELP_TOOLBOXITEM_START); - xToolBox->set_item_help_id("print", HID_HELP_TOOLBOXITEM_PRINT); - xToolBox->set_item_help_id("bookmarks", HID_HELP_TOOLBOXITEM_BOOKMARKS ); - xToolBox->set_item_help_id("searchdialog", HID_HELP_TOOLBOXITEM_SEARCHDIALOG); + xToolBox->set_item_tooltip_text(u"index"_ustr, aIndexOffText ); + xToolBox->set_item_help_id(u"index"_ustr, HID_HELP_TOOLBOXITEM_INDEX); + xToolBox->set_item_help_id(u"backward"_ustr, HID_HELP_TOOLBOXITEM_BACKWARD); + xToolBox->set_item_help_id(u"forward"_ustr, HID_HELP_TOOLBOXITEM_FORWARD); + xToolBox->set_item_help_id(u"start"_ustr, HID_HELP_TOOLBOXITEM_START); + xToolBox->set_item_help_id(u"print"_ustr, HID_HELP_TOOLBOXITEM_PRINT); + xToolBox->set_item_help_id(u"bookmarks"_ustr, HID_HELP_TOOLBOXITEM_BOOKMARKS ); + xToolBox->set_item_help_id(u"searchdialog"_ustr, HID_HELP_TOOLBOXITEM_SEARCHDIALOG); InitToolBoxImages(); InitOnStartupBox(); @@ -1678,7 +1678,7 @@ bool SfxHelpTextWindow_Impl::HasSelection() const void SfxHelpTextWindow_Impl::InitToolBoxImages() { - xToolBox->set_item_icon_name("index", bIsIndexOn ? aIndexOffImage : aIndexOnImage); + xToolBox->set_item_icon_name(u"index"_ustr, bIsIndexOn ? aIndexOffImage : aIndexOnImage); } void SfxHelpTextWindow_Impl::InitOnStartupBox() @@ -1819,9 +1819,9 @@ IMPL_LINK_NOARG(SfxHelpTextWindow_Impl, SelectHdl, Timer *, void) { // create descriptor, set string and find all words Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor(); - xSrchDesc->setPropertyValue( "SearchRegularExpression", Any( true ) ); + xSrchDesc->setPropertyValue( u"SearchRegularExpression"_ustr, Any( true ) ); if ( bIsFullWordSearch ) - xSrchDesc->setPropertyValue( "SearchWords", Any( true ) ); + xSrchDesc->setPropertyValue( u"SearchWords"_ustr, Any( true ) ); xSrchDesc->setSearchString( sfx2::PrepareSearchString( aSearchText, GetBreakIterator(), false ) ); Reference< XIndexAccess > xSelection = xSearchable->findAll( xSrchDesc ); @@ -1871,9 +1871,9 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* pDlg) // create descriptor, set string and find all words Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor(); - xSrchDesc->setPropertyValue( "SearchWords", Any(pDlg->IsOnlyWholeWords()) ); - xSrchDesc->setPropertyValue( "SearchCaseSensitive", Any(pDlg->IsMarchCase()) ); - xSrchDesc->setPropertyValue( "SearchBackwards", Any(pDlg->IsSearchBackwards()) ); + xSrchDesc->setPropertyValue( u"SearchWords"_ustr, Any(pDlg->IsOnlyWholeWords()) ); + xSrchDesc->setPropertyValue( u"SearchCaseSensitive"_ustr, Any(pDlg->IsMarchCase()) ); + xSrchDesc->setPropertyValue( u"SearchBackwards"_ustr, Any(pDlg->IsSearchBackwards()) ); xSrchDesc->setSearchString( pDlg->GetSearchText() ); Reference< XInterface > xSelection; Reference< XTextRange > xCursor = getCursor(); @@ -1980,22 +1980,22 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) xMenu->clear(); if (bIsIndexOn) - xMenu->append("index", aIndexOffText, BMP_HELP_TOOLBOX_INDEX_OFF); + xMenu->append(u"index"_ustr, aIndexOffText, BMP_HELP_TOOLBOX_INDEX_OFF); else - xMenu->append("index", aIndexOnText, BMP_HELP_TOOLBOX_INDEX_ON); - - xMenu->append_separator("separator1"); - xMenu->append("backward", SfxResId(STR_HELP_BUTTON_PREV), BMP_HELP_TOOLBOX_PREV); - xMenu->set_sensitive("backward", xHelpWin->HasHistoryPredecessor()); - xMenu->append("forward", SfxResId(STR_HELP_BUTTON_NEXT), BMP_HELP_TOOLBOX_NEXT); - xMenu->set_sensitive("forward", xHelpWin->HasHistorySuccessor()); - xMenu->append("start", SfxResId(STR_HELP_BUTTON_START), BMP_HELP_TOOLBOX_START); - xMenu->append_separator("separator2"); - xMenu->append("print", SfxResId(STR_HELP_BUTTON_PRINT), BMP_HELP_TOOLBOX_PRINT); - xMenu->append("bookmarks", SfxResId(STR_HELP_BUTTON_ADDBOOKMARK), BMP_HELP_TOOLBOX_BOOKMARKS); - xMenu->append("searchdialog", SfxResId(STR_HELP_BUTTON_SEARCHDIALOG), BMP_HELP_TOOLBOX_SEARCHDIALOG); - xMenu->append_separator("separator3"); - xMenu->append_check("selectionmode", SfxResId(STR_HELP_MENU_TEXT_SELECTION_MODE)); + xMenu->append(u"index"_ustr, aIndexOnText, BMP_HELP_TOOLBOX_INDEX_ON); + + xMenu->append_separator(u"separator1"_ustr); + xMenu->append(u"backward"_ustr, SfxResId(STR_HELP_BUTTON_PREV), BMP_HELP_TOOLBOX_PREV); + xMenu->set_sensitive(u"backward"_ustr, xHelpWin->HasHistoryPredecessor()); + xMenu->append(u"forward"_ustr, SfxResId(STR_HELP_BUTTON_NEXT), BMP_HELP_TOOLBOX_NEXT); + xMenu->set_sensitive(u"forward"_ustr, xHelpWin->HasHistorySuccessor()); + xMenu->append(u"start"_ustr, SfxResId(STR_HELP_BUTTON_START), BMP_HELP_TOOLBOX_START); + xMenu->append_separator(u"separator2"_ustr); + xMenu->append(u"print"_ustr, SfxResId(STR_HELP_BUTTON_PRINT), BMP_HELP_TOOLBOX_PRINT); + xMenu->append(u"bookmarks"_ustr, SfxResId(STR_HELP_BUTTON_ADDBOOKMARK), BMP_HELP_TOOLBOX_BOOKMARKS); + xMenu->append(u"searchdialog"_ustr, SfxResId(STR_HELP_BUTTON_SEARCHDIALOG), BMP_HELP_TOOLBOX_SEARCHDIALOG); + xMenu->append_separator(u"separator3"_ustr); + xMenu->append_check(u"selectionmode"_ustr, SfxResId(STR_HELP_MENU_TEXT_SELECTION_MODE)); URL aURL; aURL.Complete = ".uno:SelectTextMode"; Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); @@ -2008,16 +2008,16 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) FeatureStateEvent rEvent = pStateListener->GetStateEvent(); bool bCheck = false; rEvent.State >>= bCheck; - xMenu->set_active("selectionmode", bCheck); + xMenu->set_active(u"selectionmode"_ustr, bCheck); } - xMenu->append_separator("separator4"); - xMenu->append("copy", SfxResId(STR_HELP_MENU_TEXT_COPY), BMP_HELP_TOOLBOX_COPY); - xMenu->set_sensitive("copy", HasSelection()); + xMenu->append_separator(u"separator4"_ustr); + xMenu->append(u"copy"_ustr, SfxResId(STR_HELP_MENU_TEXT_COPY), BMP_HELP_TOOLBOX_COPY); + xMenu->set_sensitive(u"copy"_ustr, HasSelection()); if ( bIsDebug ) { - xMenu->append_separator("separator5"); - xMenu->append("sourceview", SfxResId(STR_HELP_BUTTON_SOURCEVIEW)); + xMenu->append_separator(u"separator5"_ustr); + xMenu->append(u"sourceview"_ustr, SfxResId(STR_HELP_BUTTON_SOURCEVIEW)); } int x, y, width, height; @@ -2097,13 +2097,13 @@ void SfxHelpTextWindow_Impl::ToggleIndex( bool bOn ) bIsIndexOn = bOn; if ( bIsIndexOn ) { - xToolBox->set_item_icon_name("index", aIndexOffImage); - xToolBox->set_item_tooltip_text("index", aIndexOffText); + xToolBox->set_item_icon_name(u"index"_ustr, aIndexOffImage); + xToolBox->set_item_tooltip_text(u"index"_ustr, aIndexOffText); } else { - xToolBox->set_item_icon_name("index", aIndexOnImage); - xToolBox->set_item_tooltip_text("index", aIndexOnText); + xToolBox->set_item_icon_name(u"index"_ustr, aIndexOnImage); + xToolBox->set_item_tooltip_text(u"index"_ustr, aIndexOnText); } } @@ -2134,18 +2134,18 @@ void SfxHelpTextWindow_Impl::SetPageStyleHeaderOff() const Reference < XText > xText = xRange->getText(); Reference < XPropertySet > xProps( xText->createTextCursorByRange( xRange ), UNO_QUERY ); OUString sStyleName; - if ( xProps->getPropertyValue( "PageStyleName" ) >>= sStyleName ) + if ( xProps->getPropertyValue( u"PageStyleName"_ustr ) >>= sStyleName ) { Reference < XStyleFamiliesSupplier > xStyles( xController->getModel(), UNO_QUERY ); Reference < XNameContainer > xContainer; - if ( xStyles->getStyleFamilies()->getByName( "PageStyles" ) + if ( xStyles->getStyleFamilies()->getByName( u"PageStyles"_ustr ) >>= xContainer ) { Reference < XStyle > xStyle; if ( xContainer->getByName( sStyleName ) >>= xStyle ) { Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY ); - xPropSet->setPropertyValue( "HeaderIsOn", Any( false ) ); + xPropSet->setPropertyValue( u"HeaderIsOn"_ustr, Any( false ) ); Reference< XModifiable > xReset(xStyles, UNO_QUERY); xReset->setModified(false); @@ -2381,11 +2381,11 @@ void SfxHelpWindow_Impl::openDone(std::u16string_view sURL , Reference < XViewSettingsSupplier > xSettings( xController, UNO_QUERY ); Reference < XPropertySet > xViewProps = xSettings->getViewSettings(); Reference< XPropertySetInfo > xInfo = xViewProps->getPropertySetInfo(); - xViewProps->setPropertyValue( "ShowContentTips", Any( false ) ); - xViewProps->setPropertyValue( "ShowGraphics", Any( true ) ); - xViewProps->setPropertyValue( "ShowTables", Any( true ) ); - xViewProps->setPropertyValue( "HelpURL", Any( OUString("HID:SFX2_HID_HELP_ONHELP") ) ); - OUString sProperty( "IsExecuteHyperlinks" ); + xViewProps->setPropertyValue( u"ShowContentTips"_ustr, Any( false ) ); + xViewProps->setPropertyValue( u"ShowGraphics"_ustr, Any( true ) ); + xViewProps->setPropertyValue( u"ShowTables"_ustr, Any( true ) ); + xViewProps->setPropertyValue( u"HelpURL"_ustr, Any( u"HID:SFX2_HID_HELP_ONHELP"_ustr ) ); + OUString sProperty( u"IsExecuteHyperlinks"_ustr ); if ( xInfo->hasPropertyByName( sProperty ) ) xViewProps->setPropertyValue( sProperty, Any( true ) ); xController->restoreViewData(Any()); @@ -2429,11 +2429,11 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( SetHelpId( HID_HELP_WINDOW ); - m_xBuilder = Application::CreateInterimBuilder(m_xBox.get(), "sfx/ui/helpwindow.ui", false); - m_xContainer = m_xBuilder->weld_paned("HelpWindow"); + m_xBuilder = Application::CreateInterimBuilder(m_xBox.get(), u"sfx/ui/helpwindow.ui"_ustr, false); + m_xContainer = m_xBuilder->weld_paned(u"HelpWindow"_ustr); m_xContainer->connect_size_allocate(LINK(this, SfxHelpWindow_Impl, ResizeHdl)); - m_xHelpPaneWindow = m_xBuilder->weld_container("helppanewindow"); - m_xHelpTextWindow = m_xBuilder->weld_container("helptextwindow"); + m_xHelpPaneWindow = m_xBuilder->weld_container(u"helppanewindow"_ustr); + m_xHelpTextWindow = m_xBuilder->weld_container(u"helptextwindow"_ustr); m_xHelpTextXWindow = m_xHelpTextWindow->CreateChildFrame(); pHelpInterceptor->InitWaiter( this ); @@ -2630,8 +2630,8 @@ void SfxHelpWindow_Impl::CloseWindow() void SfxHelpWindow_Impl::UpdateToolbox() { - pTextWin->GetToolBox().set_item_sensitive("backward", pHelpInterceptor->HasHistoryPred()); - pTextWin->GetToolBox().set_item_sensitive("forward", pHelpInterceptor->HasHistorySucc()); + pTextWin->GetToolBox().set_item_sensitive(u"backward"_ustr, pHelpInterceptor->HasHistoryPred()); + pTextWin->GetToolBox().set_item_sensitive(u"forward"_ustr, pHelpInterceptor->HasHistorySucc()); } @@ -2649,9 +2649,9 @@ bool SfxHelpWindow_Impl::HasHistorySuccessor() const // class SfxAddHelpBookmarkDialog_Impl ----------------------------------- SfxAddHelpBookmarkDialog_Impl::SfxAddHelpBookmarkDialog_Impl(weld::Widget* pParent, bool bRename) - : GenericDialogController(pParent, "sfx/ui/bookmarkdialog.ui", "BookmarkDialog") - , m_xTitleED(m_xBuilder->weld_entry("entry")) - , m_xAltTitle(m_xBuilder->weld_label("alttitle")) + : GenericDialogController(pParent, u"sfx/ui/bookmarkdialog.ui"_ustr, u"BookmarkDialog"_ustr) + , m_xTitleED(m_xBuilder->weld_entry(u"entry"_ustr)) + , m_xAltTitle(m_xBuilder->weld_label(u"alttitle"_ustr)) { if (bRename) m_xDialog->set_title(m_xAltTitle->get_label()); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 8e828dad959d..60bfa8415fa2 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -288,7 +288,7 @@ ContentTabPage_Impl* SfxHelpIndexWindow_Impl::GetContentPage() { if (!xCPage) { - xCPage.reset(new ContentTabPage_Impl(m_xTabCtrl->get_page("contents"), this)); + xCPage.reset(new ContentTabPage_Impl(m_xTabCtrl->get_page(u"contents"_ustr), this)); xCPage->SetDoubleClickHdl(LINK(this, SfxHelpIndexWindow_Impl, ContentTabPageDoubleClickHdl)); } return xCPage.get(); @@ -298,7 +298,7 @@ IndexTabPage_Impl* SfxHelpIndexWindow_Impl::GetIndexPage() { if (!xIPage) { - xIPage.reset(new IndexTabPage_Impl(m_xTabCtrl->get_page("index"), this)); + xIPage.reset(new IndexTabPage_Impl(m_xTabCtrl->get_page(u"index"_ustr), this)); xIPage->SetDoubleClickHdl( LINK(this, SfxHelpIndexWindow_Impl, IndexTabPageDoubleClickHdl) ); xIPage->SetKeywordHdl( aIndexKeywordLink ); } @@ -309,7 +309,7 @@ SearchTabPage_Impl* SfxHelpIndexWindow_Impl::GetSearchPage() { if (!xSPage) { - xSPage.reset(new SearchTabPage_Impl(m_xTabCtrl->get_page("find"), this)); + xSPage.reset(new SearchTabPage_Impl(m_xTabCtrl->get_page(u"find"_ustr), this)); xSPage->SetDoubleClickHdl( LINK(this, SfxHelpIndexWindow_Impl, TabPageDoubleClickHdl) ); } return xSPage.get(); @@ -319,7 +319,7 @@ BookmarksTabPage_Impl* SfxHelpIndexWindow_Impl::GetBookmarksPage() { if (!xBPage) { - xBPage.reset(new BookmarksTabPage_Impl(m_xTabCtrl->get_page("bookmarks"), this)); + xBPage.reset(new BookmarksTabPage_Impl(m_xTabCtrl->get_page(u"bookmarks"_ustr), this)); xBPage->SetDoubleClickHdl( LINK(this, SfxHelpIndexWindow_Impl, TabPageDoubleClickHdl) ); } return xBPage.get(); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 85d60828d2ba..a0babdee399a 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -223,7 +223,7 @@ static OUString const & HelpLocaleString() { sLang = sLang.copy( 0, nSepPos ); } - OUString sHelpPath(""); + OUString sHelpPath(u""_ustr); sHelpPath = getHelpRootURL() + "/" + utl::ConfigManager::getProductVersion() + "/" + aLocaleStr; if (impl_checkHelpLocalePath(sHelpPath)) { @@ -294,7 +294,7 @@ static bool GetHelpAnchor_Impl( std::u16string_view _rURL, OUString& _rAnchor ) Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); OUString sAnchor; - if ( aCnt.getPropertyValue("AnchorName") >>= sAnchor ) + if ( aCnt.getPropertyValue(u"AnchorName"_ustr) >>= sAnchor ) { if ( !sAnchor.isEmpty() ) @@ -345,7 +345,7 @@ SfxHelp::SfxHelp() // read the environment variable "HELP_DEBUG" // if it's set, you will see debug output on active help OUString sHelpDebug; - OUString sEnvVarName( "HELP_DEBUG" ); + OUString sEnvVarName( u"HELP_DEBUG"_ustr ); osl_getEnvironment( sEnvVarName.pData, &sHelpDebug.pData ); bIsDebug = !sHelpDebug.isEmpty(); } @@ -535,7 +535,7 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , // otherwise - create new help task Reference< XFrame2 > xHelpTask( - xDesktop->findFrame( "OFFICE_HELP_TASK", FrameSearchFlag::TASKS | FrameSearchFlag::CREATE), + xDesktop->findFrame( u"OFFICE_HELP_TASK"_ustr, FrameSearchFlag::TASKS | FrameSearchFlag::CREATE), UNO_QUERY); if (!xHelpTask.is()) return nullptr; @@ -550,12 +550,12 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , if (xHelpTask->setComponent( xHelpWindow, Reference< XController >() )) { // Customize UI ... - xHelpTask->setName("OFFICE_HELP_TASK"); + xHelpTask->setName(u"OFFICE_HELP_TASK"_ustr); Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY); if (xProps.is()) xProps->setPropertyValue( - "Title", + u"Title"_ustr, Any(SfxResId(STR_HELP_WINDOW_TITLE))); pHelpWindow->setContainerWindow( xParentWindow ); @@ -564,7 +564,7 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , // This sub frame is created internally (if we called new SfxHelpWindow_Impl() ...) // It should exist :-) - xHelpContent = xHelpTask->findFrame("OFFICE_HELP", FrameSearchFlag::CHILDREN); + xHelpContent = xHelpTask->findFrame(u"OFFICE_HELP"_ustr, FrameSearchFlag::CHILDREN); } if (!xHelpContent.is()) @@ -573,7 +573,7 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , return nullptr; } - xHelpContent->setName("OFFICE_HELP"); + xHelpContent->setName(u"OFFICE_HELP"_ustr); rHelpTask = xHelpTask; rHelpContent = xHelpContent; @@ -775,7 +775,7 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) { // app-path=<path> // app-extensions=...;org.libreoffice.LibreOffice.Help=<sha>;... // lines: - osl::File ini("file:///.flatpak-info"); + osl::File ini(u"file:///.flatpak-info"_ustr); auto err = ini.open(osl_File_OpenFlag_Read); if (err != osl::FileBase::E_None) { SAL_WARN("sfx.appl", "LIBO_FLATPAK mode failure opening /.flatpak-info: " << err); @@ -1020,9 +1020,9 @@ private: DECL_LINK(DownloadClickHdl, weld::LinkButton&, bool); public: HelpManualMessage(weld::Widget* pParent) - : MessageDialogController(pParent, "sfx/ui/helpmanual.ui", "onlinehelpmanual", "box") - , m_xDownloadInfo(m_xBuilder->weld_link_button("downloadinfo")) - , m_xHideOfflineHelpCB(m_xBuilder->weld_check_button("hidedialog")) + : MessageDialogController(pParent, u"sfx/ui/helpmanual.ui"_ustr, u"onlinehelpmanual"_ustr, u"box"_ustr) + , m_xDownloadInfo(m_xBuilder->weld_link_button(u"downloadinfo"_ustr)) + , m_xHideOfflineHelpCB(m_xBuilder->weld_check_button(u"hidedialog"_ustr)) { LanguageType aLangType = Application::GetSettings().GetUILanguageTag().getLanguageType(); OUString sLocaleString = SvtLanguageTable::GetLanguageString(aLangType); @@ -1179,7 +1179,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow) else { // Opens the help page that explains how to install offline help - OUString aOfflineHelpURL(CreateHelpURL_Impl(HID_HELPMANUAL_OFFLINE, "shared")); + OUString aOfflineHelpURL(CreateHelpURL_Impl(HID_HELPMANUAL_OFFLINE, u"shared"_ustr)); impl_showOnlineHelp(aOfflineHelpURL, pWeldWindow); bTopicExists = true; } @@ -1211,10 +1211,10 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow) // If not, create a new one and return access directly to the internal sub frame showing the help content // search must be done here; search one desktop level could return an arbitrary frame Reference< XFrame2 > xHelp( - xDesktop->findFrame( "OFFICE_HELP_TASK", FrameSearchFlag::CHILDREN), + xDesktop->findFrame( u"OFFICE_HELP_TASK"_ustr, FrameSearchFlag::CHILDREN), UNO_QUERY); Reference< XFrame > xHelpContent = xDesktop->findFrame( - "OFFICE_HELP", + u"OFFICE_HELP"_ustr, FrameSearchFlag::CHILDREN); SfxHelpWindow_Impl* pHelpWindow = nullptr; @@ -1366,7 +1366,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt else { // Opens the help page that explains how to install offline help - OUString aOfflineHelpURL(CreateHelpURL_Impl(HID_HELPMANUAL_OFFLINE, "shared")); + OUString aOfflineHelpURL(CreateHelpURL_Impl(HID_HELPMANUAL_OFFLINE, u"shared"_ustr)); impl_showOnlineHelp(aOfflineHelpURL, pWidget); bTopicExists = true; } @@ -1398,10 +1398,10 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt // If not, create a new one and return access directly to the internal sub frame showing the help content // search must be done here; search one desktop level could return an arbitrary frame Reference< XFrame2 > xHelp( - xDesktop->findFrame( "OFFICE_HELP_TASK", FrameSearchFlag::CHILDREN), + xDesktop->findFrame( u"OFFICE_HELP_TASK"_ustr, FrameSearchFlag::CHILDREN), UNO_QUERY); Reference< XFrame > xHelpContent = xDesktop->findFrame( - "OFFICE_HELP", + u"OFFICE_HELP"_ustr, FrameSearchFlag::CHILDREN); SfxHelpWindow_Impl* pHelpWindow = nullptr; diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 0e61f8eb040e..0a4ff600d1f3 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -88,7 +88,7 @@ void SAL_CALL SfxNotificationListener_Impl::disposing( const EventObject& ) OUString SAL_CALL ShutdownIcon::getImplementationName() { - return "com.sun.star.comp.desktop.QuickstartWrapper"; + return u"com.sun.star.comp.desktop.QuickstartWrapper"_ustr; } sal_Bool SAL_CALL ShutdownIcon::supportsService(OUString const & ServiceName) @@ -98,7 +98,7 @@ sal_Bool SAL_CALL ShutdownIcon::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> SAL_CALL ShutdownIcon::getSupportedServiceNames() { - return { "com.sun.star.office.Quickstart" }; + return { u"com.sun.star.office.Quickstart"_ustr }; } bool ShutdownIcon::bModalMode = false; @@ -220,12 +220,12 @@ void ShutdownIcon::FromTemplate() css::uno::Reference < css::frame::XDispatch > xDisp; if ( xProv.is() ) { - xDisp = xProv->queryDispatch( aTargetURL, "_self", 0 ); + xDisp = xProv->queryDispatch( aTargetURL, u"_self"_ustr, 0 ); } if ( !xDisp.is() ) return; - Sequence<PropertyValue> aArgs { comphelper::makePropertyValue("Referer", OUString("private:user")) }; + Sequence<PropertyValue> aArgs { comphelper::makePropertyValue(u"Referer"_ustr, u"private:user"_ustr) }; css::uno::Reference< css::frame::XNotifyingDispatch > xNotifier(xDisp, UNO_QUERY); if (xNotifier.is()) { @@ -286,9 +286,9 @@ IMPL_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, /*unused*/, vo int nArgs=3; Sequence< PropertyValue > aArgs{ - comphelper::makePropertyValue("InteractionHandler", xInteraction), - comphelper::makePropertyValue("MacroExecutionMode", sal_Int16(css::document::MacroExecMode::USE_CONFIG)), - comphelper::makePropertyValue("UpdateDocMode", sal_Int16(css::document::UpdateDocMode::ACCORDING_TO_CONFIG)) + comphelper::makePropertyValue(u"InteractionHandler"_ustr, xInteraction), + comphelper::makePropertyValue(u"MacroExecutionMode"_ustr, sal_Int16(css::document::MacroExecMode::USE_CONFIG)), + comphelper::makePropertyValue(u"UpdateDocMode"_ustr, sal_Int16(css::document::UpdateDocMode::ACCORDING_TO_CONFIG)) }; // use the filedlghelper to get the current filter name, @@ -360,7 +360,7 @@ IMPL_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, /*unused*/, vo } if ( 1 == nFiles ) - OpenURL( sFiles[0], "_default", aArgs ); + OpenURL( sFiles[0], u"_default"_ustr, aArgs ); else { OUString aBaseDirURL = sFiles[0]; @@ -371,7 +371,7 @@ IMPL_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, /*unused*/, vo for ( iFiles = 1; iFiles < nFiles; iFiles++ ) { OUString aURL = aBaseDirURL + sFiles[iFiles]; - OpenURL( aURL, "_default", aArgs ); + OpenURL( aURL, u"_default"_ustr, aArgs ); } } } diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 48eaa6a8226e..7d44dcca0022 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -171,7 +171,7 @@ void LayoutManagerListener::setFrame( const css::uno::Reference< css::frame::XFr xPropSet.set( xLayoutManager, UNO_QUERY ); if ( xPropSet.is() ) { - aValue = xPropSet->getPropertyValue( "LockCount" ); + aValue = xPropSet->getPropertyValue( u"LockCount"_ustr ); aValue >>= m_pWrkWin->m_nLock; } } diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 8108327cd39a..2d0f77b42fdf 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -138,7 +138,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde OUString SAL_CALL OPackageStructureCreator::getImplementationName() { - return "com.sun.star.comp.embed.PackageStructureCreator"; + return u"com.sun.star.comp.embed.PackageStructureCreator"_ustr; } sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& ServiceName ) @@ -148,7 +148,7 @@ sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& Ser uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedServiceNames() { - return { "com.sun.star.embed.PackageStructureCreator", "com.sun.star.comp.embed.PackageStructureCreator" }; + return { u"com.sun.star.embed.PackageStructureCreator"_ustr, u"com.sun.star.comp.embed.PackageStructureCreator"_ustr }; } } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index c7253b9fcd86..8234b10f95e5 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -315,7 +315,7 @@ ErrCode SfxFilterMatcher::GuessFilterIgnoringContent( std::shared_ptr<const SfxFilter>& rpFilter ) const { uno::Reference<document::XTypeDetection> xDetection( - comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY); + comphelper::getProcessServiceFactory()->createInstance(u"com.sun.star.document.TypeDetection"_ustr), uno::UNO_QUERY); OUString sTypeName; try @@ -350,7 +350,7 @@ ErrCode SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, std: // no detection service -> nothing to do ! uno::Reference<document::XTypeDetection> xDetection( - comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.TypeDetection"), uno::UNO_QUERY); + comphelper::getProcessServiceFactory()->createInstance(u"com.sun.star.document.TypeDetection"_ustr), uno::UNO_QUERY); if (!xDetection.is()) return ERRCODE_ABORT; @@ -418,7 +418,7 @@ ErrCode SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, std: // If there is no acceptable type for this document at all, the type detection has possibly returned something else. // The DocumentService property is only a preselection, and all preselections are considered as optional! // This "wrong" type will be sorted out now because we match only allowed filters to the detected type - uno::Sequence< beans::NamedValue > lQuery { { "Name", css::uno::Any(sTypeName) } }; + uno::Sequence< beans::NamedValue > lQuery { { u"Name"_ustr, css::uno::Any(sTypeName) } }; pNewFilter = GetFilterForProps(lQuery, nMust, nDont); } @@ -456,7 +456,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const std::shared_ptr<const SfxFi // Start Setup std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr, VclMessageType::Info, VclButtonsType::Ok, - "Here should the Setup now be starting!")); + u"Here should the Setup now be starting!"_ustr)); xInfoBox->run(); #endif // Installation must still give feedback if it worked or not, @@ -630,7 +630,7 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcher::GetFilter4Mime( const OUStrin return nullptr; } - css::uno::Sequence < css::beans::NamedValue > aSeq { { "MediaType", css::uno::Any(rMediaType) } }; + css::uno::Sequence < css::beans::NamedValue > aSeq { { u"MediaType"_ustr, css::uno::Any(rMediaType) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -656,7 +656,7 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcher::GetFilter4EA( const OUString& return nullptr; } - css::uno::Sequence < css::beans::NamedValue > aSeq { { "Name", css::uno::Any(rType) } }; + css::uno::Sequence < css::beans::NamedValue > aSeq { { u"Name"_ustr, css::uno::Any(rType) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -692,7 +692,7 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcher::GetFilter4Extension( const OU sExt = sExt.copy(1); css::uno::Sequence < css::beans::NamedValue > aSeq - { { "Extensions", css::uno::Any(uno::Sequence < OUString > { sExt } ) } }; + { { u"Extensions"_ustr, css::uno::Any(uno::Sequence < OUString > { sExt } ) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -702,7 +702,7 @@ std::shared_ptr<const SfxFilter> SfxFilterMatcher::GetFilter4ClipBoardId( SotCli return nullptr; css::uno::Sequence < css::beans::NamedValue > aSeq - { { "ClipboardFormat", css::uno::Any(SotExchange::GetFormatName( nId )) } }; + { { u"ClipboardFormat"_ustr, css::uno::Any(SotExchange::GetFormatName( nId )) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -1060,8 +1060,8 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate ) uno::Reference< container::XNameAccess > xTypeCFG ; if( xServiceManager.is() ) { - xFilterCFG.set( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY ); - xTypeCFG.set( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY ); + xFilterCFG.set( xServiceManager->createInstance( u"com.sun.star.document.FilterFactory"_ustr ), uno::UNO_QUERY ); + xTypeCFG.set( xServiceManager->createInstance( u"com.sun.star.document.TypeDetection"_ustr ), uno::UNO_QUERY ); } if( xFilterCFG.is() && xTypeCFG.is() ) diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 58c3d9e1e844..eb8a795ae004 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -114,7 +114,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL, // Who we are OUString sGenerator(Translate::ExpandVariables(STR_HTML_GENERATOR)); - OUString os( "$_OS" ); + OUString os( u"$_OS"_ustr ); ::rtl::Bootstrap::expandMacros(os); sGenerator = sGenerator.replaceFirst( "%1", os ); OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_generator, sGenerator, false, pNonConvertableChars ); @@ -223,7 +223,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( { OStringBuffer sOut; OUString aStr; - uno::Any aAny = xSet->getPropertyValue("FrameURL"); + uno::Any aAny = xSet->getPropertyValue(u"FrameURL"_ustr); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { OUString aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); @@ -239,7 +239,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } } - aAny = xSet->getPropertyValue("FrameName"); + aAny = xSet->getPropertyValue(u"FrameName"_ustr); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_name "=\""); @@ -250,13 +250,13 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } sal_Int32 nVal = SIZE_NOT_SET; - aAny = xSet->getPropertyValue("FrameMarginWidth"); + aAny = xSet->getPropertyValue(u"FrameMarginWidth"_ustr); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) -e ... etc. - the rest is truncated