From 0572ef356be49b95b22a4794b7937c8c0914468f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 18 Jun 2024 10:24:03 +0200 Subject: [PATCH] loplugin:ostr in various Change-Id: I7aa8ed716998a185996482dc561219b398a1c919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169080 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../core/dataaccess/databasedocument.cxx | 4 +- desktop/source/app/cmdlineargs.cxx | 2 +- editeng/qa/unit/core-test.cxx | 14 +- editeng/source/misc/svxacorr.cxx | 14 +- forms/source/component/ImageControl.cxx | 2 +- forms/source/component/clickableimage.cxx | 2 +- framework/qa/cppunit/CheckXTitle.cxx | 22 +- sc/qa/extras/scfunctionlistobj.cxx | 5 +- sc/qa/unit/GoalSeekTest.cxx | 4 +- sc/qa/unit/tiledrendering/tiledrendering.cxx | 4 +- sc/source/core/data/colorscale.cxx | 2 +- sc/source/ui/dbgui/PivotLayoutDialog.cxx | 4 +- sc/source/ui/dbgui/dbnamdlg.cxx | 2 +- sc/source/ui/dbgui/validate.cxx | 32 +- sc/source/ui/namedlg/namedefdlg.cxx | 26 +- sc/source/ui/namedlg/namedlg.cxx | 30 +- sd/qa/unit/AnnotationTest.cxx | 36 +- sd/qa/unit/import-tests2.cxx | 6 +- sd/qa/unit/layout-tests.cxx | 2 +- sd/source/core/drawdoc.cxx | 2 +- .../ui/framework/module/ModuleController.cxx | 28 +- sfx2/source/dialog/dinfdlg.cxx | 4 +- sfx2/source/view/viewfrm.cxx | 2 +- svx/qa/unit/svdraw.cxx | 8 +- svx/source/tbxctrls/bulletsnumbering.cxx | 2 +- sw/qa/core/text/txtfly.cxx | 2 +- sw/qa/extras/layout/layout2.cxx | 12 +- sw/qa/extras/layout/layout3.cxx | 4 +- sw/qa/extras/odfexport/odfexport2.cxx | 18 +- sw/qa/extras/odfimport/odfimport.cxx | 6 +- sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 12 +- sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 20 +- sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 44 +-- sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 20 +- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 2 +- sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 6 +- sw/qa/extras/rtfexport/rtfexport7.cxx | 333 +++++++++--------- sw/qa/extras/rtfexport/rtfexport8.cxx | 60 ++-- sw/qa/extras/uiwriter/uiwriter6.cxx | 30 +- sw/qa/extras/uiwriter/uiwriter8.cxx | 10 +- sw/qa/extras/uiwriter/uiwriter9.cxx | 6 +- sw/qa/extras/ww8export/ww8export4.cxx | 16 +- sw/qa/filter/ascii/ascii.cxx | 23 +- sw/qa/filter/ww8/ww8.cxx | 8 +- .../writerfilter/dmapper/CellColorHandler.cxx | 2 +- sw/qa/writerfilter/dmapper/DomainMapper.cxx | 6 +- .../dmapper/DomainMapperTableHandler.cxx | 7 +- .../dmapper/DomainMapperTableManager.cxx | 2 +- .../dmapper/DomainMapper_Impl.cxx | 4 +- sw/qa/writerfilter/dmapper/GraphicImport.cxx | 2 +- sw/qa/writerfilter/dmapper/PropertyMap.cxx | 2 +- sw/qa/writerfilter/dmapper/SdtHelper.cxx | 2 +- sw/qa/writerfilter/dmapper/SettingsTable.cxx | 6 +- sw/qa/writerfilter/dmapper/TableManager.cxx | 2 +- .../dmapper/TextEffectsHandler.cxx | 2 +- sw/qa/writerfilter/filter/WriterFilter.cxx | 4 +- sw/qa/writerfilter/ooxml/ooxml.cxx | 2 +- sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx | 6 +- .../writerfilter/rtftok/rtfdispatchsymbol.cxx | 2 +- .../writerfilter/rtftok/rtfdispatchvalue.cxx | 2 +- sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx | 2 +- sw/qa/writerfilter/rtftok/rtfsdrimport.cxx | 2 +- sw/qa/writerfilter/rtftok/rtfsprm.cxx | 2 +- sw/qa/writerfilter/rtftok/rtftokenizer.cxx | 2 +- sw/source/core/doc/docredln.cxx | 2 +- sw/source/core/docnode/section.cxx | 2 +- sw/source/core/frmedt/feflyole.cxx | 2 +- .../core/text/EnhancedPDFExportHelper.cxx | 2 +- sw/source/core/unocore/unofield.cxx | 2 +- sw/source/ui/config/optpage.cxx | 20 +- sw/source/ui/misc/pgfnote.cxx | 30 +- sw/source/uibase/config/viewopt.cxx | 2 +- sw/source/uibase/docvw/edtwin2.cxx | 2 +- sw/source/uibase/uno/SwXDocumentSettings.cxx | 120 +++---- sw/source/uibase/uno/unotxdoc.cxx | 2 +- sw/source/uibase/utlui/content.cxx | 8 +- sw/source/uibase/utlui/glbltree.cxx | 2 +- sw/source/uibase/utlui/uitool.cxx | 2 +- .../writerfilter/dmapper/DomainMapper.cxx | 4 +- .../writerfilter/dmapper/GraphicImport.cxx | 84 ++--- .../writerfilter/dmapper/PropertyMap.cxx | 2 +- .../writerfilter/filter/WriterFilter.cxx | 20 +- toolkit/source/controls/dialogcontrol.cxx | 4 +- toolkit/source/controls/unocontrols.cxx | 2 +- vcl/qa/cppunit/complextext.cxx | 4 +- vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 8 +- vcl/qa/cppunit/svm/svmtest.cxx | 6 +- vcl/qa/cppunit/text.cxx | 2 +- vcl/source/treelist/svtabbx.cxx | 2 +- vcl/unx/generic/app/salinst.cxx | 1 + vcl/unx/gtk3/gtkinst.cxx | 2 + xmloff/source/forms/elementimport.cxx | 2 +- 92 files changed, 662 insertions(+), 631 deletions(-) diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 5e0bb346b572..0a56c115868b 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1254,7 +1254,7 @@ void SAL_CALL ODatabaseDocument::storeToURL( const OUString& _rURL, const Sequen catch( const Exception& ) { Any aError = ::cppu::getCaughtException(); - m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToFailed", nullptr, aError ); + m_aEventNotifier.notifyDocumentEventAsync( u"OnSaveToFailed"_ustr, nullptr, aError ); if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() ) || aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() ) @@ -1267,7 +1267,7 @@ void SAL_CALL ODatabaseDocument::storeToURL( const OUString& _rURL, const Sequen impl_throwIOExceptionCausedBySave_throw( aError, _rURL ); } - m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToDone", nullptr, Any( _rURL ) ); + m_aEventNotifier.notifyDocumentEventAsync( u"OnSaveToDone"_ustr, nullptr, Any( _rURL ) ); } // XModifyBroadcaster diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 09a0cd212947..fcb31520fd4d 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -542,7 +542,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) // open in viewmode eCurrentEvent = CommandLineEvent::Start; // start on the first slide unless a valid starting slide # was provided - m_startListParams = rest.toUInt32() > 0 ? rest : "1"; + m_startListParams = rest.toUInt32() > 0 ? rest : u"1"_ustr; } else if ( oArg == "display" ) { diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 9cec620ed291..a57a533c42c4 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -810,7 +810,7 @@ void Test::testHTMLPaste() EditDoc& rDoc = aEditEngine.GetEditDoc(); //OString aHTML("\ntest"_ostr); std::vector aContent({ "\ntest"_ostr }); - std::vector aMime({ "text/html" }); + std::vector aMime({ u"text/html"_ustr }); uno::Reference xData(new TestTransferable(aContent, aMime)); // When trying to paste HTML: @@ -830,7 +830,7 @@ void Test::testHTMLFragmentPaste() EditEngine aEditEngine(mpItemPool.get()); EditDoc& rDoc = aEditEngine.GetEditDoc(); std::vector aContent({ "abc"_ostr }); - std::vector aMime({ "text/html" }); + std::vector aMime({ u"text/html"_ustr }); uno::Reference xData(new TestTransferable(aContent, aMime)); @@ -852,7 +852,7 @@ void Test::testRTFPaste() EditDoc& rDoc = aEditEngine.GetEditDoc(); std::vector aContent( { "{\\rtf1\\adeflang1025\\ansi{\\ul www.libreoffice.org}}"_ostr }); - std::vector aMime({ "text/richtext" }); + std::vector aMime({ u"text/richtext"_ustr }); uno::Reference xData(new TestTransferable(aContent, aMime)); // When trying to paste HTML: @@ -863,7 +863,7 @@ void Test::testRTFPaste() // - Expected: www.libreoffice.org // - Actual : // i.e. RTF and plain text paste worked, but not HTML. - CPPUNIT_ASSERT_EQUAL(OUString("www.libreoffice.org"), + CPPUNIT_ASSERT_EQUAL(u"www.libreoffice.org"_ustr, rDoc.GetParaAsString(static_cast(0))); } @@ -886,8 +886,8 @@ void Test::testRTFHTMLPaste() "" "

abc

"_ostr }); std::vector aMime( - { "text/richtext", - "application/x-openoffice-html-simple;windows_formatname=\"HTML Format\"" }); + { u"text/richtext"_ustr, + u"application/x-openoffice-html-simple;windows_formatname=\"HTML Format\""_ustr }); uno::Reference xData(new TestTransferable(aContent, aMime)); // When trying to paste HTML: @@ -897,7 +897,7 @@ void Test::testRTFHTMLPaste() // expected "abc" // wrong: www.libreoffice.org // i.e. HTML is preferred over HTML. - CPPUNIT_ASSERT_EQUAL(OUString("abc"), rDoc.GetParaAsString(static_cast(0))); + CPPUNIT_ASSERT_EQUAL(u"abc"_ustr, rDoc.GetParaAsString(static_cast(0))); } void Test::testMultiParaSelCopyPaste() { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 4cc64f90a766..40d8804f0f4f 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -524,12 +524,12 @@ bool SvxAutoCorrect::FnChgOrdinalNumber( ( sEnd[0] == 'a' || sEnd[0] == 'o' || sEnd[0] == 'r' ) ) { auto aExtendedSuffixes = comphelper::sequenceToContainer< std::vector >(aSuffixes); - aExtendedSuffixes.push_back("as"); // plural form of 'a' - aExtendedSuffixes.push_back("os"); // plural form of 'o' - aExtendedSuffixes.push_back("ra"); // alternative form of 'a' - aExtendedSuffixes.push_back("ro"); // alternative form of 'o' - aExtendedSuffixes.push_back("ras"); // alternative form of "as" - aExtendedSuffixes.push_back("ros"); // alternative form of "os" + aExtendedSuffixes.push_back(u"as"_ustr); // plural form of 'a' + aExtendedSuffixes.push_back(u"os"_ustr); // plural form of 'o' + aExtendedSuffixes.push_back(u"ra"_ustr); // alternative form of 'a' + aExtendedSuffixes.push_back(u"ro"_ustr); // alternative form of 'o' + aExtendedSuffixes.push_back(u"ras"_ustr); // alternative form of "as" + aExtendedSuffixes.push_back(u"ros"_ustr); // alternative form of "os" aSuffixes = comphelper::containerToSequence(aExtendedSuffixes); } @@ -552,7 +552,7 @@ bool SvxAutoCorrect::FnChgOrdinalNumber( rDoc.Delete( nNumEnd + 1, nNumEnd + 2 ); nSuffixChanged = -1; } - rDoc.Insert( nNumEnd + 1, "." ); + rDoc.Insert( nNumEnd + 1, u"."_ustr ); nNumberChanged = 1; } diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 418b5dcfa7ef..542783faca5e 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -400,7 +400,7 @@ void OImageControlModel::read(const Reference& _rxInStream) bool OImageControlModel::impl_updateStreamForURL_lck( const OUString& _rURL, ValueChangeInstigator _eInstigator ) { OUString referer; - getPropertyValue("Referer") >>= referer; + getPropertyValue(u"Referer"_ustr) >>= referer; if (SvtSecurityOptions::isUntrustedReferer(referer)) { return false; } diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index adb92952ea02..53a2337ac429 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -758,7 +758,7 @@ namespace frm m_bProdStarted = false; OUString referer; - getPropertyValue("Referer") >>= referer; + getPropertyValue(u"Referer"_ustr) >>= referer; if (!SvtSecurityOptions::isUntrustedReferer(referer)) { // Kick off download (caution: can be synchronous). m_pMedium->Download(LINK(this, OClickableImageBaseModel, DownloadDoneLink)); diff --git a/framework/qa/cppunit/CheckXTitle.cxx b/framework/qa/cppunit/CheckXTitle.cxx index 227f89d7b240..175e473fdd91 100644 --- a/framework/qa/cppunit/CheckXTitle.cxx +++ b/framework/qa/cppunit/CheckXTitle.cxx @@ -40,8 +40,9 @@ CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle) // and asserts that the title doesn't change. // Load document - uno::Sequence aLoadArgs{ comphelper::makePropertyValue("Hidden", false) }; - loadWithParams("private:factory/swriter", aLoadArgs); + uno::Sequence aLoadArgs{ comphelper::makePropertyValue(u"Hidden"_ustr, + false) }; + loadWithParams(u"private:factory/swriter"_ustr, aLoadArgs); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xController(xModel->getCurrentController()); @@ -58,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle) xParser->parseStrict(printPreviewURL); uno::Reference xDispatchProvider(xModel->getCurrentController(), uno::UNO_QUERY); - xDispatchProvider->queryDispatch(printPreviewURL, "", 0); + xDispatchProvider->queryDispatch(printPreviewURL, u""_ustr, 0); uno::Reference xTitle2(xFrame, css::uno::UNO_QUERY); Scheduler::ProcessEventsToIdle(); @@ -71,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle) xParser->parseStrict(closePreviewURL); uno::Reference xDispatchProvider2(xModel->getCurrentController(), uno::UNO_QUERY); - xDispatchProvider2->queryDispatch(closePreviewURL, "", 0); + xDispatchProvider2->queryDispatch(closePreviewURL, u""_ustr, 0); uno::Reference xTitle3(xFrame, css::uno::UNO_QUERY); Scheduler::ProcessEventsToIdle(); @@ -84,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(Test, checkTitleSuggestedFileName) uno::Sequence aArguments = { comphelper::makePropertyValue(u"SuggestedSaveAsName"_ustr, u"suggestedname.odt"_ustr), comphelper::makePropertyValue(u"Hidden"_ustr, false) }; - loadWithParams("private:factory/swriter", aArguments); + loadWithParams(u"private:factory/swriter"_ustr, aArguments); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xController(xModel->getCurrentController()); uno::Reference xFrame(xController->getFrame(), uno::UNO_QUERY); @@ -100,8 +101,9 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) // Set the frame title, then cycle through default and print preview. Close the window // and check for infinite recursion. - uno::Sequence aLoadArgs{ comphelper::makePropertyValue("Hidden", false) }; - loadWithParams("private:factory/swriter", aLoadArgs); + uno::Sequence aLoadArgs{ comphelper::makePropertyValue(u"Hidden"_ustr, + false) }; + loadWithParams(u"private:factory/swriter"_ustr, aLoadArgs); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xController(xModel->getCurrentController()); @@ -116,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) util::URL printPreviewURL; printPreviewURL.Complete = u".uno::PrintPreview"_ustr; xParser->parseStrict(printPreviewURL); - xDispatchProvider->queryDispatch(printPreviewURL, "", 0); + xDispatchProvider->queryDispatch(printPreviewURL, u""_ustr, 0); Scheduler::ProcessEventsToIdle(); util::URL closePreviewURL; @@ -124,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) xParser->parseStrict(closePreviewURL); uno::Reference xDispatchProvider2(xModel->getCurrentController(), uno::UNO_QUERY); - xDispatchProvider2->queryDispatch(closePreviewURL, "", 0); + xDispatchProvider2->queryDispatch(closePreviewURL, u""_ustr, 0); Scheduler::ProcessEventsToIdle(); util::URL closeDocURL; @@ -137,7 +139,7 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) CPPUNIT_ASSERT_EQUAL(windowTitle, u"documentTitle"_ustr); - xDispatchProvider3->queryDispatch(closeDocURL, "", 0); + xDispatchProvider3->queryDispatch(closeDocURL, u""_ustr, 0); Scheduler::ProcessEventsToIdle(); } } diff --git a/sc/qa/extras/scfunctionlistobj.cxx b/sc/qa/extras/scfunctionlistobj.cxx index 431e63bd7ef2..f5260744a220 100644 --- a/sc/qa/extras/scfunctionlistobj.cxx +++ b/sc/qa/extras/scfunctionlistobj.cxx @@ -78,8 +78,9 @@ ScFunctionListObj::ScFunctionListObj() : UnoApiTest(u"/sc/qa/extras/testdocuments"_ustr) , XElementAccess(cppu::UnoType>::get()) , XIndexAccess(404) - , XNameAccess("IF") - , XServiceInfo("stardiv.StarCalc.ScFunctionListObj", "com.sun.star.sheet.FunctionDescriptions") + , XNameAccess(u"IF"_ustr) + , XServiceInfo(u"stardiv.StarCalc.ScFunctionListObj"_ustr, + u"com.sun.star.sheet.FunctionDescriptions"_ustr) { } diff --git a/sc/qa/unit/GoalSeekTest.cxx b/sc/qa/unit/GoalSeekTest.cxx index b9a3bbc6dbba..ae94c5dd40b3 100644 --- a/sc/qa/unit/GoalSeekTest.cxx +++ b/sc/qa/unit/GoalSeekTest.cxx @@ -42,7 +42,7 @@ CPPUNIT_TEST_FIXTURE(ScGoalSeekTest, testTdf161511) CPPUNIT_ASSERT(pModelObj); // Without the fix in place, this test would have crashed - sheet::GoalResult res = pModelObj->seekGoal(aFormulaCell, aVariableCell, "100"); + sheet::GoalResult res = pModelObj->seekGoal(aFormulaCell, aVariableCell, u"100"_ustr); CPPUNIT_ASSERT_EQUAL(0.0, res.Result); CPPUNIT_ASSERT_EQUAL(DBL_MAX, res.Divergence); } @@ -65,7 +65,7 @@ CPPUNIT_TEST_FIXTURE(ScGoalSeekTest, testTdf68034) ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); CPPUNIT_ASSERT(pModelObj); - sheet::GoalResult res = pModelObj->seekGoal(aFormulaCell, aVariableCell, "2"); + sheet::GoalResult res = pModelObj->seekGoal(aFormulaCell, aVariableCell, u"2"_ustr); // Without the fix in place, this test would have failed with // - Expected: 4 // - Actual : 0 diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 02b6783bfe44..d342e5ccefcc 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -3972,9 +3972,9 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLeftOverflowEdit) // Go to Cell B5000 uno::Sequence aPropertyValues = { - comphelper::makePropertyValue("ToPoint", OUString("$B$5000")), + comphelper::makePropertyValue(u"ToPoint"_ustr, u"$B$5000"_ustr), }; - dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues); + dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues); // Enter edit mode and select all text. aView.m_aTextSelectionResult.clear(); diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 4df58b5269a6..7c47bd1116ef 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -1508,7 +1508,7 @@ OUString ScIconSetFormat::getIconSetName( ScIconSetType eType ) if (pMap) return pMap->aName; - return ""; + return u""_ustr; } sal_Int32 ScIconSetFormat::getIconSetElements( ScIconSetType eType ) diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 8da65589ffb3..682dd3ea8411 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -110,8 +110,8 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( , mxSourceLabel(mxSourceFrame->weld_label_widget()) , mxDestFrame(m_xBuilder->weld_frame(u"frame1"_ustr)) , mxDestLabel(mxDestFrame->weld_label_widget()) - , mxOptions(m_xBuilder->weld_expander("options")) - , mxMore(m_xBuilder->weld_expander("more")) + , mxOptions(m_xBuilder->weld_expander(u"options"_ustr)) + , mxMore(m_xBuilder->weld_expander(u"more"_ustr)) { // Source UI Link aLink2 = LINK(this, ScPivotLayoutDialog, ToggleSource); diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index e8a582da45f7..3b05ca1b371e 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -148,7 +148,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pPa , m_xModifyPB(m_xBuilder->weld_button(u"modify"_ustr)) , m_xInvalidFT(m_xBuilder->weld_label(u"invalid"_ustr)) , m_xFrameLabel(m_xAssignFrame->weld_label_widget()) - , m_xExpander(m_xBuilder->weld_expander("more")) + , m_xExpander(m_xBuilder->weld_expander(u"more"_ustr)) { m_xEdName->set_height_request_by_rows(4); m_xEdAssign->SetReferences(this, m_xFrameLabel.get()); diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 8924e451231c..4e17921701e2 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -362,22 +362,22 @@ ScTPValidationValue::ScTPValidationValue(weld::Container* pPage, weld::DialogCon , maStrRange(ScResId(SCSTR_VALID_RANGE)) , maStrList(ScResId(SCSTR_VALID_LIST)) , m_pRefEdit(nullptr) - , m_xLbAllow(m_xBuilder->weld_combo_box("allow")) - , m_xCbAllow(m_xBuilder->weld_check_button("allowempty")) - , m_xCbCaseSens(m_xBuilder->weld_check_button("casesens")) - , m_xCbShow(m_xBuilder->weld_check_button("showlist")) - , m_xCbSort(m_xBuilder->weld_check_button("sortascend")) - , m_xFtValue(m_xBuilder->weld_label("valueft")) - , m_xLbValue(m_xBuilder->weld_combo_box("data")) - , m_xFtMin(m_xBuilder->weld_label("minft")) - , m_xMinGrid(m_xBuilder->weld_widget("mingrid")) - , m_xEdMin(new formula::RefEdit(m_xBuilder->weld_entry("min"))) - , m_xEdList(m_xBuilder->weld_text_view("minlist")) - , m_xFtMax(m_xBuilder->weld_label("maxft")) - , m_xEdMax(new formula::RefEdit(m_xBuilder->weld_entry("max"))) - , m_xFtHint(m_xBuilder->weld_label("hintft")) - , m_xBtnRef(new formula::RefButton(m_xBuilder->weld_button("validref"))) - , m_xRefGrid(m_xBuilder->weld_container("refgrid")) + , m_xLbAllow(m_xBuilder->weld_combo_box(u"allow"_ustr)) + , m_xCbAllow(m_xBuilder->weld_check_button(u"allowempty"_ustr)) + , m_xCbCaseSens(m_xBuilder->weld_check_button(u"casesens"_ustr)) + , m_xCbShow(m_xBuilder->weld_check_button(u"showlist"_ustr)) + , m_xCbSort(m_xBuilder->weld_check_button(u"sortascend"_ustr)) + , m_xFtValue(m_xBuilder->weld_label(u"valueft"_ustr)) + , m_xLbValue(m_xBuilder->weld_combo_box(u"data"_ustr)) + , m_xFtMin(m_xBuilder->weld_label(u"minft"_ustr)) + , m_xMinGrid(m_xBuilder->weld_widget(u"mingrid"_ustr)) + , m_xEdMin(new formula::RefEdit(m_xBuilder->weld_entry(u"min"_ustr))) + , m_xEdList(m_xBuilder->weld_text_view(u"minlist"_ustr)) + , m_xFtMax(m_xBuilder->weld_label(u"maxft"_ustr)) + , m_xEdMax(new formula::RefEdit(m_xBuilder->weld_entry(u"max"_ustr))) + , m_xFtHint(m_xBuilder->weld_label(u"hintft"_ustr)) + , m_xBtnRef(new formula::RefButton(m_xBuilder->weld_button(u"validref"_ustr))) + , m_xRefGrid(m_xBuilder->weld_container(u"refgrid"_ustr)) , m_pRefEditParent(m_xRefGrid.get()) , m_pBtnRefParent(m_xRefGrid.get()) { diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 7e29d16e7b3f..83e88ff1f549 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -37,19 +37,19 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* , maErrInvalidNameCellRefStr( ScResId(STR_ERR_NAME_INVALID_CELL_REF)) , maErrNameInUse ( ScResId(STR_ERR_NAME_EXISTS)) , maRangeMap( std::move(aRangeMap) ) - , m_xEdName(m_xBuilder->weld_entry("edit")) - , m_xEdRange(new formula::RefEdit(m_xBuilder->weld_entry("range"))) - , m_xRbRange(new formula::RefButton(m_xBuilder->weld_button("refbutton"))) - , m_xLbScope(m_xBuilder->weld_combo_box("scope")) - , m_xBtnRowHeader(m_xBuilder->weld_check_button("rowheader")) - , m_xBtnColHeader(m_xBuilder->weld_check_button("colheader")) - , m_xBtnPrintArea(m_xBuilder->weld_check_button("printarea")) - , m_xBtnCriteria(m_xBuilder->weld_check_button("filter")) - , m_xBtnAdd(m_xBuilder->weld_button("add")) - , m_xBtnCancel(m_xBuilder->weld_button("cancel")) - , m_xFtInfo(m_xBuilder->weld_label("label")) - , m_xExpander(m_xBuilder->weld_expander("more")) - , m_xFtRange(m_xBuilder->weld_label("label3")) + , m_xEdName(m_xBuilder->weld_entry(u"edit"_ustr)) + , m_xEdRange(new formula::RefEdit(m_xBuilder->weld_entry(u"range"_ustr))) + , m_xRbRange(new formula::RefButton(m_xBuilder->weld_button(u"refbutton"_ustr))) + , m_xLbScope(m_xBuilder->weld_combo_box(u"scope"_ustr)) + , m_xBtnRowHeader(m_xBuilder->weld_check_button(u"rowheader"_ustr)) + , m_xBtnColHeader(m_xBuilder->weld_check_button(u"colheader"_ustr)) + , m_xBtnPrintArea(m_xBuilder->weld_check_button(u"printarea"_ustr)) + , m_xBtnCriteria(m_xBuilder->weld_check_button(u"filter"_ustr)) + , m_xBtnAdd(m_xBuilder->weld_button(u"add"_ustr)) + , m_xBtnCancel(m_xBuilder->weld_button(u"cancel"_ustr)) + , m_xFtInfo(m_xBuilder->weld_label(u"label"_ustr)) + , m_xExpander(m_xBuilder->weld_expander(u"more"_ustr)) + , m_xFtRange(m_xBuilder->weld_label(u"label3"_ustr)) { m_xEdRange->SetReferences(this, m_xFtRange.get()); m_xRbRange->SetReferences(this, m_xEdRange.get()); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index ebfaf6a122fe..bb03fd6f0dab 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -58,21 +58,21 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParen , mbDataChanged(false) , mbCloseWithoutUndo(false) - , m_xEdName(m_xBuilder->weld_entry("name")) - , m_xFtAssign(m_xBuilder->weld_label("label3")) - , m_xEdAssign(new formula::RefEdit(m_xBuilder->weld_entry("range"))) - , m_xRbAssign(new formula::RefButton(m_xBuilder->weld_button("assign"))) - , m_xLbScope(m_xBuilder->weld_combo_box("scope")) - , m_xBtnPrintArea(m_xBuilder->weld_check_button("printrange")) - , m_xBtnColHeader(m_xBuilder->weld_check_button("colheader")) - , m_xBtnCriteria(m_xBuilder->weld_check_button("filter")) - , m_xBtnRowHeader(m_xBuilder->weld_check_button("rowheader")) - , m_xBtnAdd(m_xBuilder->weld_button("add")) - , m_xBtnDelete(m_xBuilder->weld_button("delete")) - , m_xBtnOk(m_xBuilder->weld_button("ok")) - , m_xBtnCancel(m_xBuilder->weld_button("cancel")) - , m_xFtInfo(m_xBuilder->weld_label("info")) - , m_xExpander(m_xBuilder->weld_expander("more")) + , m_xEdName(m_xBuilder->weld_entry(u"name"_ustr)) + , m_xFtAssign(m_xBuilder->weld_label(u"label3"_ustr)) + , m_xEdAssign(new formula::RefEdit(m_xBuilder->weld_entry(u"range"_ustr))) + , m_xRbAssign(new formula::RefButton(m_xBuilder->weld_button(u"assign"_ustr))) + , m_xLbScope(m_xBuilder->weld_combo_box(u"scope"_ustr)) + , m_xBtnPrintArea(m_xBuilder->weld_check_button(u"printrange"_ustr)) + , m_xBtnColHeader(m_xBuilder->weld_check_button(u"colheader"_ustr)) + , m_xBtnCriteria(m_xBuilder->weld_check_button(u"filter"_ustr)) + , m_xBtnRowHeader(m_xBuilder->weld_check_button(u"rowheader"_ustr)) + , m_xBtnAdd(m_xBuilder->weld_button(u"add"_ustr)) + , m_xBtnDelete(m_xBuilder->weld_button(u"delete"_ustr)) + , m_xBtnOk(m_xBuilder->weld_button(u"ok"_ustr)) + , m_xBtnCancel(m_xBuilder->weld_button(u"cancel"_ustr)) + , m_xFtInfo(m_xBuilder->weld_label(u"info"_ustr)) + , m_xExpander(m_xBuilder->weld_expander(u"more"_ustr)) { m_xEdAssign->SetReferences(this, m_xFtAssign.get()); m_xRbAssign->SetReferences(this, m_xEdAssign.get()); diff --git a/sd/qa/unit/AnnotationTest.cxx b/sd/qa/unit/AnnotationTest.cxx index 4883c7fb12ec..0f9e1c81ad0f 100644 --- a/sd/qa/unit/AnnotationTest.cxx +++ b/sd/qa/unit/AnnotationTest.cxx @@ -33,7 +33,7 @@ class AnnotationTest : public SdModelTestBase { public: AnnotationTest() - : SdModelTestBase("/sd/qa/unit/data/") + : SdModelTestBase(u"/sd/qa/unit/data/"_ustr) { } }; @@ -52,9 +52,9 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotation) rtl::Reference xAnnotation = pPage->createAnnotation(); CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); - xAnnotation->setAuthor("A"); + xAnnotation->setAuthor(u"A"_ustr); uno::Reference xText(xAnnotation->getTextRange()); - xText->setString("X"); + xText->setString(u"X"_ustr); xAnnotation->setPosition(geometry::RealPoint2D(0.0, 0.0)); xAnnotation->setSize(geometry::RealSize2D(10.0, 10.0)); @@ -72,9 +72,9 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotation) rtl::Reference xAnnotation = pPage->createAnnotation(); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); - xAnnotation->setAuthor("B"); + xAnnotation->setAuthor(u"B"_ustr); uno::Reference xText(xAnnotation->getTextRange()); - xText->setString("XXX"); + xText->setString(u"XXX"_ustr); xAnnotation->setPosition(geometry::RealPoint2D(10.0, 10.0)); xAnnotation->setSize(geometry::RealSize2D(10.0, 10.0)); @@ -100,7 +100,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationInsert) SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); @@ -117,9 +117,9 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDelete) SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(3), pPage->GetObjCount()); @@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDelete) uno::Sequence aPropertyValues(comphelper::InitPropertySequence({ { "Id", uno::Any(OUString::number(xAnnotation->GetId())) }, })); - dispatchCommand(mxComponent, ".uno:DeleteAnnotation", aPropertyValues); + dispatchCommand(mxComponent, u".uno:DeleteAnnotation"_ustr, aPropertyValues); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); @@ -156,8 +156,8 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationInsertUndoRedo) SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); @@ -169,24 +169,24 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationInsertUndoRedo) CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); - dispatchCommand(mxComponent, ".uno:Undo", {}); + dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->getAnnotations().size()); CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - dispatchCommand(mxComponent, ".uno:Redo", {}); + dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->getAnnotations().size()); CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); - dispatchCommand(mxComponent, ".uno:DeleteAnnotation", {}); + dispatchCommand(mxComponent, u".uno:DeleteAnnotation"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->getAnnotations().size()); CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - dispatchCommand(mxComponent, ".uno:Undo", {}); + dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->getAnnotations().size()); @@ -209,7 +209,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationUpdate) aArgs = comphelper::InitPropertySequence({ { "Text", uno::Any(u"Comment"_ustr) }, }); - dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); SdrObject* pObject = pPage->GetObj(0); @@ -234,7 +234,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationUpdate) { "PositionX", uno::Any(sal_Int32(1440)) }, { "PositionY", uno::Any(sal_Int32(14400)) } }); - dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs); + dispatchCommand(mxComponent, u".uno:EditAnnotation"_ustr, aArgs); CPPUNIT_ASSERT_DOUBLES_EQUAL(25.4, pAnnotationData->mxAnnotation->getPosition().X, 1E-4); CPPUNIT_ASSERT_DOUBLES_EQUAL(254.0, pAnnotationData->mxAnnotation->getPosition().Y, 1E-4); diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index ab66d016b665..e5c2a0dcc132 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -2027,7 +2027,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161023) CPPUNIT_ASSERT_EQUAL(u"a"_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight); // No more runs CPPUNIT_ASSERT_THROW(getRunFromParagraph(1, paragraph), container::NoSuchElementException); @@ -2041,7 +2041,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161023) CPPUNIT_ASSERT_EQUAL(u""_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; // Without the fix, this would fail with // - Expected: 10 // - Actual : 18 @@ -2058,7 +2058,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf161023) CPPUNIT_ASSERT_EQUAL(u"c"_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight); // No more runs CPPUNIT_ASSERT_THROW(getRunFromParagraph(1, paragraph), container::NoSuchElementException); diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 35641beeee2d..d4f8d54681dd 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -333,7 +333,7 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf156955) xmlDocUniquePtr pXmlDoc = load("odp/tdf156955.odp"); // Make sure text box has the right size - without the fix it was 2759. - assertXPath(pXmlDoc, "/metafile/push/push/textarray[5]"_ostr, "y"_ostr, "3183"); + assertXPath(pXmlDoc, "/metafile/push/push/textarray[5]"_ostr, "y"_ostr, u"3183"_ustr); } CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf148966) diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 635696cd3695..4c411f94f6f7 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -840,7 +840,7 @@ void SdDrawDocument::UpdateAllLinks() rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true); } - m_pLinkManager->UpdateAllLinks(true, false, nullptr, ""); // query box: update all links? + m_pLinkManager->UpdateAllLinks(true, false, nullptr, u""_ustr); // query box: update all links? if (s_pDocLockedInsertingLinks == this) s_pDocLockedInsertingLinks = nullptr; // unlock inserting links diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx index 31d92148e6ab..8a60b16b3482 100644 --- a/sd/source/ui/framework/module/ModuleController.cxx +++ b/sd/source/ui/framework/module/ModuleController.cxx @@ -49,21 +49,21 @@ ModuleController::ModuleController(const rtl::Reference<::sd::DrawController>& r mpResourceToFactoryMap member. */ ProcessFactory( - "com.sun.star.drawing.framework.BasicPaneFactory", - { "private:resource/pane/CenterPane", - "private:resource/pane/LeftImpressPane", - "private:resource/pane/BottomImpressPane", - "private:resource/pane/LeftDrawPane" }); + u"com.sun.star.drawing.framework.BasicPaneFactory"_ustr, + { u"private:resource/pane/CenterPane"_ustr, + u"private:resource/pane/LeftImpressPane"_ustr, + u"private:resource/pane/BottomImpressPane"_ustr, + u"private:resource/pane/LeftDrawPane"_ustr }); ProcessFactory( - "com.sun.star.drawing.framework.BasicViewFactory", - { "private:resource/view/ImpressView", - "private:resource/view/GraphicView", - "private:resource/view/OutlineView", - "private:resource/view/NotesView", - "private:resource/view/NotesPanelView", - "private:resource/view/HandoutView", - "private:resource/view/SlideSorter", - "private:resource/view/PresentationView" }); + u"com.sun.star.drawing.framework.BasicViewFactory"_ustr, + { u"private:resource/view/ImpressView"_ustr, + u"private:resource/view/GraphicView"_ustr, + u"private:resource/view/OutlineView"_ustr, + u"private:resource/view/NotesView"_ustr, + u"private:resource/view/NotesPanelView"_ustr, + u"private:resource/view/HandoutView"_ustr, + u"private:resource/view/SlideSorter"_ustr, + u"private:resource/view/PresentationView"_ustr }); ProcessFactory( u"com.sun.star.drawing.framework.BasicToolBarFactory"_ustr, { u"private:resource/toolbar/ViewTabBar"_ustr }); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 5778ceb37980..ec594ddedac4 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -624,8 +624,8 @@ SfxDocumentDescPage::SfxDocumentDescPage(weld::Container* pPage, weld::DialogCon , m_xTitleEd(m_xBuilder->weld_entry(u"title"_ustr)) , m_xThemaEd(m_xBuilder->weld_entry(u"subject"_ustr)) , m_xKeywordsEd(m_xBuilder->weld_entry(u"keywords"_ustr)) - , m_xMoreTypes(m_xBuilder->weld_combo_box("cbMoreTypes")) - , m_xMoreValue(m_xBuilder->weld_entry("edMoreValue")) + , m_xMoreTypes(m_xBuilder->weld_combo_box(u"cbMoreTypes"_ustr)) + , m_xMoreValue(m_xBuilder->weld_entry(u"edMoreValue"_ustr)) , m_xCommentEd(m_xBuilder->weld_text_view(u"comments"_ustr)) { m_xCommentEd->set_size_request(-1, //m_xKeywordsEd->get_preferred_size().Width(), diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ffa63ca0585d..b5bd686aa62a 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1645,7 +1645,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) wantsWhatsNew = false; if (officecfg::Setup::Product::WhatsNew::get()) { - VclPtr pInfoBar = AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO); + VclPtr pInfoBar = AppendInfoBar(u"whatsnew"_ustr, u""_ustr, SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO); if (pInfoBar) { weld::Button& rWhatsNewButton = pInfoBar->addButton(); diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index 5f16baae175d..450874b00e07 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -830,10 +830,10 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testContourText) // Text should be inside the shape and start at the bottom-right of the shape because of 180° // rotation. Without fix the text was rotated but positioned left-top of the shape. The first // line of text has started at (10000|7353), last line at (10000|5007). - assertXPath(pXmlDoc, "(//textsimpleportion)[1]"_ostr, "x"_ostr, "15998"); - assertXPath(pXmlDoc, "(//textsimpleportion)[1]"_ostr, "y"_ostr, "11424"); - assertXPath(pXmlDoc, "(//textsimpleportion)[4]"_ostr, "x"_ostr, "15998"); - assertXPath(pXmlDoc, "(//textsimpleportion)[4]"_ostr, "y"_ostr, "9291"); + assertXPath(pXmlDoc, "(//textsimpleportion)[1]"_ostr, "x"_ostr, u"15998"_ustr); + assertXPath(pXmlDoc, "(//textsimpleportion)[1]"_ostr, "y"_ostr, u"11424"_ustr); + assertXPath(pXmlDoc, "(//textsimpleportion)[4]"_ostr, "x"_ostr, u"15998"_ustr); + assertXPath(pXmlDoc, "(//textsimpleportion)[4]"_ostr, "y"_ostr, u"9291"_ustr); } CPPUNIT_TEST_FIXTURE(SvdrawTest, testContourTextCJK) diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx index 0ce9057012e0..8e06d125ae4f 100644 --- a/svx/source/tbxctrls/bulletsnumbering.cxx +++ b/svx/source/tbxctrls/bulletsnumbering.cxx @@ -235,7 +235,7 @@ IMPL_LINK_NOARG(NumberingPopup, VSSelectValueSetDocHdl, ValueSet*, void) OUString sFont(aCustomBullets[nSelItem].second); auto aArgs(comphelper::InitPropertySequence( { { "BulletChar", css::uno::Any(nChar) }, { "BulletFont", css::uno::Any(sFont) } })); - mrController.dispatchCommand(".uno:SetBullet", aArgs); + mrController.dispatchCommand(u".uno:SetBullet"_ustr, aArgs); mrController.EndPopupMode(); } diff --git a/sw/qa/core/text/txtfly.cxx b/sw/qa/core/text/txtfly.cxx index 461ed81e2203..0160258ebc47 100644 --- a/sw/qa/core/text/txtfly.cxx +++ b/sw/qa/core/text/txtfly.cxx @@ -24,7 +24,7 @@ class Test : public SwModelTestBase { public: Test() - : SwModelTestBase("/sw/qa/core/text/data/") + : SwModelTestBase(u"/sw/qa/core/text/data/"_ustr) { } }; diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 4132c3bddcc5..b8ae7c8c6a41 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -869,9 +869,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - "C DE"); + u"C DE"_ustr); // 5 is empty and hidden - assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); @@ -892,7 +892,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) // 5 is an empty paragraph with RES_CHRATR_HIDDEN which results in 0-height // frame; ideally it should only be hidden when control codes are hidden // and be a full-height frame now, but that needs more work... - assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pXmlDoc, "/root/page/body/txt[5]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); dispatchCommand(mxComponent, u".uno:ControlCodes"_ustr, {}); @@ -901,9 +901,9 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872) assertXPath(pXmlDoc, "/root/page[1]/body/txt"_ostr, 2); assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, "portion"_ostr, - "C DE"); + u"C DE"_ustr); // 5 is empty and hidden - assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf151954) @@ -2339,7 +2339,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116925) assertXPathContent( pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[6]/push[1]/push[3]/textarray/text"_ostr, - "hello"); + u"hello"_ustr); // This failed, text color was #000000. assertXPath( pXmlDoc, diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index ea0798af021e..3c75e2a20183 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -2765,7 +2765,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_page_break) assertXPath(pExportDump, "//page/body/txt"_ostr, 3); assertXPath(pExportDump, "//page/body/section"_ostr, 1); - assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); assertXPath(pExportDump, "//page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 6); assertXPath(pExportDump, "//page/body/section/txt"_ostr, 7); assertXPath(pExportDump, "//page/body/section/txt[1]/SwParaPortion"_ostr, 0); @@ -2854,7 +2854,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf160958_orphans) assertXPath(pExportDump, "//page"_ostr, 1); assertXPath(pExportDump, "//page/body/txt"_ostr, 22); assertXPath(pExportDump, "//page/body/section"_ostr, 1); - assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, "0"); + assertXPath(pExportDump, "//page/body/section/infos/bounds"_ostr, "height"_ostr, u"0"_ustr); // Show the section again xSection->setPropertyValue(u"IsVisible"_ustr, css::uno::Any(true)); diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 2bce72b8ec61..9eb4048e2b4c 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -239,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_always) CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_table) { uno::Reference xHyphenator = LinguMgr::GetHyphenator(); - if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) return; // last full line of the table is not hyphenated on page 1 @@ -248,14 +248,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_table) // This was 2 (not handling hyphenation-keep in tables) CPPUNIT_ASSERT_EQUAL(3, getPages()); - xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); assertXPath(pXmlDoc, "//style:style[@style:family='paragraph']/style:paragraph-properties[@loext:hyphenation-keep-type='page']"_ostr, 1); } CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_default_paragraph_style) { uno::Reference xHyphenator = LinguMgr::GetHyphenator(); - if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) return; // fo:hyphenation-keep="page" defined in default paragraph style @@ -266,7 +266,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_default_paragraph_style) CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto_in_default_paragraph_style) { uno::Reference xHyphenator = LinguMgr::GetHyphenator(); - if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) return; // fo:hyphenation-keep="auto" defined in default paragraph style @@ -277,7 +277,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto_in_default_paragraph_style) CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_text_body_style) { uno::Reference xHyphenator = LinguMgr::GetHyphenator(); - if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) return; // fo:hyphenation-keep="page" defined in text body style @@ -288,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132599_page_in_text_body_style) CPPUNIT_TEST_FIXTURE(Test, testTdf132599_auto_in_text_body_style) { uno::Reference xHyphenator = LinguMgr::GetHyphenator(); - if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString()))) + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) return; // fo:hyphenation-keep="auto" defined in text body style @@ -1689,13 +1689,13 @@ DECLARE_ODFEXPORT_TEST(testTdf160877, "tdf160877.odt") CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference xHeaderTextPage1 = getProperty>( - getStyles("PageStyles")->getByName("Standard"), "HeaderTextFirst"); - CPPUNIT_ASSERT_EQUAL(OUString("Classification: General Business"), xHeaderTextPage1->getString()); + getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), u"HeaderTextFirst"_ustr); + CPPUNIT_ASSERT_EQUAL(u"Classification: General Business"_ustr, xHeaderTextPage1->getString()); // Without the fix in place, this test would have failed with // - Expected: (Sign GB)Test // - Actual : Test - CPPUNIT_ASSERT_EQUAL(OUString("(Sign GB)Test"), getParagraph(1)->getString()); + CPPUNIT_ASSERT_EQUAL(u"(Sign GB)Test"_ustr, getParagraph(1)->getString()); } CPPUNIT_TEST_FIXTURE(Test, testMidnightRedlineDatetime) diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index d6bd2827ce74..6ce472d683e3 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -1579,7 +1579,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161054) CPPUNIT_ASSERT_EQUAL(u"a"_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight); // No more runs CPPUNIT_ASSERT_THROW(getRun(paragraph, 2), container::NoSuchElementException); @@ -1593,7 +1593,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161054) CPPUNIT_ASSERT_EQUAL(u""_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; // Without the fix, this would fail with // - Expected: 10 // - Actual : 18 @@ -1610,7 +1610,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf161054) CPPUNIT_ASSERT_EQUAL(u"c"_ustr, run->getString()); uno::Reference xPropSet(run, uno::UNO_QUERY_THROW); double fCharHeight = 0; - xPropSet->getPropertyValue("CharHeight") >>= fCharHeight; + xPropSet->getPropertyValue(u"CharHeight"_ustr) >>= fCharHeight; CPPUNIT_ASSERT_EQUAL(10.0, fCharHeight); // No more runs CPPUNIT_ASSERT_THROW(getRun(paragraph, 2), container::NoSuchElementException); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index e09d97912d28..3712cb56bade 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -716,14 +716,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf156484, "tdf156484.docx") { auto xShape(getShape(1)); // Without the fix in place, this test would have failed here - CPPUNIT_ASSERT_MESSAGE("First shape should not be visible.", !getProperty(xShape, "Visible")); - CPPUNIT_ASSERT_MESSAGE("First shape should not be printable.", !getProperty(xShape, "Printable")); + CPPUNIT_ASSERT_MESSAGE("First shape should not be visible.", !getProperty(xShape, u"Visible"_ustr)); + CPPUNIT_ASSERT_MESSAGE("First shape should not be printable.", !getProperty(xShape, u"Printable"_ustr)); xShape = getShape(2); - CPPUNIT_ASSERT_MESSAGE("Second shape should not be visible.", !getProperty(xShape, "Visible")); - CPPUNIT_ASSERT_MESSAGE("Second shape should not be printable.", !getProperty(xShape, "Printable")); + CPPUNIT_ASSERT_MESSAGE("Second shape should not be visible.", !getProperty(xShape, u"Visible"_ustr)); + CPPUNIT_ASSERT_MESSAGE("Second shape should not be printable.", !getProperty(xShape, u"Printable"_ustr)); xShape = getShape(3); - CPPUNIT_ASSERT_MESSAGE("Third shape should not be visible.", !getProperty(xShape, "Visible")); - CPPUNIT_ASSERT_MESSAGE("Third shape should not be printable.", !getProperty(xShape, "Printable")); + CPPUNIT_ASSERT_MESSAGE("Third shape should not be visible.", !getProperty(xShape, u"Visible"_ustr)); + CPPUNIT_ASSERT_MESSAGE("Third shape should not be printable.", !getProperty(xShape, u"Printable"_ustr)); } DECLARE_OOXMLEXPORT_TEST(testTdf124594, "tdf124594.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 47ac22113db4..d1e3647b9826 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -1498,8 +1498,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_page_in_default_paragraph_style) { // default paragraph style contains hyphenation settings loadAndReload("tdf160518_page_in_default_paragraph_style.fodt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, "1"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, u"1"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, 0); } @@ -1507,17 +1507,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_auto_in_default_paragraph_style) { // default paragraph style contains hyphenation settings loadAndReload("tdf160518_auto_in_default_paragraph_style.fodt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, "1"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, "val"_ostr, "1"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, u"1"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, "val"_ostr, u"1"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testTdf160518_page_in_text_body_style) { // text body style contains hyphenation settings loadAndReload("tdf160518_page_in_text_body_style.fodt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, "1"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, u"1"_ustr); assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, 0); } @@ -1525,9 +1525,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160518_auto_in_text_body_style) { // text body style contains hyphenation settings loadAndReload("tdf160518_auto_in_text_body_style.fodt"); - xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, "1"); - assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, "val"_ostr, "1"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='useWord2013TrackBottomHyphenation']"_ostr, "val"_ostr, u"1"_ustr); + assertXPath(pXmlDoc, "/w:settings/w:compat/w:compatSetting[@w:name='allowHyphenationAtTrackBottom']"_ostr, "val"_ostr, u"1"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testHyphenationAuto) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 58f833d85732..cfc7d5fa1a16 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -1053,12 +1053,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf159158_zOrder_headerBehind2, "tdf159158_zOrder_h // and an overlapping blue rectangle anchored in the body text. uno::Reference zOrder0(getShape(1), uno::UNO_QUERY); uno::Reference zOrder1(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, "ZOrder")); // lower - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, "ZOrder")); // higher - CPPUNIT_ASSERT_EQUAL(OUString("HeaderImage"), - getProperty(zOrder0, "LinkDisplayName")); - CPPUNIT_ASSERT_EQUAL(OUString("BodyBlueRectangle"), - getProperty(zOrder1, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, u"ZOrder"_ustr)); // lower + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, u"ZOrder"_ustr)); // higher + CPPUNIT_ASSERT_EQUAL(u"HeaderImage"_ustr, + getProperty(zOrder0, u"LinkDisplayName"_ustr)); + CPPUNIT_ASSERT_EQUAL(u"BodyBlueRectangle"_ustr, + getProperty(zOrder1, u"LinkDisplayName"_ustr)); // The logo should not be opaque since it is in the header. CPPUNIT_ASSERT(!getProperty(zOrder0, u"Opaque"_ustr)); // logo should be invisible CPPUNIT_ASSERT(!getProperty(zOrder1, u"Opaque"_ustr)); @@ -1070,10 +1070,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder, "tdf100037_inlineZOrder.doc // an inline image should always be behind a heaven-layer floating object. uno::Reference zOrder0(getShape(1), uno::UNO_QUERY); uno::Reference zOrder1(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, "ZOrder")); // lower - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, "ZOrder")); // higher - CPPUNIT_ASSERT_EQUAL(OUString("Image 2"), getProperty(zOrder0, "LinkDisplayName")); - CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty(zOrder1, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, u"ZOrder"_ustr)); // lower + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, u"ZOrder"_ustr)); // higher + CPPUNIT_ASSERT_EQUAL(u"Image 2"_ustr, getProperty(zOrder0, u"LinkDisplayName"_ustr)); + CPPUNIT_ASSERT_EQUAL(u"Frame1"_ustr, getProperty(zOrder1, u"LinkDisplayName"_ustr)); } DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder2, "tdf100037_inlineZOrder2.docx") @@ -1087,14 +1087,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder2, "tdf100037_inlineZOrder2.d uno::Reference zOrder1(getShape(2), uno::UNO_QUERY); uno::Reference zOrder2(getShape(3), uno::UNO_QUERY); uno::Reference zOrder3(getShape(4), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, "ZOrder")); // lower - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(zOrder2, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty(zOrder3, "ZOrder")); // higher + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, u"ZOrder"_ustr)); // lower + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, u"ZOrder"_ustr)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(zOrder2, u"ZOrder"_ustr)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty(zOrder3, u"ZOrder"_ustr)); // higher // yellow textbox (Frame1) is the lowest - CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty(zOrder0, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(u"Frame1"_ustr, getProperty(zOrder0, u"LinkDisplayName"_ustr)); //CPPUNIT_ASSERT_EQUAL(OUString("Image1"), getProperty(zOrder1, "Name")); - CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), getProperty(zOrder2, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(u"Frame2"_ustr, getProperty(zOrder2, u"LinkDisplayName"_ustr)); // CPPUNIT_ASSERT_EQUAL(OUString("Image2"), getProperty(zOrder3, "LinkDisplayName")); } @@ -1109,14 +1109,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder3, "tdf100037_inlineZOrder3.d uno::Reference zOrder1(getShape(2), uno::UNO_QUERY); uno::Reference zOrder2(getShape(3), uno::UNO_QUERY); uno::Reference zOrder3(getShape(4), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, "ZOrder")); // lower - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(zOrder2, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty(zOrder3, "ZOrder")); // higher + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(zOrder0, u"ZOrder"_ustr)); // lower + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(zOrder1, u"ZOrder"_ustr)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(zOrder2, u"ZOrder"_ustr)); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty(zOrder3, u"ZOrder"_ustr)); // higher // blue textbox (Frame2) is the lowest - CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), getProperty(zOrder0, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(u"Frame2"_ustr, getProperty(zOrder0, u"LinkDisplayName"_ustr)); // CPPUNIT_ASSERT_EQUAL(OUString("Image2"), getProperty(zOrder1, "LinkDisplayName")); - CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty(zOrder2, "LinkDisplayName")); + CPPUNIT_ASSERT_EQUAL(u"Frame1"_ustr, getProperty(zOrder2, u"LinkDisplayName"_ustr)); // CPPUNIT_ASSERT_EQUAL(OUString("Image1"), getProperty(zOrder3, "LinkDisplayName")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index a2636ef97e8a..81a5703b9ced 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -319,18 +319,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf158597, "tdf158597.docx") DECLARE_OOXMLEXPORT_TEST(testTdf156105_percentSuffix, "tdf156105_percentSuffix.odt") { // given a numbered list with a non-escaping percent symbol in the prefix and suffix - CPPUNIT_ASSERT_EQUAL(OUString("(%)[%]"), - getProperty(getParagraph(3), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL(u"(%)[%]"_ustr, + getProperty(getParagraph(3), u"ListLabelString"_ustr)); // tdf#149258 - NONE number should not export separator since LO doesn't currently show it - CPPUNIT_ASSERT_EQUAL_MESSAGE("showing levels 1, 2, and 4", OUString("(%)1.1.1[%]"), - getProperty(getParagraph(4), "ListLabelString")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("showing levels 1, 2, and 4", u"(%)1.1.1[%]"_ustr, + getProperty(getParagraph(4), u"ListLabelString"_ustr)); if (isExported()) { - xmlDocUniquePtr pXmlNum = parseExport("word/numbering.xml"); + xmlDocUniquePtr pXmlNum = parseExport(u"word/numbering.xml"_ustr); // The 3rd level is NONE. If we include the separator, MS Word will display it. assertXPath(pXmlNum, "/w:numbering/w:abstractNum[1]/w:lvl[4]/w:lvlText"_ostr, "val"_ostr, - "(%)%1.%2.%3%4[%]"); + u"(%)%1.%2.%3%4[%]"_ustr); } } @@ -570,8 +570,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf131098_imageFill, "tdf131098_imageFill.docx") { // given a document with an image background transparency (blue-white) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, - getProperty(getShape(1), "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), getProperty(getShape(1), "FillColor")); + getProperty(getShape(1), u"FillStyle"_ustr)); + CPPUNIT_ASSERT_EQUAL(Color(0x729fcf), getProperty(getShape(1), u"FillColor"_ustr)); } DECLARE_OOXMLEXPORT_TEST(testTdf154369, "tdf154369.docx") @@ -599,11 +599,11 @@ CPPUNIT_TEST_FIXTURE(Test, testScreenTip) { loadAndSave("tdf159897.docx"); - xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + xmlDocUniquePtr pXmlDocument = parseExport(u"word/document.xml"_ustr); // Hyperlink with ScreenTip assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:hyperlink"_ostr, "tooltip"_ostr, - "This is a hyperlink"); + u"This is a hyperlink"_ustr); } CPPUNIT_TEST_FIXTURE(Test, testEmptyObjectRange) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index fbd5ae53647b..6b91c7814321 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -318,7 +318,7 @@ CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeleft) CPPUNIT_TEST_FIXTURE(Test, testOldComplexMergeTableInTable) { loadAndSave("ooo96040-2.odt"); - parseExport("word/document.xml"); + parseExport(u"word/document.xml"_ustr); // Check tdf#161202 - this document has all kinds of tables inside hidden sections. // The page count must be 13, but for unclear reason, it is 12 in some tests on Linux diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 0c6e780c5a1e..f35c33931dd3 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -64,8 +64,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159897Broken_link) { auto xPara(getParagraph(i)); auto xRun = getRun(xPara, 0); - OUString sURL = getProperty(xRun, "HyperLinkURL"); - CPPUNIT_ASSERT_EQUAL(OUString("https://libreoffice.org/"), sURL); + OUString sURL = getProperty(xRun, u"HyperLinkURL"_ustr); + CPPUNIT_ASSERT_EQUAL(u"https://libreoffice.org/"_ustr, sURL); OUString sText; switch (i) @@ -99,7 +99,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159897Broken_link) break; } - OUString sScreenTip = getProperty(xRun, "HyperLinkName"); + OUString sScreenTip = getProperty(xRun, u"HyperLinkName"_ustr); CPPUNIT_ASSERT_EQUAL(sText, sScreenTip); } } diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index 57162cf30df1..a22b46e0ed06 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -38,7 +38,7 @@ class Test : public SwModelTestBase { public: Test() - : SwModelTestBase("/sw/qa/extras/rtfexport/data/", "Rich Text Format") + : SwModelTestBase(u"/sw/qa/extras/rtfexport/data/"_ustr, u"Rich Text Format"_ustr) { } }; @@ -48,7 +48,7 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureWrapPolygon) auto verify = [this]() { // The problem was that the wrap polygon was ignored during import. drawing::PointSequenceSequence aSeqSeq - = getProperty(getShape(1), "ContourPolyPolygon"); + = getProperty(getShape(1), u"ContourPolyPolygon"_ustr); // This was 0: the polygon list was empty. CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength()); @@ -57,9 +57,9 @@ CPPUNIT_TEST_FIXTURE(Test, testPictureWrapPolygon) // The shape also didn't have negative top / left coordinates. CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)), - getProperty(getShape(1), "HoriOrientPosition")); + getProperty(getShape(1), u"HoriOrientPosition"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)), - getProperty(getShape(1), "VertOrientPosition")); + getProperty(getShape(1), u"VertOrientPosition"_ustr)); }; createSwDoc("picture-wrap-polygon.rtf"); verify(); @@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113408) auto verify = [this]() { // This was 0, left margin was not inherited from style properly. CPPUNIT_ASSERT_EQUAL(static_cast(1270), - getProperty(getParagraph(1), "ParaLeftMargin")); + getProperty(getParagraph(1), u"ParaLeftMargin"_ustr)); }; createSwDoc("tdf113408.rtf"); verify(); @@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAbi10039) CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure we don't just crash on export, and additionally the shape should not be inline (as it's at-page anchored originally). CPPUNIT_ASSERT(text::TextContentAnchorType_AS_CHARACTER - != getProperty(getShape(1), "AnchorType")); + != getProperty(getShape(1), u"AnchorType"_ustr)); } CPPUNIT_TEST_FIXTURE(Test, testAbi10076) @@ -101,18 +101,23 @@ CPPUNIT_TEST_FIXTURE(Test, testEm) { auto verify = [this]() { // Test all possible \acc* control words. - CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE, - getProperty(getRun(getParagraph(1), 1), "CharEmphasis")); - CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE, - getProperty(getRun(getParagraph(1), 2), "CharEmphasis")); - CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::ACCENT_ABOVE, - getProperty(getRun(getParagraph(1), 3), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL( + text::FontEmphasis::NONE, + getProperty(getRun(getParagraph(1), 1), u"CharEmphasis"_ustr)); + CPPUNIT_ASSERT_EQUAL( + text::FontEmphasis::DOT_ABOVE, + getProperty(getRun(getParagraph(1), 2), u"CharEmphasis"_ustr)); + CPPUNIT_ASSERT_EQUAL( + text::FontEmphasis::ACCENT_ABOVE, + getProperty(getRun(getParagraph(1), 3), u"CharEmphasis"_ustr)); // This was missing. - CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::CIRCLE_ABOVE, - getProperty(getRun(getParagraph(1), 4), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL( + text::FontEmphasis::CIRCLE_ABOVE, + getProperty(getRun(getParagraph(1), 4), u"CharEmphasis"_ustr)); // This one, too. - CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_BELOW, - getProperty(getRun(getParagraph(1), 5), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL( + text::FontEmphasis::DOT_BELOW, + getProperty(getRun(getParagraph(1), 5), u"CharEmphasis"_ustr)); }; createSwDoc("em.rtf"); verify(); @@ -124,10 +129,10 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingFont) { auto verify = [this]() { uno::Reference xStyle( - getStyles("CharacterStyles")->getByName("ListLabel 1"), uno::UNO_QUERY); + getStyles(u"CharacterStyles"_ustr)->getByName(u"ListLabel 1"_ustr), uno::UNO_QUERY); // This was Liberation Serif, i.e. custom font of the numbering itself ("1.\t") was lost on import. - CPPUNIT_ASSERT_EQUAL(OUString("Impact"), getProperty(xStyle, "CharFontName")); - CPPUNIT_ASSERT_EQUAL(72.f, getProperty(xStyle, "CharHeight")); + CPPUNIT_ASSERT_EQUAL(u"Impact"_ustr, getProperty(xStyle, u"CharFontName"_ustr)); + CPPUNIT_ASSERT_EQUAL(72.f, getProperty(xStyle, u"CharHeight"_ustr)); }; createSwDoc("numbering-font.rtf"); verify(); @@ -145,7 +150,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82860) // 2) The exporter did not handle "shape with textbox" text. uno::Reference xTextRange(getShape(1), uno::UNO_QUERY); uno::Reference xText = xTextRange->getText(); - CPPUNIT_ASSERT_EQUAL(OUString("hello"), getParagraphOfText(1, xText)->getString()); + CPPUNIT_ASSERT_EQUAL(u"hello"_ustr, getParagraphOfText(1, xText)->getString()); } CPPUNIT_TEST_FIXTURE(Test, testFdo82858) @@ -153,19 +158,21 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82858) loadAndReload("fdo82858.docx"); // This was table::BorderLineStyle::SOLID, exporter failed to write explicit no line when line color was written. CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, - getProperty(getShape(1), "TopBorder").LineStyle); + getProperty(getShape(1), u"TopBorder"_ustr).LineStyle); } CPPUNIT_TEST_FIXTURE(Test, testTdf104936) { auto verify = [this]() { uno::Reference xShape1(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(static_cast(0), getProperty(xShape1, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(static_cast(0), + getProperty(xShape1, u"ZOrder"_ustr)); // This failed, the shape without text covered the shape with text. CPPUNIT_ASSERT(xShape1->getString().isEmpty()); uno::Reference xShape2(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(static_cast(1), getProperty(xShape2, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xShape2->getString()); + CPPUNIT_ASSERT_EQUAL(static_cast(1), + getProperty(xShape2, u"ZOrder"_ustr)); + CPPUNIT_ASSERT_EQUAL(u"Hello"_ustr, xShape2->getString()); }; createSwDoc("tdf104936.rtf"); verify(); @@ -182,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableRtl) uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); // This was text::WritingMode2::LR_TB, i.e. direction of the table was ignored. CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, - getProperty(xTable, "WritingMode")); + getProperty(xTable, u"WritingMode"_ustr)); }; createSwDoc("table-rtl.rtf"); verify(); @@ -196,13 +203,14 @@ CPPUNIT_TEST_FIXTURE(Test, testNumOverrideStart) // The numbering on the second level was "3.1", not "1.3". uno::Reference xRules = getProperty>( - getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); - CPPUNIT_ASSERT_EQUAL( - sal_Int16(1), - comphelper::SequenceAsHashMap(xRules->getByIndex(0))["StartWith"].get()); - CPPUNIT_ASSERT_EQUAL( - sal_Int16(3), - comphelper::SequenceAsHashMap(xRules->getByIndex(1))["StartWith"].get()); + getStyles(u"NumberingStyles"_ustr)->getByName(u"WWNum1"_ustr), + u"NumberingRules"_ustr); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), + comphelper::SequenceAsHashMap(xRules->getByIndex(0))[u"StartWith"_ustr] + .get()); + CPPUNIT_ASSERT_EQUAL(sal_Int16(3), + comphelper::SequenceAsHashMap(xRules->getByIndex(1))[u"StartWith"_ustr] + .get()); }; createSwDoc("num-override-start.rtf"); verify(); @@ -215,13 +223,13 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo82006) auto verify = [this]() { // These were 176 (100 twips), as \sbauto and \sbbefore were ignored. CPPUNIT_ASSERT_EQUAL(sal_Int32(0), - getProperty(getParagraph(1), "ParaTopMargin")); + getProperty(getParagraph(1), u"ParaTopMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(1), "ParaBottomMargin")); + getProperty(getParagraph(1), u"ParaBottomMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(2), "ParaTopMargin")); + getProperty(getParagraph(2), u"ParaTopMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(2), "ParaBottomMargin")); + getProperty(getParagraph(2), u"ParaBottomMargin"_ustr)); }; createSwDoc("fdo82006.rtf"); verify(); @@ -234,9 +242,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104081) auto verify = [this]() { // These were 494 (280 twips), as \htmautsp was ignored. CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(100)), - getProperty(getParagraph(1), "ParaTopMargin")); + getProperty(getParagraph(1), u"ParaTopMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(100)), - getProperty(getParagraph(1), "ParaBottomMargin")); + getProperty(getParagraph(1), u"ParaBottomMargin"_ustr)); }; createSwDoc("tdf104081.rtf"); verify(); @@ -250,8 +258,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88583) CPPUNIT_ASSERT_EQUAL(1, getPages()); // This was FillStyle_NONE, as background color was missing from the color table during export. CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, - getProperty(getParagraph(1), "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x00cc00), getProperty(getParagraph(1), "FillColor")); + getProperty(getParagraph(1), u"FillStyle"_ustr)); + CPPUNIT_ASSERT_EQUAL(Color(0x00cc00), getProperty(getParagraph(1), u"FillColor"_ustr)); } CPPUNIT_TEST_FIXTURE(Test, testMargmirror) @@ -259,9 +267,10 @@ CPPUNIT_TEST_FIXTURE(Test, testMargmirror) auto verify = [this]() { // \margmirror was not handled, this was PageStyleLayout_ALL. uno::Reference xPageStyle( - getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(style::PageStyleLayout_MIRRORED, - getProperty(xPageStyle, "PageStyleLayout")); + getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( + style::PageStyleLayout_MIRRORED, + getProperty(xPageStyle, u"PageStyleLayout"_ustr)); }; createSwDoc("margmirror.rtf"); verify(); @@ -274,11 +283,11 @@ CPPUNIT_TEST_FIXTURE(Test, testSautoupd) auto verify = [this]() { // \sautoupd was ignored during import and export. uno::Reference xHeading1( - getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, getProperty(xHeading1, "IsAutoUpdate")); + getStyles(u"ParagraphStyles"_ustr)->getByName(u"Heading 1"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty(xHeading1, u"IsAutoUpdate"_ustr)); uno::Reference xHeading2( - getStyles("ParagraphStyles")->getByName("Heading 2"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(false, getProperty(xHeading2, "IsAutoUpdate")); + getStyles(u"ParagraphStyles"_ustr)->getByName(u"Heading 2"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, getProperty(xHeading2, u"IsAutoUpdate"_ustr)); }; createSwDoc("sautoupd.rtf"); verify(); @@ -289,7 +298,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSautoupd) CPPUNIT_TEST_FIXTURE(Test, testHyphauto) { auto verify = [this]() { - CPPUNIT_ASSERT_EQUAL(true, getProperty(getParagraph(1), "ParaIsHyphenation")); + CPPUNIT_ASSERT_EQUAL(true, getProperty(getParagraph(1), u"ParaIsHyphenation"_ustr)); }; createSwDoc("hyphauto.rtf"); verify(); @@ -301,7 +310,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHyphpar) { auto verify = [this]() { // Hyphenation was enabled for all 3 paragraphs, but it should be disabled for the 2nd one. - CPPUNIT_ASSERT_EQUAL(false, getProperty(getParagraph(2), "ParaIsHyphenation")); + CPPUNIT_ASSERT_EQUAL(false, getProperty(getParagraph(2), u"ParaIsHyphenation"_ustr)); }; createSwDoc("hyphpar.rtf"); verify(); @@ -313,9 +322,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108955) { auto verify = [this]() { CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, - getProperty(getParagraph(1), "FillStyle")); + getProperty(getParagraph(1), u"FillStyle"_ustr)); // This was 0xffffff, i.e. non-white background was overwritten from the paragraph style. - CPPUNIT_ASSERT_EQUAL(Color(0xffff99), getProperty(getParagraph(1), "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xffff99), + getProperty(getParagraph(1), u"FillColor"_ustr)); }; createSwDoc("tdf108955.rtf"); verify(); @@ -334,7 +344,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80708) // This was 2, i.e. the second table had 3 cols, now 2 as expected. CPPUNIT_ASSERT_EQUAL(static_cast(1), getProperty>( - xTableRows->getByIndex(0), "TableColumnSeparators") + xTableRows->getByIndex(0), u"TableColumnSeparators"_ustr) .getLength()); }; createSwDoc("tdf80708.rtf"); @@ -348,8 +358,8 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL) createSwDoc("tdf90421.fodt"); // Change the hyperlink, so its URL is empty. uno::Reference xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); - xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString())); - saveAndReload("Rich Text Format"); + xRun->setPropertyValue(u"HyperLinkURL"_ustr, uno::Any(OUString())); + saveAndReload(u"Rich Text Format"_ustr); SvMemoryStream aMemoryStream; SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); aStream.ReadStream(aMemoryStream); @@ -371,10 +381,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114309) auto verify = [this]() { // Without the fix in place, this test would have failed with // - the property is of unexpected type or void: TextSection - auto xTextSection - = getProperty>(getParagraph(1), "TextSection"); + auto xTextSection = getProperty>(getParagraph(1), + u"TextSection"_ustr); auto xTextColumns - = getProperty>(xTextSection, "TextColumns"); + = getProperty>(xTextSection, u"TextColumns"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); }; createSwDoc("tdf114309.rtf"); @@ -386,13 +396,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114309) CPPUNIT_TEST_FIXTURE(Test, testTdf94043) { auto verify = [this]() { - auto xTextSection - = getProperty>(getParagraph(2), "TextSection"); + auto xTextSection = getProperty>(getParagraph(2), + u"TextSection"_ustr); auto xTextColumns - = getProperty>(xTextSection, "TextColumns"); + = getProperty>(xTextSection, u"TextColumns"_ustr); // This was 0, the separator line was not visible due to 0 width. CPPUNIT_ASSERT_EQUAL(static_cast(2), - getProperty(xTextColumns, "SeparatorLineWidth")); + getProperty(xTextColumns, u"SeparatorLineWidth"_ustr)); CPPUNIT_ASSERT_EQUAL(7, getParagraphs()); }; @@ -410,16 +420,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94377) xTextFieldsSupplier->getTextFields()); uno::Reference xFields(xFieldsAccess->createEnumeration()); uno::Reference xPropertySet(xFields->nextElement(), uno::UNO_QUERY); - auto xText = getProperty>(xPropertySet, "TextRange"); + auto xText = getProperty>(xPropertySet, u"TextRange"_ustr); // This failed, as: // 1) multiple paragraphs were not exported, so the text was "Asdf10asdf12". // 2) direct formatting of runs were not exported, so this was 12 (the document default). CPPUNIT_ASSERT_EQUAL( - 10.f, - getProperty(getRun(getParagraphOfText(1, xText, "Asdf10"), 1), "CharHeight")); + 10.f, getProperty(getRun(getParagraphOfText(1, xText, u"Asdf10"_ustr), 1), + u"CharHeight"_ustr)); CPPUNIT_ASSERT_EQUAL( - 12.f, - getProperty(getRun(getParagraphOfText(2, xText, "asdf12"), 1), "CharHeight")); + 12.f, getProperty(getRun(getParagraphOfText(2, xText, u"asdf12"_ustr), 1), + u"CharHeight"_ustr)); }; createSwDoc("tdf94377.rtf"); verify(); @@ -441,7 +451,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104079) bFound = true; // This was 0, 3rd paragraph of ToC lost its bottom paragraph margin. CPPUNIT_ASSERT_EQUAL(static_cast(212), - getProperty(xParagraph, "ParaBottomMargin")); + getProperty(xParagraph, u"ParaBottomMargin"_ustr)); } }; createSwDoc("tdf104079.rtf"); @@ -455,8 +465,8 @@ CPPUNIT_TEST_FIXTURE(Test, testPageBackground) auto verify = [this]() { // The problem was that \background was ignored. uno::Reference xPageStyle( - getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0x92D050), getProperty(xPageStyle, "BackColor")); + getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(Color(0x92D050), getProperty(xPageStyle, u"BackColor"_ustr)); }; createSwDoc("page-background.rtf"); verify(); @@ -475,8 +485,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96175) uno::Reference xUserDefinedProperties = xDocumentProperties->getUserDefinedProperties(); // This resulted in a beans::UnknownPropertyException. - CPPUNIT_ASSERT_EQUAL(OUString("foobar"), - getProperty(xUserDefinedProperties, "Company")); + CPPUNIT_ASSERT_EQUAL(u"foobar"_ustr, + getProperty(xUserDefinedProperties, u"Company"_ustr)); }; createSwDoc("tdf96175.rtf"); verify(); @@ -487,10 +497,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96175) CPPUNIT_TEST_FIXTURE(Test, testRedline) { auto verify = [this]() { - CPPUNIT_ASSERT_EQUAL(OUString("Rebecca Lopez"), - getProperty(getRun(getParagraph(1), 2), "RedlineAuthor")); - CPPUNIT_ASSERT_EQUAL(OUString("Dorothy Jones"), - getProperty(getRun(getParagraph(2), 2), "RedlineAuthor")); + CPPUNIT_ASSERT_EQUAL( + u"Rebecca Lopez"_ustr, + getProperty(getRun(getParagraph(1), 2), u"RedlineAuthor"_ustr)); + CPPUNIT_ASSERT_EQUAL( + u"Dorothy Jones"_ustr, + getProperty(getRun(getParagraph(2), 2), u"RedlineAuthor"_ustr)); }; createSwDoc("redline.rtf"); verify(); @@ -509,28 +521,29 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomDocProps) uno::Reference xUserDefinedProperties = xDocumentProperties->getUserDefinedProperties(); CPPUNIT_ASSERT_EQUAL( - OUString("2016-03-08T10:55:18,531376147"), - getProperty(xUserDefinedProperties, - "urn:bails:IntellectualProperty:Authorization:StartValidity")); + u"2016-03-08T10:55:18,531376147"_ustr, + getProperty( + xUserDefinedProperties, + u"urn:bails:IntellectualProperty:Authorization:StartValidity"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("None"), - getProperty(xUserDefinedProperties, - "urn:bails:IntellectualProperty:Authorization:StopValidity")); + u"None"_ustr, getProperty( + xUserDefinedProperties, + u"urn:bails:IntellectualProperty:Authorization:StopValidity"_ustr)); // Test roundtrip of numbers. This failed as getProperty() did not find "n". - CPPUNIT_ASSERT_EQUAL(42.0, getProperty(xUserDefinedProperties, "n")); + CPPUNIT_ASSERT_EQUAL(42.0, getProperty(xUserDefinedProperties, u"n"_ustr)); // Test boolean "yes". - CPPUNIT_ASSERT(getProperty(xUserDefinedProperties, "by")); + CPPUNIT_ASSERT(getProperty(xUserDefinedProperties, u"by"_ustr)); // Test boolean "no". - CPPUNIT_ASSERT(!getProperty(xUserDefinedProperties, "bn")); + CPPUNIT_ASSERT(!getProperty(xUserDefinedProperties, u"bn"_ustr)); // Test roundtrip of date in general, and year/month/day in particular. - util::DateTime aDate = getProperty(xUserDefinedProperties, "d"); + util::DateTime aDate = getProperty(xUserDefinedProperties, u"d"_ustr); CPPUNIT_ASSERT_EQUAL(static_cast(2016), aDate.Year); CPPUNIT_ASSERT_EQUAL(o3tl::narrowing(1), aDate.Month); CPPUNIT_ASSERT_EQUAL(o3tl::narrowing(30), aDate.Day); // Test real number. - CPPUNIT_ASSERT_EQUAL(3.14, getProperty(xUserDefinedProperties, "pi")); + CPPUNIT_ASSERT_EQUAL(3.14, getProperty(xUserDefinedProperties, u"pi"_ustr)); }; createSwDoc("custom-doc-props.rtf"); verify(); @@ -541,21 +554,21 @@ CPPUNIT_TEST_FIXTURE(Test, testCustomDocProps) CPPUNIT_TEST_FIXTURE(Test, testTdf65642) { auto verify = [this]() { - uno::Reference xPageStyles = getStyles("PageStyles"); + uno::Reference xPageStyles = getStyles(u"PageStyles"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); xCursor->jumpToLastPage(); - OUString pageStyleName = getProperty(xCursor, "PageStyleName"); + OUString pageStyleName = getProperty(xCursor, u"PageStyleName"_ustr); // The second page's numbering type: this was style::NumberingType::ARABIC. CPPUNIT_ASSERT_EQUAL( style::NumberingType::CHARS_UPPER_LETTER_N, - getProperty(xPageStyles->getByName(pageStyleName), "NumberingType")); + getProperty(xPageStyles->getByName(pageStyleName), u"NumberingType"_ustr)); // The second page's restart value: this was 0. CPPUNIT_ASSERT_EQUAL(static_cast(1), - getProperty(getParagraph(2), "PageNumberOffset")); + getProperty(getParagraph(2), u"PageNumberOffset"_ustr)); }; createSwDoc("tdf65642.rtf"); verify(); @@ -566,18 +579,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf65642) CPPUNIT_TEST_FIXTURE(Test, testPgnlcltr) { auto verify = [this]() { - uno::Reference xPageStyles = getStyles("PageStyles"); + uno::Reference xPageStyles = getStyles(u"PageStyles"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); xCursor->jumpToLastPage(); - OUString pageStyleName = getProperty(xCursor, "PageStyleName"); + OUString pageStyleName = getProperty(xCursor, u"PageStyleName"_ustr); // The second page's numbering type: this was style::NumberingType::ARABIC. CPPUNIT_ASSERT_EQUAL( style::NumberingType::CHARS_LOWER_LETTER_N, - getProperty(xPageStyles->getByName(pageStyleName), "NumberingType")); + getProperty(xPageStyles->getByName(pageStyleName), u"NumberingType"_ustr)); }; createSwDoc("pgnlcltr.rtf"); verify(); @@ -588,18 +601,18 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnlcltr) CPPUNIT_TEST_FIXTURE(Test, testPgnucrm) { auto verify = [this]() { - uno::Reference xPageStyles = getStyles("PageStyles"); + uno::Reference xPageStyles = getStyles(u"PageStyles"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); xCursor->jumpToLastPage(); - OUString pageStyleName = getProperty(xCursor, "PageStyleName"); + OUString pageStyleName = getProperty(xCursor, u"PageStyleName"_ustr); // The second page's numbering type: this was style::NumberingType::ARABIC. CPPUNIT_ASSERT_EQUAL( style::NumberingType::ROMAN_UPPER, - getProperty(xPageStyles->getByName(pageStyleName), "NumberingType")); + getProperty(xPageStyles->getByName(pageStyleName), u"NumberingType"_ustr)); }; createSwDoc("pgnucrm.rtf"); verify(); @@ -610,18 +623,18 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnucrm) CPPUNIT_TEST_FIXTURE(Test, testPgnlcrm) { auto verify = [this]() { - uno::Reference xPageStyles = getStyles("PageStyles"); + uno::Reference xPageStyles = getStyles(u"PageStyles"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); xCursor->jumpToLastPage(); - OUString pageStyleName = getProperty(xCursor, "PageStyleName"); + OUString pageStyleName = getProperty(xCursor, u"PageStyleName"_ustr); // The second page's numbering type: this was style::NumberingType::ARABIC. CPPUNIT_ASSERT_EQUAL( style::NumberingType::ROMAN_LOWER, - getProperty(xPageStyles->getByName(pageStyleName), "NumberingType")); + getProperty(xPageStyles->getByName(pageStyleName), u"NumberingType"_ustr)); }; createSwDoc("pgnlcrm.rtf"); verify(); @@ -632,22 +645,22 @@ CPPUNIT_TEST_FIXTURE(Test, testPgnlcrm) CPPUNIT_TEST_FIXTURE(Test, testPgndec) { auto verify = [this]() { - uno::Reference xPageStyles = getStyles("PageStyles"); + uno::Reference xPageStyles = getStyles(u"PageStyles"_ustr); uno::Reference xModel(mxComponent, uno::UNO_QUERY); uno::Reference xTextViewCursorSupplier( xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); xCursor->jumpToLastPage(); - OUString pageStyleName = getProperty(xCursor, "PageStyleName"); + OUString pageStyleName = getProperty(xCursor, u"PageStyleName"_ustr); // The second page's numbering type: this was style::NumberingType::ROMAN_LOWER. CPPUNIT_ASSERT_EQUAL( style::NumberingType::ARABIC, - getProperty(xPageStyles->getByName(pageStyleName), "NumberingType")); + getProperty(xPageStyles->getByName(pageStyleName), u"NumberingType"_ustr)); // tdf#82111 ensure a paragraph exists before a section break. // This was only two paragraphs, and both page number fields were in one para on page 2 ("11"). - getParagraph(2, "1"); + getParagraph(2, u"1"_ustr); CPPUNIT_ASSERT_EQUAL(3, getParagraphs()); }; createSwDoc("pgndec.rtf"); @@ -661,9 +674,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf98806) auto verify = [this]() { uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xBookmark( - xBookmarksSupplier->getBookmarks()->getByName("bookmark"), uno::UNO_QUERY); + xBookmarksSupplier->getBookmarks()->getByName(u"bookmark"_ustr), uno::UNO_QUERY); // This was empty, bookmark in table wasn't imported correctly. - CPPUNIT_ASSERT_EQUAL(OUString("BBB"), xBookmark->getAnchor()->getString()); + CPPUNIT_ASSERT_EQUAL(u"BBB"_ustr, xBookmark->getAnchor()->getString()); }; createSwDoc("tdf98806.rtf"); verify(); @@ -694,7 +707,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf103925) { auto verify = [this]() { // This was true, \animtext0 resulted in setting the blinking font effect. - CPPUNIT_ASSERT_EQUAL(false, getProperty(getRun(getParagraph(1), 1), "CharFlash")); + CPPUNIT_ASSERT_EQUAL(false, + getProperty(getRun(getParagraph(1), 1), u"CharFlash"_ustr)); }; createSwDoc("tdf103925.rtf"); verify(); @@ -706,12 +720,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104228) { auto verify = [this]() { uno::Reference xTable(getParagraphOrTable(2), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("C1"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"C1"_ustr), uno::UNO_QUERY); uno::Reference xParagraph = getParagraphOfText(1, xCell->getText()); // This was 2103, implicit 0 as direct formatting was ignored on the // paragraph (and the style had this larger value). CPPUNIT_ASSERT_EQUAL(static_cast(0), - getProperty(xParagraph, "ParaLeftMargin")); + getProperty(xParagraph, u"ParaLeftMargin"_ustr)); }; createSwDoc("tdf104228.rtf"); verify(); @@ -725,7 +739,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104085) uno::Reference xPara(getParagraph(1)); uno::Reference properties(xPara, uno::UNO_QUERY); uno::Reference xLevels( - properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + properties->getPropertyValue(u"NumberingRules"_ustr), uno::UNO_QUERY); uno::Sequence aProps; xLevels->getByIndex(0) >>= aProps; for (beans::PropertyValue const& prop : aProps) @@ -745,12 +759,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113550) { auto verify = [this]() { uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY); uno::Reference xParagraph = getParagraphOfText(1, xCell->getText()); // This was 2501, 0 as direct formatting was ignored on the paragraph (and // the style had this larger value). CPPUNIT_ASSERT_EQUAL(static_cast(0), - getProperty(xParagraph, "ParaLeftMargin")); + getProperty(xParagraph, u"ParaLeftMargin"_ustr)); }; createSwDoc("tdf113550.rtf"); verify(); @@ -765,7 +779,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLeveljcCenter) uno::Reference xPara(getParagraph(1)); uno::Reference properties(xPara, uno::UNO_QUERY); uno::Reference xLevels( - properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + properties->getPropertyValue(u"NumberingRules"_ustr), uno::UNO_QUERY); uno::Sequence aProps; xLevels->getByIndex(0) >>= aProps; for (beans::PropertyValue const& prop : aProps) @@ -790,8 +804,8 @@ CPPUNIT_TEST_FIXTURE(Test, testHyperlinkTarget) { auto verify = [this]() { // This was empty, hyperlink target was lost on import. - CPPUNIT_ASSERT_EQUAL(OUString("_blank"), - getProperty(getRun(getParagraph(1), 1), "HyperLinkTarget")); + CPPUNIT_ASSERT_EQUAL(u"_blank"_ustr, getProperty(getRun(getParagraph(1), 1), + u"HyperLinkTarget"_ustr)); }; createSwDoc("hyperlink-target.rtf"); verify(); @@ -806,9 +820,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107620) // original bugdoc resulting in 2 pages instead of 1. uno::Reference xFactory(mxComponent, uno::UNO_QUERY); uno::Reference xSettings( - xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); + xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY); bool bAddParaTableSpacing = true; - xSettings->getPropertyValue("AddParaTableSpacing") >>= bAddParaTableSpacing; + xSettings->getPropertyValue(u"AddParaTableSpacing"_ustr) >>= bAddParaTableSpacing; CPPUNIT_ASSERT(!bAddParaTableSpacing); } @@ -821,7 +835,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf104937) uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference xTableRows = xTable->getRows(); auto aSeparators = getProperty>( - xTableRows->getByIndex(1), "TableColumnSeparators"); + xTableRows->getByIndex(1), u"TableColumnSeparators"_ustr); // First table's second row had 9 cells (so 8 separators). CPPUNIT_ASSERT_EQUAL(static_cast(8), aSeparators.getLength()); // This was 3174, i.e. last cell was wider than expected, while others were @@ -843,7 +857,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112507) uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference xTableRows = xTable->getRows(); auto aSeparators = getProperty>( - xTableRows->getByIndex(1), "TableColumnSeparators"); + xTableRows->getByIndex(1), u"TableColumnSeparators"_ustr); // First table's second row had 3 cells (so 2 separators). CPPUNIT_ASSERT_EQUAL(static_cast(2), aSeparators.getLength()); // This was 3333, i.e. the B2 cell was too narrow and the text needed 2 lines. @@ -860,13 +874,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf107480) auto verify = [this]() { // These were 176 (100 twips), as \htmautsp was parsed too late. CPPUNIT_ASSERT_EQUAL(sal_Int32(0), - getProperty(getParagraph(1), "ParaTopMargin")); + getProperty(getParagraph(1), u"ParaTopMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(1), "ParaBottomMargin")); + getProperty(getParagraph(1), u"ParaBottomMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(2), "ParaTopMargin")); + getProperty(getParagraph(2), u"ParaTopMargin"_ustr)); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), - getProperty(getParagraph(2), "ParaBottomMargin")); + getProperty(getParagraph(2), u"ParaBottomMargin"_ustr)); }; createSwDoc("tdf107480.rtf"); verify(); @@ -878,21 +892,22 @@ CPPUNIT_TEST_FIXTURE(Test, testWatermark) { auto verify = [this]() { uno::Reference xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("WatermarkRTF"), xShape->getString()); + CPPUNIT_ASSERT_EQUAL(u"WatermarkRTF"_ustr, xShape->getString()); uno::Reference xPropertySet(xShape, uno::UNO_QUERY); OUString aFont; float nFontSize; // Check transparency - CPPUNIT_ASSERT_EQUAL(sal_Int16(50), getProperty(xShape, "FillTransparence")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(50), + getProperty(xShape, u"FillTransparence"_ustr)); // Check font family - CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharFontName") >>= aFont); - CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Serif"), aFont); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"CharFontName"_ustr) >>= aFont); + CPPUNIT_ASSERT_EQUAL(u"DejaVu Serif"_ustr, aFont); // Check font size - CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharHeight") >>= nFontSize); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize); CPPUNIT_ASSERT_EQUAL(float(66), nFontSize); }; createSwDoc("watermark.rtf"); @@ -907,11 +922,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153194Compat) CPPUNIT_ASSERT_EQUAL(2, getPages()); // no \spltpgpar => paragraph 2 on page 1 CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, - getProperty(getParagraph(1), "BreakType")); + getProperty(getParagraph(1), u"BreakType"_ustr)); CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, - getProperty(getParagraph(2), "BreakType")); + getProperty(getParagraph(2), u"BreakType"_ustr)); CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, - getProperty(getParagraph(3), "BreakType")); + getProperty(getParagraph(3), u"BreakType"_ustr)); }; createSwDoc("page-break-emptyparas.rtf"); verify(); @@ -925,11 +940,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153194New) CPPUNIT_ASSERT_EQUAL(2, getPages()); // \spltpgpar => paragraph 2 on page 2 CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, - getProperty(getParagraph(1), "BreakType")); + getProperty(getParagraph(1), u"BreakType"_ustr)); CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, - getProperty(getParagraph(2), "BreakType")); + getProperty(getParagraph(2), u"BreakType"_ustr)); CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, - getProperty(getParagraph(3), "BreakType")); + getProperty(getParagraph(3), u"BreakType"_ustr)); }; createSwDoc("page-break-emptyparas-spltpgpar.rtf"); verify(); @@ -956,11 +971,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf109790) { auto verify = [this]() { uno::Reference xTable(getParagraphOrTable(2), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY); // Style information was reset, which caused character height to be 22. - CPPUNIT_ASSERT_EQUAL( - 10.f, - getProperty(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL(10.f, + getProperty(getRun(getParagraphOfText(1, xCell->getText()), 1), + u"CharHeight"_ustr)); }; createSwDoc("tdf109790.rtf"); verify(); @@ -973,10 +988,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112211) auto verify = [this]() { // This was 0, \fi in a list level definition was not imported. auto xRules = getProperty>( - getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + getStyles(u"NumberingStyles"_ustr)->getByName(u"WWNum1"_ustr), u"NumberingRules"_ustr); comphelper::SequenceAsHashMap aRule(xRules->getByIndex(0)); CPPUNIT_ASSERT_EQUAL(static_cast(-635), - aRule["FirstLineIndent"].get()); + aRule[u"FirstLineIndent"_ustr].get()); }; createSwDoc("tdf112211.rtf"); verify(); @@ -988,7 +1003,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113202) { auto verify = [this]() { // This failed, contextual spacing in 4th paragraph was lost. - CPPUNIT_ASSERT(getProperty(getParagraph(4), "ParaContextMargin")); + CPPUNIT_ASSERT(getProperty(getParagraph(4), u"ParaContextMargin"_ustr)); }; createSwDoc("tdf113202.rtf"); verify(); @@ -1007,17 +1022,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156030) // As usual, fields given by FieldsAccess are not in same order as in the document // (mostly in reverse order, thanks to SwModify::Add) std::vector> aExpectedValues = { - { "1 FORMULA 2", "true value 1", "false value 1" }, // #1, condition should be 1 = 2 - { "", "", "" }, // #9, not enough field params - { "1 1 FORMULA 1 2 1 true value 8 fal", "se", - "value 8" }, // #8, nonsense in field params - { "1 1 FORMULA 1 2 1 true value 7 false", "value", "7" }, // #7, another parse error - { "1 < 2", "true value 6", "false value 6" }, // #6 - { "1 > 2", "true value 5", "false value 5" }, // #5 - { "1 <> 2", "true value 4", "false value 4" }, // #4 - { "1 != 2", "true value 3", "false value 3" }, // #3 - { "1 FORMULA FORMULA 2", "true value 2", - "false value 2" }, // #2, condition expected 1 == 2 + { u"1 FORMULA 2"_ustr, u"true value 1"_ustr, + u"false value 1"_ustr }, // #1, condition should be 1 = 2 + { u""_ustr, u""_ustr, u""_ustr }, // #9, not enough field params + { u"1 1 FORMULA 1 2 1 true value 8 fal"_ustr, u"se"_ustr, + u"value 8"_ustr }, // #8, nonsense in field params + { u"1 1 FORMULA 1 2 1 true value 7 false"_ustr, u"value"_ustr, + u"7"_ustr }, // #7, another parse error + { u"1 < 2"_ustr, u"true value 6"_ustr, u"false value 6"_ustr }, // #6 + { u"1 > 2"_ustr, u"true value 5"_ustr, u"false value 5"_ustr }, // #5 + { u"1 <> 2"_ustr, u"true value 4"_ustr, u"false value 4"_ustr }, // #4 + { u"1 != 2"_ustr, u"true value 3"_ustr, u"false value 3"_ustr }, // #3 + { u"1 FORMULA FORMULA 2"_ustr, u"true value 2"_ustr, + u"false value 2"_ustr }, // #2, condition expected 1 == 2 }; uno::Reference xPropertySet; OUString sValue; @@ -1026,11 +1043,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156030) { xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT(xPropertySet.is()); - CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Condition") >>= sValue); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"Condition"_ustr) >>= sValue); CPPUNIT_ASSERT_EQUAL(aValues[0], sValue); - CPPUNIT_ASSERT(xPropertySet->getPropertyValue("TrueContent") >>= sValue); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"TrueContent"_ustr) >>= sValue); CPPUNIT_ASSERT_EQUAL(aValues[1], sValue); - CPPUNIT_ASSERT(xPropertySet->getPropertyValue("FalseContent") >>= sValue); + CPPUNIT_ASSERT(xPropertySet->getPropertyValue(u"FalseContent"_ustr) >>= sValue); CPPUNIT_ASSERT_EQUAL(aValues[2], sValue); } @@ -1052,9 +1069,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153195) // Table margin test (cannot be set to exact value, it jumps between -1991 and -1983) CPPUNIT_ASSERT_DOUBLES_EQUAL( - sal_Int32(-2182), getProperty(xTables->getByIndex(0), "LeftMargin"), 10); + sal_Int32(-2182), getProperty(xTables->getByIndex(0), u"LeftMargin"_ustr), + 10); CPPUNIT_ASSERT_DOUBLES_EQUAL( - sal_Int32(-2182), getProperty(xTables->getByIndex(1), "LeftMargin"), 10); + sal_Int32(-2182), getProperty(xTables->getByIndex(1), u"LeftMargin"_ustr), + 10); }; createSwDoc("tdf153195.rtf"); verify(); @@ -1070,7 +1089,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158762) uno::Reference xPara(getParagraph(paragraph)); uno::Reference properties(xPara, uno::UNO_QUERY); uno::Reference xLevels( - properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + properties->getPropertyValue(u"NumberingRules"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT(xLevels.is()); } }; diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index bb73263777e8..13431ca2ee4c 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -69,13 +69,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf155663) CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Width); } CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Top); + getProperty(xShape, u"GraphicCrop"_ustr).Top); CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Bottom); + getProperty(xShape, u"GraphicCrop"_ustr).Bottom); CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Left); + getProperty(xShape, u"GraphicCrop"_ustr).Left); CPPUNIT_ASSERT_EQUAL(sal_Int32(123), - getProperty(xShape, "GraphicCrop").Right); + getProperty(xShape, u"GraphicCrop"_ustr).Right); }; createSwDoc("piccrop.rtf"); verify(); @@ -93,7 +93,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0) // There should be no empty paragraph at the start xmlDocUniquePtr pLayout = parseLayoutDump(); assertXPath(pLayout, "//anchored"_ostr, 1); - assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); + assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, u"First page"_ustr); }; createSwDoc("tdf158586_pageBreak0.rtf"); verify(); @@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_0B) // There should be no empty paragraph at the start xmlDocUniquePtr pLayout = parseLayoutDump(); assertXPath(pLayout, "//anchored"_ostr, 1); - assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, "First page"); + assertXPathContent(pLayout, "/root/page[1]/body//txt"_ostr, u"First page"_ustr); }; createSwDoc("tdf158586_pageBreak0B.rtf"); verify(); @@ -130,7 +130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_1) xmlDocUniquePtr pLayout = parseLayoutDump(); // on import there is a section on page 2; on reimport there is no section // (probably not an important difference?) - assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, "Second page"); + assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, u"Second page"_ustr); }; createSwDoc("tdf158586_pageBreak1.rtf"); verify(); @@ -149,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_1header) xmlDocUniquePtr pLayout = parseLayoutDump(); // on import there is a section on page 2; on reimport there is no section // (probably not an important difference?) - assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, "Second page"); + assertXPathContent(pLayout, "/root/page[2]/body//txt"_ostr, u"Second page"_ustr); }; createSwDoc("tdf158586_pageBreak1_header.rtf"); verify(); @@ -163,8 +163,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158586_lostFrame) // The anchor and align properties are sufficient to define a frame xmlDocUniquePtr pLayout = parseLayoutDump(); assertXPath(pLayout, "//anchored"_ostr, 1); - assertXPathContent(pLayout, "//page[1]/body//txt"_ostr, "1st page"); - assertXPathContent(pLayout, "//page[2]/body//txt"_ostr, "2nd page"); + assertXPathContent(pLayout, "//page[1]/body//txt"_ostr, u"1st page"_ustr); + assertXPathContent(pLayout, "//page[2]/body//txt"_ostr, u"2nd page"_ustr); CPPUNIT_ASSERT_EQUAL(2, getPages()); }; @@ -182,7 +182,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndRTF) SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); pWrtShell->SplitNode(); pWrtShell->Up(/*bSelect=*/false); - pWrtShell->Insert("x"); + pWrtShell->Insert(u"x"_ustr); pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); pWrtShell->StartAction(); @@ -239,13 +239,15 @@ CPPUNIT_TEST_FIXTURE(Test, testAnnotationPar) // the problem was that the paragraph break following annotation was missing CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); CPPUNIT_ASSERT_EQUAL( - OUString("Annotation"), + u"Annotation"_ustr, getProperty( - getRun(getParagraph(1, "I ax xoixx xuxixx xxe xixxx. (Xaxxexx 1989 x.x. xaxax a)"), + getRun(getParagraph( + 1, u"I ax xoixx xuxixx xxe xixxx. (Xaxxexx 1989 x.x. xaxax a)"_ustr), 2), - "TextPortionType")); + u"TextPortionType"_ustr)); CPPUNIT_ASSERT( - !getProperty(getParagraph(2, "Xix\txaxa\tx-a\t\t\txix\tx xi = xa."), "ListId") + !getProperty(getParagraph(2, u"Xix\txaxa\tx-a\t\t\txix\tx xi = xa."_ustr), + u"ListId"_ustr) .isEmpty()); }; createSwDoc("tdf136445-1-min.rtf"); @@ -301,8 +303,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle1) uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, - getProperty(xFrame, "FillStyle")); - awt::Gradient2 aGradient = getProperty(xFrame, "FillGradient"); + getProperty(xFrame, u"FillStyle"_ustr)); + awt::Gradient2 aGradient = getProperty(xFrame, u"FillGradient"_ustr); // MCGR: Use the completely imported transparency gradient to check for correctness basegfx::BColorStops aColorStops @@ -332,8 +334,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle2) uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, - getProperty(xFrame, "FillStyle")); - awt::Gradient2 aGradient = getProperty(xFrame, "FillGradient"); + getProperty(xFrame, u"FillStyle"_ustr)); + awt::Gradient2 aGradient = getProperty(xFrame, u"FillGradient"_ustr); // MCGR: Use the completely imported transparency gradient to check for correctness basegfx::BColorStops aColorStops @@ -363,8 +365,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle3) uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, - getProperty(xFrame, "FillStyle")); - awt::Gradient2 aGradient = getProperty(xFrame, "FillGradient"); + getProperty(xFrame, u"FillStyle"_ustr)); + awt::Gradient2 aGradient = getProperty(xFrame, u"FillGradient"_ustr); // MCGR: Use the completely imported transparency gradient to check for correctness basegfx::BColorStops aColorStops @@ -393,8 +395,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf159824_gradientAngle4) uno::UNO_QUERY); uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, - getProperty(xFrame, "FillStyle")); - awt::Gradient2 aGradient = getProperty(xFrame, "FillGradient"); + getProperty(xFrame, u"FillStyle"_ustr)); + awt::Gradient2 aGradient = getProperty(xFrame, u"FillGradient"_ustr); // MCGR: Use the completely imported transparency gradient to check for correctness basegfx::BColorStops aColorStops @@ -421,11 +423,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158830) uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY); uno::Reference xPara = getParagraphOfText(1, xCell->getText()); CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_CENTER, - static_cast(getProperty(xPara, "ParaAdjust"))); + static_cast(getProperty(xPara, u"ParaAdjust"_ustr))); }; createSwDoc("tdf158830.rtf"); verify(); @@ -441,11 +443,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158978) uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY); uno::Reference xPara = getParagraphOfText(1, xCell->getText()); CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_RIGHT, - static_cast(getProperty(xPara, "ParaAdjust"))); + static_cast(getProperty(xPara, u"ParaAdjust"_ustr))); }; createSwDoc("tdf158978.rtf"); verify(); @@ -464,10 +466,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158982) uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xTables->getCount()); uno::Reference xTable(xTables->getByIndex(5), uno::UNO_QUERY); - uno::Reference xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName(u"A2"_ustr), uno::UNO_QUERY); uno::Reference xPara = getParagraphOfText(1, xCell->getText()); CPPUNIT_ASSERT_EQUAL(static_cast(508), - getProperty(xPara, "ParaLeftMargin")); + getProperty(xPara, u"ParaLeftMargin"_ustr)); }; createSwDoc("tdf158982.rtf"); verify(); diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 6560181ab6a7..a9c7ecc9e176 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -1510,8 +1510,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157833) uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTableNames = xTablesSupplier->getTextTables(); - CPPUNIT_ASSERT(xTableNames->hasByName("Table1")); - uno::Reference xTable1(xTableNames->getByName("Table1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xTableNames->hasByName(u"Table1"_ustr)); + uno::Reference xTable1(xTableNames->getByName(u"Table1"_ustr), + uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable1->getRows()->getCount()); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable1->getColumns()->getCount()); @@ -1577,8 +1578,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155692) uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTableNames = xTablesSupplier->getTextTables(); - CPPUNIT_ASSERT(xTableNames->hasByName("Table1")); - uno::Reference xTable1(xTableNames->getByName("Table1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xTableNames->hasByName(u"Table1"_ustr)); + uno::Reference xTable1(xTableNames->getByName(u"Table1"_ustr), + uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable1->getRows()->getCount()); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable1->getColumns()->getCount()); @@ -1812,7 +1814,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf161332) CPPUNIT_ASSERT_EQUAL(SelectionType::Frame, eType); // remove selection - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); // select text frame by clicking on it at the right side of the bottom cell auto pRow2 = pRow1->GetNext(); @@ -1873,7 +1875,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf161426) CPPUNIT_ASSERT_EQUAL(SelectionType::Frame, eType); // remove selection - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); // select text frame by clicking on it at the right side of the bottom right cell auto pRow2 = pRow1->GetNext(); @@ -2028,7 +2030,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf161360) // select the text frame instead of the image // by pressing Escape - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); // Then make sure that the cursor in the table: SelectionType eType2 = pWrtShell->GetSelectionType(); @@ -2037,13 +2039,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf161360) CPPUNIT_ASSERT(bCursorInTable); // select the text frame by pressing Escape again - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); eType2 = pWrtShell->GetSelectionType(); CPPUNIT_ASSERT_EQUAL(SelectionType::Frame, eType2); // deselect the text frame by pressing Escape again - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); eType2 = pWrtShell->GetSelectionType(); // The text cursor is after the floating table @@ -2066,7 +2068,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157533) uno::Reference xCtrl(xModel->getCurrentController(), uno::UNO_QUERY); xCtrl->select(uno::Any(xShape)); - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); // Then make sure that the cursor in the table: SelectionType eType2 = pWrtShell->GetSelectionType(); @@ -2081,7 +2083,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157533) uno::Reference xShape2(getShapeByName(u"Objet11")); xCtrl->select(uno::Any(xShape2)); - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); SwTextNode* pTextNode2 = pWrtShell->GetCursor()->GetPointNode().GetTextNode(); // This was false (lost text cursor inside the frame of the formula) @@ -2089,19 +2091,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157533) SwTableNode* pTableNode = pWrtShell->GetCursor()->GetPointNode().FindTableNode(); SwTable& rTable = pTableNode->GetTable(); // cursor in the same cell - bool bSameBox = pTextNode2->GetTableBox() == rTable.GetTableBox("A1"); + bool bSameBox = pTextNode2->GetTableBox() == rTable.GetTableBox(u"A1"_ustr); CPPUNIT_ASSERT(bSameBox); uno::Reference xShape3(getShapeByName(u"Objet10")); xCtrl->select(uno::Any(xShape3)); - dispatchCommand(mxComponent, ".uno:Escape", {}); + dispatchCommand(mxComponent, u".uno:Escape"_ustr, {}); SwTextNode* pTextNode3 = pWrtShell->GetCursor()->GetPointNode().GetTextNode(); // This was false (lost text cursor inside the frame of the formula) CPPUNIT_ASSERT(pTextNode3->GetTableBox()); // cursor in the same cell - bSameBox = pTextNode3->GetTableBox() == rTable.GetTableBox("B1"); + bSameBox = pTextNode3->GetTableBox() == rTable.GetTableBox(u"B1"_ustr); CPPUNIT_ASSERT(bSameBox); } diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 77f9d72432e3..2cd9e7f888a5 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -881,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testInsertAutoTextIntoListFromParaStyle) pWrtShell->FwdPara(); pWrtShell->EndPara(/*bSelect=*/false); // expands autotext (via F3) - pWrtShell->Insert(" jacr"); + pWrtShell->Insert(u" jacr"_ustr); SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3); @@ -2748,8 +2748,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) pMasterDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks().size()); // no way to set SwDocShell::m_nUpdateDocMode away from NO_UPDATE ? // pMasterDoc->getIDocumentLinksAdministration().UpdateLinks(); - pMasterDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks(false, false, - nullptr, ""); + pMasterDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks( + false, false, nullptr, u""_ustr); // note: this has called SwGetRefFieldType::UpdateGetReferences() SwFieldType const* const pType( pMasterDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::GetRef)); @@ -2803,8 +2803,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612) CPPUNIT_ASSERT_EQUAL( size_t(1), pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks().size()); - pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks(false, false, - nullptr, ""); + pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks( + false, false, nullptr, u""_ustr); xmlDocUniquePtr pLayout = parseLayoutDump(); diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 8d40f53065ff..38163f870f30 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf158375_dde_disable) size_t(1), pDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks().size()); pDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks(false, false, nullptr, - ""); + u""_ustr); uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xSections(xTextSectionsSupplier->getTextSections(), @@ -667,13 +667,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf144752) CPPUNIT_ASSERT(!pWrtShell->HasSelection()); // Undo and check, that the "Text" is selected - dispatchCommand(mxComponent, ".uno:Undo", {}); + dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); // Without the fix, this would fail CPPUNIT_ASSERT(pWrtShell->HasSelection()); CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, pWrtShell->GetSelText()); // Redo and check, that the "Word" is selected - dispatchCommand(mxComponent, ".uno:Redo", {}); + dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); CPPUNIT_ASSERT(pWrtShell->HasSelection()); CPPUNIT_ASSERT_EQUAL(u"Word"_ustr, pWrtShell->GetSelText()); } diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index 7e6948901e2a..39448c56aa19 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -61,21 +61,21 @@ DECLARE_WW8EXPORT_TEST(testTdf72511_editengLRSpace, "tdf72511_editengLRSpace.doc // given a default paragraph style with a left indent of 2 inches, // the comment should ignore the indent, but the textbox must not. uno::Reference xRun( - getProperty>(getRun(getParagraph(1), 3), "TextField")); - uno::Reference xComment(getProperty>(xRun, "TextRange")); + getProperty>(getRun(getParagraph(1), 3), u"TextField"_ustr)); + uno::Reference xComment(getProperty>(xRun, u"TextRange"_ustr)); uno::Reference xParagraph(getParagraphOfText(1, xComment), uno::UNO_QUERY); // The comment was indented by 4001 (2 inches) instead of nothing - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xParagraph, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xParagraph, u"ParaLeftMargin"_ustr)); uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY_THROW); uno::Reference xShape2(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.TextShape"), xShape2->getShapeType()); + CPPUNIT_ASSERT_EQUAL(u"com.sun.star.drawing.TextShape"_ustr, xShape2->getShapeType()); uno::Reference xTextbox(xShape2, uno::UNO_QUERY_THROW); uno::Reference xTBPara(xTextbox, uno::UNO_QUERY); // Textbox paragraphs had no indent instead of 5080 (2 inches - the same as normal paragraphs). - CPPUNIT_ASSERT_EQUAL(sal_Int32(5080), getProperty(xTBPara, "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5080), getProperty(xTBPara, u"ParaLeftMargin"_ustr)); CPPUNIT_ASSERT_EQUAL_MESSAGE("sanity check: normal paragraph's indent", sal_Int32(5080), - getProperty(getParagraph(1), "ParaLeftMargin")); + getProperty(getParagraph(1), u"ParaLeftMargin"_ustr)); } DECLARE_WW8EXPORT_TEST(testTdf160049_anchorMargin, "tdf160049_anchorMargin.doc") @@ -131,7 +131,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndDOC) SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); pWrtShell->SplitNode(); pWrtShell->Up(/*bSelect=*/false); - pWrtShell->Insert("x"); + pWrtShell->Insert(u"x"_ustr); pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); pWrtShell->StartAction(); @@ -143,7 +143,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEndDOC) } // When saving to DOC: - saveAndReload("MS Word 97"); + saveAndReload(u"MS Word 97"_ustr); // Then make sure the endnote position is section end: SwDoc* pDoc = getSwDoc(); diff --git a/sw/qa/filter/ascii/ascii.cxx b/sw/qa/filter/ascii/ascii.cxx index fea2e64a7b3d..db581043fb0e 100644 --- a/sw/qa/filter/ascii/ascii.cxx +++ b/sw/qa/filter/ascii/ascii.cxx @@ -32,7 +32,7 @@ class Test : public SwModelTestBase { public: Test() - : SwModelTestBase("/sw/qa/filter/ascii/data/") + : SwModelTestBase(u"/sw/qa/filter/ascii/data/"_ustr) { } }; @@ -48,8 +48,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf144576_ascii) uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xTableNames = xTablesSupplier->getTextTables(); - CPPUNIT_ASSERT(xTableNames->hasByName("Table1")); - uno::Reference xTable1(xTableNames->getByName("Table1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xTableNames->hasByName(u"Table1"_ustr)); + uno::Reference xTable1(xTableNames->getByName(u"Table1"_ustr), + uno::UNO_QUERY); pWrtShell->GotoTable(u"Table1"_ustr); pWrtShell->Insert(u"A"_ustr); @@ -61,9 +62,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf144576_ascii) pWrtShell->Insert(u"D"_ustr); // Select the whole table - dispatchCommand(mxComponent, ".uno:SelectAll", {}); - dispatchCommand(mxComponent, ".uno:SelectAll", {}); - dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); rtl::Reference xTransferable(new SwTransferable(*pWrtShell)); xTransferable->Copy(); // Ctl-C @@ -95,9 +96,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf144576_ascii) // Add some newlines in the first two cells // and test to see if they're handled correctly - uno::Reference xCellA1(xTable1->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCellA1(xTable1->getCellByName(u"A1"_ustr), uno::UNO_QUERY); xCellA1->setString(u""_ustr); - uno::Reference xCellB1(xTable1->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference xCellB1(xTable1->getCellByName(u"B1"_ustr), uno::UNO_QUERY); xCellB1->setString(u""_ustr); pWrtShell->GotoTable(u"Table1"_ustr); @@ -115,9 +116,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf144576_ascii) = u"A"_ustr SAL_NEWLINE_STRING u"A1\tB"_ustr SAL_NEWLINE_STRING u"B1"_ustr SAL_NEWLINE_STRING u"B2"_ustr SAL_NEWLINE_STRING u"C\tD"_ustr SAL_NEWLINE_STRING u""_ustr; // Select the whole table - dispatchCommand(mxComponent, ".uno:SelectAll", {}); - dispatchCommand(mxComponent, ".uno:SelectAll", {}); - dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); // Get the plain text version of the selection rtl::Reference xNewTransferable(new SwTransferable(*pWrtShell)); diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index 603d7c198b1a..9a1d9bca8b4f 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -577,7 +577,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); pWrtShell->SplitNode(); pWrtShell->Up(/*bSelect=*/false); - pWrtShell->Insert("x"); + pWrtShell->Insert(u"x"_ustr); pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SwSectionData aSection(SectionType::Content, pWrtShell->GetUniqueSectionName()); pWrtShell->StartAction(); @@ -588,15 +588,15 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) pWrtShell->InsertFootnote(OUString(), /*bEndNote=*/true); // When saving to DOCX: - save("Office Open XML Text"); + save(u"Office Open XML Text"_ustr); // Then make sure the endnote position is section end: - xmlDocUniquePtr pXmlDoc = parseExport("word/settings.xml"); + xmlDocUniquePtr pXmlDoc = parseExport(u"word/settings.xml"_ustr); OUString aPos = getXPath(pXmlDoc, "/w:settings/w:endnotePr/w:pos"_ostr, "val"_ostr); // Without the accompanying fix in place, this test would have failed with: // - XPath '/w:settings/w:endnotePr/w:pos' number of nodes is incorrect // i.e. the default position was used: document end. - CPPUNIT_ASSERT_EQUAL(OUString("sectEnd"), aPos); + CPPUNIT_ASSERT_EQUAL(u"sectEnd"_ustr, aPos); } } diff --git a/sw/qa/writerfilter/dmapper/CellColorHandler.cxx b/sw/qa/writerfilter/dmapper/CellColorHandler.cxx index a724f063fc61..69c2c760d03e 100644 --- a/sw/qa/writerfilter/dmapper/CellColorHandler.cxx +++ b/sw/qa/writerfilter/dmapper/CellColorHandler.cxx @@ -22,7 +22,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/DomainMapper.cxx b/sw/qa/writerfilter/dmapper/DomainMapper.cxx index 3ee1ed2b0bce..3e7acdd3b495 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper.cxx @@ -26,7 +26,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; @@ -176,9 +176,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorder) uno::UNO_QUERY); uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xPara->getCellByName(u"A1"_ustr), uno::UNO_QUERY); sal_Int32 nLeftBorderDistance{}; - xCell->getPropertyValue("LeftBorderDistance") >>= nLeftBorderDistance; + xCell->getPropertyValue(u"LeftBorderDistance"_ustr) >>= nLeftBorderDistance; // Without the accompanying fix in place, this test would have failed with: // - Expected: 203 // - Actual : 0 diff --git a/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx index 45a4691ac15a..5962bd06b194 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx @@ -30,7 +30,7 @@ class Test : public UnoApiXmlTest { public: Test() - : UnoApiXmlTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiXmlTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; @@ -242,11 +242,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyleParaBorderSpacing) uno::Reference xText(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference xParaEnum = xText->createEnumeration(); uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xCell(xPara->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference xCell(xPara->getCellByName(u"A1"_ustr), + uno::UNO_QUERY); xParaEnum = xCell->createEnumeration(); uno::Reference xParaProps(xParaEnum->nextElement(), uno::UNO_QUERY); sal_Int32 nTopBorderDistance{}; - xParaProps->getPropertyValue("TopBorderDistance") >>= nTopBorderDistance; + xParaProps->getPropertyValue(u"TopBorderDistance"_ustr) >>= nTopBorderDistance; // Without the accompanying fix in place, this test would have failed with: // - Expected: 35 // - Actual : 0 diff --git a/sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx b/sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx index 37cb5c7bd617..2eaef6b14bd0 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx @@ -21,7 +21,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx index 6085872b0818..82224635543a 100644 --- a/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -33,7 +33,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; @@ -435,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(Test, testClearingBreakSectEnd) // - Actual : Text // i.e. the clearing break at sect end was lost, leading to text overlap. CPPUNIT_ASSERT_EQUAL(u"LineBreak"_ustr, - xPortion->getPropertyValue("TextPortionType").get()); + xPortion->getPropertyValue(u"TextPortionType"_ustr).get()); } CPPUNIT_TEST_FIXTURE(Test, testParaStyleLostNumbering) diff --git a/sw/qa/writerfilter/dmapper/GraphicImport.cxx b/sw/qa/writerfilter/dmapper/GraphicImport.cxx index fc6b5f926305..e7e3998061d3 100644 --- a/sw/qa/writerfilter/dmapper/GraphicImport.cxx +++ b/sw/qa/writerfilter/dmapper/GraphicImport.cxx @@ -32,7 +32,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/PropertyMap.cxx b/sw/qa/writerfilter/dmapper/PropertyMap.cxx index 377ceb339985..3a564d886f1f 100644 --- a/sw/qa/writerfilter/dmapper/PropertyMap.cxx +++ b/sw/qa/writerfilter/dmapper/PropertyMap.cxx @@ -31,7 +31,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/SdtHelper.cxx b/sw/qa/writerfilter/dmapper/SdtHelper.cxx index f8b4d368ad1a..461f7be7e722 100644 --- a/sw/qa/writerfilter/dmapper/SdtHelper.cxx +++ b/sw/qa/writerfilter/dmapper/SdtHelper.cxx @@ -24,7 +24,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/SettingsTable.cxx b/sw/qa/writerfilter/dmapper/SettingsTable.cxx index 13938eca82c5..11a6283b982b 100644 --- a/sw/qa/writerfilter/dmapper/SettingsTable.cxx +++ b/sw/qa/writerfilter/dmapper/SettingsTable.cxx @@ -24,7 +24,7 @@ class Test : public UnoApiXmlTest { public: Test() - : UnoApiXmlTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiXmlTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; @@ -102,9 +102,9 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnoteAtSectionEnd) xParaEnum->nextElement(); uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); uno::Reference xSection; - xPara->getPropertyValue("TextSection") >>= xSection; + xPara->getPropertyValue(u"TextSection"_ustr) >>= xSection; bool bEndnoteIsCollectAtTextEnd = false; - xSection->getPropertyValue("EndnoteIsCollectAtTextEnd") >>= bEndnoteIsCollectAtTextEnd; + xSection->getPropertyValue(u"EndnoteIsCollectAtTextEnd"_ustr) >>= bEndnoteIsCollectAtTextEnd; // Without the accompanying fix in place, this test would have failed, endnotes were always at // document end. CPPUNIT_ASSERT(bEndnoteIsCollectAtTextEnd); diff --git a/sw/qa/writerfilter/dmapper/TableManager.cxx b/sw/qa/writerfilter/dmapper/TableManager.cxx index 51609a006a14..5c9933a018e9 100644 --- a/sw/qa/writerfilter/dmapper/TableManager.cxx +++ b/sw/qa/writerfilter/dmapper/TableManager.cxx @@ -20,7 +20,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx b/sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx index 9680511ee5cc..bf6387cd8175 100644 --- a/sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx +++ b/sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx @@ -21,7 +21,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/dmapper/data/") + : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/filter/WriterFilter.cxx b/sw/qa/writerfilter/filter/WriterFilter.cxx index 45b80e4093a5..2880b7148985 100644 --- a/sw/qa/writerfilter/filter/WriterFilter.cxx +++ b/sw/qa/writerfilter/filter/WriterFilter.cxx @@ -24,7 +24,7 @@ class Test : public UnoApiXmlTest { public: Test() - : UnoApiXmlTest("/sw/qa/writerfilter/filter/data/") + : UnoApiXmlTest(u"/sw/qa/writerfilter/filter/data/"_ustr) { } }; @@ -59,7 +59,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnoteDOCX) // When laying out that document: uno::Reference xModel(mxComponent, uno::UNO_QUERY); css::uno::Reference xDumper(xModel->getCurrentController(), uno::UNO_QUERY); - OString aDump = xDumper->dump("layout").toUtf8(); + OString aDump = xDumper->dump(u"layout"_ustr).toUtf8(); auto pCharBuffer = reinterpret_cast(aDump.getStr()); xmlDocUniquePtr pXmlDoc(xmlParseDoc(pCharBuffer)); diff --git a/sw/qa/writerfilter/ooxml/ooxml.cxx b/sw/qa/writerfilter/ooxml/ooxml.cxx index d174a5facdfc..76d5b389c375 100644 --- a/sw/qa/writerfilter/ooxml/ooxml.cxx +++ b/sw/qa/writerfilter/ooxml/ooxml.cxx @@ -21,7 +21,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/ooxml/data/") + : UnoApiTest(u"/sw/qa/writerfilter/ooxml/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx b/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx index 0b809a872986..03c37a10b8c8 100644 --- a/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx +++ b/sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx @@ -24,7 +24,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("sw/qa//writerfilter/rtftok/data/") + : UnoApiTest(u"sw/qa//writerfilter/rtftok/data/"_ustr) { } }; @@ -116,9 +116,9 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnoteAtSectionEndRTFImport) xParaEnum->nextElement(); uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); uno::Reference xSection; - xPara->getPropertyValue("TextSection") >>= xSection; + xPara->getPropertyValue(u"TextSection"_ustr) >>= xSection; bool bEndnoteIsCollectAtTextEnd = false; - xSection->getPropertyValue("EndnoteIsCollectAtTextEnd") >>= bEndnoteIsCollectAtTextEnd; + xSection->getPropertyValue(u"EndnoteIsCollectAtTextEnd"_ustr) >>= bEndnoteIsCollectAtTextEnd; // Without the accompanying fix in place, this test would have failed, endnotes were always at // document end. CPPUNIT_ASSERT(bEndnoteIsCollectAtTextEnd); diff --git a/sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx b/sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx index 40dccd9e8b4e..29938cf5e921 100644 --- a/sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx +++ b/sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx @@ -23,7 +23,7 @@ class Test : public UnoApiXmlTest { public: Test() - : UnoApiXmlTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiXmlTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx b/sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx index 057204663e5a..29d167c36f90 100644 --- a/sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx +++ b/sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx @@ -22,7 +22,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx b/sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx index 1d4fbc639cbb..e7ef9548078e 100644 --- a/sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx +++ b/sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx @@ -27,7 +27,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtfsdrimport.cxx b/sw/qa/writerfilter/rtftok/rtfsdrimport.cxx index 993bd23243f0..07e918093d94 100644 --- a/sw/qa/writerfilter/rtftok/rtfsdrimport.cxx +++ b/sw/qa/writerfilter/rtftok/rtfsdrimport.cxx @@ -23,7 +23,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtfsprm.cxx b/sw/qa/writerfilter/rtftok/rtfsprm.cxx index 26b558ca03cb..36ee1e2622e2 100644 --- a/sw/qa/writerfilter/rtftok/rtfsprm.cxx +++ b/sw/qa/writerfilter/rtftok/rtfsprm.cxx @@ -22,7 +22,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/qa/writerfilter/rtftok/rtftokenizer.cxx b/sw/qa/writerfilter/rtftok/rtftokenizer.cxx index a2315fb78d17..f40d4472312a 100644 --- a/sw/qa/writerfilter/rtftok/rtftokenizer.cxx +++ b/sw/qa/writerfilter/rtftok/rtftokenizer.cxx @@ -20,7 +20,7 @@ class Test : public UnoApiTest { public: Test() - : UnoApiTest("/sw/qa/writerfilter/rtftok/data/") + : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr) { } }; diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 68499ea3820d..2283febbf429 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1012,7 +1012,7 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const continue; } - OUString sPairTrimmed = ""; + OUString sPairTrimmed = u""_ustr; SwRedlineTable::size_type nPairStart = nPosAct; SwRedlineTable::size_type nPairEnd = nPosAct; diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 34d3c566f016..e37aba5463a9 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1247,7 +1247,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& rUpdLnk, SwSectionNode& rSe if ( pSrcDoc != pDoc && rSection.IsProtectFlag() ) { - pSrcDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks( false, false, nullptr, "" ); + pSrcDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks( false, false, nullptr, u""_ustr ); } if( oCpyRg ) diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index 4f8a6e74764e..0178c48239f6 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -112,7 +112,7 @@ bool SwFEShell::FinishOLEObj() // Server is terminated // if we have more than one link let's update them too sfx2::LinkManager& rLinkManager = GetDoc()->getIDocumentLinksAdministration().GetLinkManager(); if (rLinkManager.GetLinks().size() > 1) - rLinkManager.UpdateAllLinks(false, false, nullptr, ""); + rLinkManager.UpdateAllLinks(false, false, nullptr, u""_ustr); // return back original value of the "update of the link preview" flag rEmbeddedObjectContainer.setUserAllowsLinkUpdate(aUserAllowsLinkUpdate); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 382b08622bbc..61a6ab8d413d 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -2176,7 +2176,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport(LanguageType const eLanguageDe vcl::pdf::PDFNote aNote; // The title should consist of the author and the date: - aNote.maTitle = pField->GetPar1() + ", " + sDate + ", " + (pField->GetResolved() ? SwResId(STR_RESOLVED) : ""); + aNote.maTitle = pField->GetPar1() + ", " + sDate + ", " + (pField->GetResolved() ? SwResId(STR_RESOLVED) : u""_ustr); // Guess what the contents contains... aNote.maContents = pField->GetText(); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index d3cdf7c86868..253765e889a5 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2980,7 +2980,7 @@ css::uno::Any SAL_CALL SwXTextFieldTypes::getByUniqueID(const OUString& ID) void SAL_CALL SwXTextFieldTypes::removeByUniqueID(const OUString& /*ID*/) { - throw uno::RuntimeException("unsupported"); + throw uno::RuntimeException(u"unsupported"_ustr); } class SwXFieldEnumeration::Impl diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index a1572f1e8b45..52f2d30c67a0 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -2570,15 +2570,15 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin, cons } SwCompareOptionsTabPage::SwCompareOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) - : SfxTabPage(pPage, pController, "modules/swriter/ui/optcomparison.ui", "OptComparison", &rSet) - , m_xAutoRB(m_xBuilder->weld_radio_button("auto")) - , m_xWordRB(m_xBuilder->weld_radio_button("byword")) - , m_xCharRB(m_xBuilder->weld_radio_button("bycharacter")) - , m_xCompareModeImg(m_xBuilder->weld_widget("lockcomparemode")) - , m_xRsidCB(m_xBuilder->weld_check_button("useRSID")) - , m_xRsidImg(m_xBuilder->weld_widget("lockuseRSID")) - , m_xStoreRsidCB(m_xBuilder->weld_check_button("storeRSID")) - , m_xStoreRsidImg(m_xBuilder->weld_widget("lockstoreRSID")) + : SfxTabPage(pPage, pController, u"modules/swriter/ui/optcomparison.ui"_ustr, u"OptComparison"_ustr, &rSet) + , m_xAutoRB(m_xBuilder->weld_radio_button(u"auto"_ustr)) + , m_xWordRB(m_xBuilder->weld_radio_button(u"byword"_ustr)) + , m_xCharRB(m_xBuilder->weld_radio_button(u"bycharacter"_ustr)) + , m_xCompareModeImg(m_xBuilder->weld_widget(u"lockcomparemode"_ustr)) + , m_xRsidCB(m_xBuilder->weld_check_button(u"useRSID"_ustr)) + , m_xRsidImg(m_xBuilder->weld_widget(u"lockuseRSID"_ustr)) + , m_xStoreRsidCB(m_xBuilder->weld_check_button(u"storeRSID"_ustr)) + , m_xStoreRsidImg(m_xBuilder->weld_widget(u"lockstoreRSID"_ustr)) { Link aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) ); m_xAutoRB->connect_toggled( aLnk ); @@ -2606,7 +2606,7 @@ OUString SwCompareOptionsTabPage::GetAllStrings() sAllStrings += pString->get_label() + " "; } - OUString radioButton[] = { "auto", "byword", "bycharacter" }; + OUString radioButton[] = { u"auto"_ustr, u"byword"_ustr, u"bycharacter"_ustr }; for (const auto& radio : radioButton) { diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 8d35fb9ddc33..c0b13b967e26 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -97,21 +97,21 @@ IMPL_LINK(SwFootNotePage, LineColorSelected_Impl, ColorListBox&, rColorBox, void SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet) : SfxTabPage(pPage, pController, u"modules/swriter/ui/footnoteareapage.ui"_ustr, u"FootnoteAreaPage"_ustr, &rSet) , m_lMaxHeight(0) - , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button("maxheightpage")) - , m_xMaxHeightBtn(m_xBuilder->weld_radio_button("maxheight")) - , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button("maxheightsb", FieldUnit::CM)) - , m_xDistLabel(m_xBuilder->weld_label("spacetotextlabel")) - , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spacetotext", FieldUnit::CM)) - , m_xLinePosLabel(m_xBuilder->weld_label("positionlabel")) - , m_xLinePosBox(m_xBuilder->weld_combo_box("position")) - , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button("style"))) - , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("thickness", FieldUnit::POINT)) - , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button("color"), + , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button(u"maxheightpage"_ustr)) + , m_xMaxHeightBtn(m_xBuilder->weld_radio_button(u"maxheight"_ustr)) + , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button(u"maxheightsb"_ustr, FieldUnit::CM)) + , m_xDistLabel(m_xBuilder->weld_label(u"spacetotextlabel"_ustr)) + , m_xDistEdit(m_xBuilder->weld_metric_spin_button(u"spacetotext"_ustr, FieldUnit::CM)) + , m_xLinePosLabel(m_xBuilder->weld_label(u"positionlabel"_ustr)) + , m_xLinePosBox(m_xBuilder->weld_combo_box(u"position"_ustr)) + , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button(u"style"_ustr))) + , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button(u"thickness"_ustr, FieldUnit::POINT)) + , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button(u"color"_ustr), [this]{ return GetDialogController()->getDialog(); })) - , m_xLineLengthLabel(m_xBuilder->weld_label("lengthlabel")) - , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button("length", FieldUnit::PERCENT)) - , m_xLineDistLabel(m_xBuilder->weld_label("spacingtocontentslabel")) - , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button("spacingtocontents", FieldUnit::CM)) + , m_xLineLengthLabel(m_xBuilder->weld_label(u"lengthlabel"_ustr)) + , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button(u"length"_ustr, FieldUnit::PERCENT)) + , m_xLineDistLabel(m_xBuilder->weld_label(u"spacingtocontentslabel"_ustr)) + , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button(u"spacingtocontents"_ustr, FieldUnit::CM)) { SetExchangeSupport(); FieldUnit aMetric = ::GetDfltMetric(false); @@ -125,7 +125,7 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p bool bContinuousEndnotes = false; if (const SfxGrabBagItem* pGragbagItem = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG)) { - auto it = pGragbagItem->GetGrabBag().find("ContinuousEndnotes"); + auto it = pGragbagItem->GetGrabBag().find(u"ContinuousEndnotes"_ustr); if (it != pGragbagItem->GetGrabBag().end()) { it->second >>= bContinuousEndnotes; diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 658aeb181d14..87a727ca1e5c 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -212,7 +212,7 @@ void SwViewOption::DrawRectPrinter( OutputDevice *pOut, SwTwips SwViewOption::GetPostItsWidth(const OutputDevice* pOut) { assert(pOut && "no Outdev"); - return pOut->GetTextWidth(" "); + return pOut->GetTextWidth(u" "_ustr); } void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, bool bIsScript ) const diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 24f801f88cb5..dd1ae2ffe3ab 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -453,7 +453,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) *(m_rView.GetDocShell()->GetDoc()), aPos, &aPos)); OUString sName; - xRange->getPropertyValue("HyperLinkName") >>= sName; + xRange->getPropertyValue(u"HyperLinkName"_ustr) >>= sName; if (!sName.isEmpty()) { bScreenTip = true; diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index e932610066c7..64a3596ce9d1 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -210,66 +210,66 @@ static rtl::Reference lcl_createSettingsInfo() { u"ConsiderTextWrapOnObjPos"_ustr, HANDLE_CONSIDER_WRAP_ON_OBJPOS, cppu::UnoType::get(), 0}, { u"IgnoreFirstLineIndentInNumbering"_ustr, HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING, cppu::UnoType::get(), 0}, { u"NoGapAfterNoteNumber"_ustr, HANDLE_NO_GAP_AFTER_NOTE_NUMBER, cppu::UnoType::get(), 0}, - { OUString("DoNotJustifyLinesWithManualBreak"), HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, cppu::UnoType::get(), 0}, - { OUString("DoNotResetParaAttrsForNumFont"), HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, cppu::UnoType::get(), 0}, - { OUString("TableRowKeep"), HANDLE_TABLE_ROW_KEEP, cppu::UnoType::get(), 0}, - { OUString("IgnoreTabsAndBlanksForLineCalculation"), HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, cppu::UnoType::get(), 0}, - { OUString("LoadReadonly"), HANDLE_LOAD_READONLY, cppu::UnoType::get(), 0}, - { OUString("DoNotCaptureDrawObjsOnPage"), HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, cppu::UnoType::get(), 0}, - { OUString("ClipAsCharacterAnchoredWriterFlyFrames"), HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, cppu::UnoType::get(), 0}, - { OUString("UnxForceZeroExtLeading"), HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, cppu::UnoType::get(), 0}, - { OUString("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, cppu::UnoType::get(), 0}, - { OUString("TabsRelativeToIndent"), HANDLE_TABS_RELATIVE_TO_INDENT, cppu::UnoType::get(), 0}, - { OUString("Rsid"), HANDLE_RSID, cppu::UnoType::get(), 0}, - { OUString("RsidRoot"), HANDLE_RSID_ROOT, cppu::UnoType::get(), 0}, - { OUString("ProtectForm"), HANDLE_PROTECT_FORM, cppu::UnoType::get(), 0}, - { OUString("MsWordCompTrailingBlanks"), HANDLE_MS_WORD_COMP_TRAILING_BLANKS, cppu::UnoType::get(), 0 }, - { OUString("MsWordCompMinLineHeightByFly"), HANDLE_MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY, cppu::UnoType::get(), 0 }, - { OUString("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, cppu::UnoType::get(), 0}, - { OUString("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, cppu::UnoType< cppu::UnoSequenceType >::get(), 0}, - { OUString("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, cppu::UnoType::get(), 0}, - { OUString("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, cppu::UnoType::get(), 0}, - { OUString("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, cppu::UnoType::get(), 0}, - { OUString("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, cppu::UnoType::get(), 0}, - { OUString("TabOverflow"), HANDLE_TAB_OVERFLOW, cppu::UnoType::get(), 0}, - { OUString("UnbreakableNumberings"), HANDLE_UNBREAKABLE_NUMBERINGS, cppu::UnoType::get(), 0}, - { OUString("StylesNoDefault"), HANDLE_STYLES_NODEFAULT, cppu::UnoType::get(), 0}, - { OUString("ClippedPictures"), HANDLE_CLIPPED_PICTURES, cppu::UnoType::get(), 0}, - { OUString("BackgroundParaOverDrawings"), HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, cppu::UnoType::get(), 0}, - { OUString("EmbedFonts"), HANDLE_EMBED_FONTS, cppu::UnoType::get(), 0}, - { OUString("EmbedOnlyUsedFonts"), HANDLE_EMBED_USED_FONTS, cppu::UnoType::get(), 0}, - { OUString("EmbedLatinScriptFonts"), HANDLE_EMBED_LATIN_SCRIPT_FONTS, cppu::UnoType::get(), 0}, - { OUString("EmbedAsianScriptFonts"), HANDLE_EMBED_ASIAN_SCRIPT_FONTS, cppu::UnoType::get(), 0}, - { OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType::get(), 0}, - { OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType::get(), 0}, - { OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType::get(), 0}, - { OUString("TabOverSpacing"), HANDLE_TAB_OVER_SPACING, cppu::UnoType::get(), 0}, - { OUString("TreatSingleColumnBreakAsPageBreak"), HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType::get(), 0}, - { OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType::get(), 0}, - { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType::get(), 0}, - { OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType::get(), 0}, - { OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType::get(), 0}, - { OUString("DisableOffPagePositioning"), HANDLE_DISABLE_OFF_PAGE_POSITIONING, cppu::UnoType::get(), 0}, - { OUString("EmptyDbFieldHidesPara"), HANDLE_EMPTY_DB_FIELD_HIDES_PARA, cppu::UnoType::get(), 0 }, - { OUString("ContinuousEndnotes"), HANDLE_CONTINUOUS_ENDNOTES, cppu::UnoType::get(), 0 }, - { OUString("ProtectBookmarks"), HANDLE_PROTECT_BOOKMARKS, cppu::UnoType::get(), 0 }, - { OUString("ProtectFields"), HANDLE_PROTECT_FIELDS, cppu::UnoType::get(), 0 }, - { OUString("HeaderSpacingBelowLastPara"), HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType::get(), 0 }, - { OUString("FrameAutowidthWithMorePara"), HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, cppu::UnoType::get(), 0 }, - { OUString("GutterAtTop"), HANDLE_GUTTER_AT_TOP, cppu::UnoType::get(), 0 }, - { OUString("FootnoteInColumnToPageEnd"), HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, cppu::UnoType::get(), 0 }, - { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType::get(), 0 }, - { OUString("AutoFirstLineIndentDisregardLineSpace"), HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType::get(), 0 }, - { OUString("HyphenateURLs"), HANDLE_HYPHENATE_URLS, cppu::UnoType::get(), 0 }, - { OUString("DoNotBreakWrappedTables"), HANDLE_DO_NOT_BREAK_WRAPPED_TABLES, cppu::UnoType::get(), 0 }, - { OUString("AllowTextAfterFloatingTableBreak"), HANDLE_ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK, cppu::UnoType::get(), 0 }, - { OUString("JustifyLinesWithShrinking"), HANDLE_JUSTIFY_LINES_WITH_SHRINKING, cppu::UnoType::get(), 0 }, - { OUString("NoNumberingShowFollowBy"), HANDLE_NO_NUMBERING_SHOW_FOLLOWBY, cppu::UnoType::get(), 0 }, - { OUString("DropCapPunctuation"), HANDLE_DROP_CAP_PUNCTUATION, cppu::UnoType::get(), 0 }, - { OUString("UseVariableWidthNBSP"), HANDLE_USE_VARIABLE_WIDTH_NBSP, cppu::UnoType::get(), 0 }, - { OUString("ApplyTextAttrToEmptyLineAtEndOfParagraph"), HANDLE_APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH, cppu::UnoType::get(), 0 }, - { OUString("DoNotMirrorRtlDrawObjs"), HANDLE_DO_NOT_MIRROR_RTL_DRAW_OBJS, cppu::UnoType::get(), 0 }, - { OUString("PaintHellOverHeaderFooter"), HANDLE_PAINT_HELL_OVER_HEADER_FOOTER, cppu::UnoType::get(), 0 }, + { u"DoNotJustifyLinesWithManualBreak"_ustr, HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, cppu::UnoType::get(), 0}, + { u"DoNotResetParaAttrsForNumFont"_ustr, HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, cppu::UnoType::get(), 0}, + { u"TableRowKeep"_ustr, HANDLE_TABLE_ROW_KEEP, cppu::UnoType::get(), 0}, + { u"IgnoreTabsAndBlanksForLineCalculation"_ustr, HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, cppu::UnoType::get(), 0}, + { u"LoadReadonly"_ustr, HANDLE_LOAD_READONLY, cppu::UnoType::get(), 0}, + { u"DoNotCaptureDrawObjsOnPage"_ustr, HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, cppu::UnoType::get(), 0}, + { u"ClipAsCharacterAnchoredWriterFlyFrames"_ustr, HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, cppu::UnoType::get(), 0}, + { u"UnxForceZeroExtLeading"_ustr, HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, cppu::UnoType::get(), 0}, + { u"UseOldPrinterMetrics"_ustr, HANDLE_USE_OLD_PRINTER_METRICS, cppu::UnoType::get(), 0}, + { u"TabsRelativeToIndent"_ustr, HANDLE_TABS_RELATIVE_TO_INDENT, cppu::UnoType::get(), 0}, + { u"Rsid"_ustr, HANDLE_RSID, cppu::UnoType::get(), 0}, + { u"RsidRoot"_ustr, HANDLE_RSID_ROOT, cppu::UnoType::get(), 0}, + { u"ProtectForm"_ustr, HANDLE_PROTECT_FORM, cppu::UnoType::get(), 0}, + { u"MsWordCompTrailingBlanks"_ustr, HANDLE_MS_WORD_COMP_TRAILING_BLANKS, cppu::UnoType::get(), 0 }, + { u"MsWordCompMinLineHeightByFly"_ustr, HANDLE_MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY, cppu::UnoType::get(), 0 }, + { u"TabAtLeftIndentForParagraphsInList"_ustr, HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, cppu::UnoType::get(), 0}, + { u"ModifyPasswordInfo"_ustr, HANDLE_MODIFYPASSWORDINFO, cppu::UnoType< cppu::UnoSequenceType >::get(), 0}, + { u"MathBaselineAlignment"_ustr, HANDLE_MATH_BASELINE_ALIGNMENT, cppu::UnoType::get(), 0}, + { u"InvertBorderSpacing"_ustr, HANDLE_INVERT_BORDER_SPACING, cppu::UnoType::get(), 0}, + { u"CollapseEmptyCellPara"_ustr, HANDLE_COLLAPSE_EMPTY_CELL_PARA, cppu::UnoType::get(), 0}, + { u"SmallCapsPercentage66"_ustr, HANDLE_SMALL_CAPS_PERCENTAGE_66, cppu::UnoType::get(), 0}, + { u"TabOverflow"_ustr, HANDLE_TAB_OVERFLOW, cppu::UnoType::get(), 0}, + { u"UnbreakableNumberings"_ustr, HANDLE_UNBREAKABLE_NUMBERINGS, cppu::UnoType::get(), 0}, + { u"StylesNoDefault"_ustr, HANDLE_STYLES_NODEFAULT, cppu::UnoType::get(), 0}, + { u"ClippedPictures"_ustr, HANDLE_CLIPPED_PICTURES, cppu::UnoType::get(), 0}, + { u"BackgroundParaOverDrawings"_ustr, HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, cppu::UnoType::get(), 0}, + { u"EmbedFonts"_ustr, HANDLE_EMBED_FONTS, cppu::UnoType::get(), 0}, + { u"EmbedOnlyUsedFonts"_ustr, HANDLE_EMBED_USED_FONTS, cppu::UnoType::get(), 0}, + { u"EmbedLatinScriptFonts"_ustr, HANDLE_EMBED_LATIN_SCRIPT_FONTS, cppu::UnoType::get(), 0}, + { u"EmbedAsianScriptFonts"_ustr, HANDLE_EMBED_ASIAN_SCRIPT_FONTS, cppu::UnoType::get(), 0}, + { u"EmbedComplexScriptFonts"_ustr, HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType::get(), 0}, + { u"EmbedSystemFonts"_ustr, HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType::get(), 0}, + { u"TabOverMargin"_ustr, HANDLE_TAB_OVER_MARGIN, cppu::UnoType::get(), 0}, + { u"TabOverSpacing"_ustr, HANDLE_TAB_OVER_SPACING, cppu::UnoType::get(), 0}, + { u"TreatSingleColumnBreakAsPageBreak"_ustr, HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType::get(), 0}, + { u"SurroundTextWrapSmall"_ustr, HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType::get(), 0}, + { u"ApplyParagraphMarkFormatToNumbering"_ustr, HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType::get(), 0}, + { u"PropLineSpacingShrinksFirstLine"_ustr, HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType::get(), 0}, + { u"SubtractFlysAnchoredAtFlys"_ustr, HANDLE_SUBTRACT_FLYS, cppu::UnoType::get(), 0}, + { u"DisableOffPagePositioning"_ustr, HANDLE_DISABLE_OFF_PAGE_POSITIONING, cppu::UnoType::get(), 0}, + { u"EmptyDbFieldHidesPara"_ustr, HANDLE_EMPTY_DB_FIELD_HIDES_PARA, cppu::UnoType::get(), 0 }, + { u"ContinuousEndnotes"_ustr, HANDLE_CONTINUOUS_ENDNOTES, cppu::UnoType::get(), 0 }, + { u"ProtectBookmarks"_ustr, HANDLE_PROTECT_BOOKMARKS, cppu::UnoType::get(), 0 }, + { u"ProtectFields"_ustr, HANDLE_PROTECT_FIELDS, cppu::UnoType::get(), 0 }, + { u"HeaderSpacingBelowLastPara"_ustr, HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType::get(), 0 }, + { u"FrameAutowidthWithMorePara"_ustr, HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, cppu::UnoType::get(), 0 }, + { u"GutterAtTop"_ustr, HANDLE_GUTTER_AT_TOP, cppu::UnoType::get(), 0 }, + { u"FootnoteInColumnToPageEnd"_ustr, HANDLE_FOOTNOTE_IN_COLUMN_TO_PAGEEND, cppu::UnoType::get(), 0 }, + { u"ImagePreferredDPI"_ustr, HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType::get(), 0 }, + { u"AutoFirstLineIndentDisregardLineSpace"_ustr, HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType::get(), 0 }, + { u"HyphenateURLs"_ustr, HANDLE_HYPHENATE_URLS, cppu::UnoType::get(), 0 }, + { u"DoNotBreakWrappedTables"_ustr, HANDLE_DO_NOT_BREAK_WRAPPED_TABLES, cppu::UnoType::get(), 0 }, + { u"AllowTextAfterFloatingTableBreak"_ustr, HANDLE_ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK, cppu::UnoType::get(), 0 }, + { u"JustifyLinesWithShrinking"_ustr, HANDLE_JUSTIFY_LINES_WITH_SHRINKING, cppu::UnoType::get(), 0 }, + { u"NoNumberingShowFollowBy"_ustr, HANDLE_NO_NUMBERING_SHOW_FOLLOWBY, cppu::UnoType::get(), 0 }, + { u"DropCapPunctuation"_ustr, HANDLE_DROP_CAP_PUNCTUATION, cppu::UnoType::get(), 0 }, + { u"UseVariableWidthNBSP"_ustr, HANDLE_USE_VARIABLE_WIDTH_NBSP, cppu::UnoType::get(), 0 }, + { u"ApplyTextAttrToEmptyLineAtEndOfParagraph"_ustr, HANDLE_APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH, cppu::UnoType::get(), 0 }, + { u"DoNotMirrorRtlDrawObjs"_ustr, HANDLE_DO_NOT_MIRROR_RTL_DRAW_OBJS, cppu::UnoType::get(), 0 }, + { u"PaintHellOverHeaderFooter"_ustr, HANDLE_PAINT_HELL_OVER_HEADER_FOOTER, cppu::UnoType::get(), 0 }, /* * As OS said, we don't have a view when we need to set this, so I have to diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 31f76fe179a3..c7056dc0294b 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2336,7 +2336,7 @@ void SwXTextDocument::updateLinks( ) if( !rLnkMan.GetLinks().empty() ) { UnoActionContext aAction(&rDoc); - rLnkMan.UpdateAllLinks( false, true, nullptr, "" ); + rLnkMan.UpdateAllLinks( false, true, nullptr, u""_ustr ); } } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 367f05367b2d..5c2b934997bd 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1980,8 +1980,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) if (nContentType == ContentTypeId::POSTIT) { const SwViewOption* m_pViewOpt = m_pActiveShell->GetViewOptions(); - xPop->set_active("showcomments", m_pViewOpt->IsPostIts()); - xPop->set_active("showresolvedcomments", m_pViewOpt->IsResolvedPostIts()); + xPop->set_active(u"showcomments"_ustr, m_pViewOpt->IsPostIts()); + xPop->set_active(u"showresolvedcomments"_ustr, m_pViewOpt->IsResolvedPostIts()); bRemovePostItEntries = false; } else if (nContentType == ContentTypeId::FOOTNOTE) @@ -2014,8 +2014,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, rCEvt, bool) if (bRemovePostItEntries) { - xPop->remove("showcomments"); - xPop->remove("showresolvedcomments"); + xPop->remove(u"showcomments"_ustr); + xPop->remove(u"showresolvedcomments"_ustr); xPop->remove(OUString::number(602)); } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 8dab9b527c6e..39c75aefc553 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -611,7 +611,7 @@ void SwGlobalTree::ExecuteContextMenuAction(std::u16string_view rSelectedPopupEn } else if (rSelectedPopupEntry == u"updatelinks" || rSelectedPopupEntry == u"updateall") { - m_pActiveShell->GetLinkManager().UpdateAllLinks(true, false, nullptr, ""); + m_pActiveShell->GetLinkManager().UpdateAllLinks(true, false, nullptr, u""_ustr); if (rSelectedPopupEntry == u"updateall") nSlot = FN_UPDATE_TOX; pCont = nullptr; diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 12ed53513cf2..0672f41047a8 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -638,7 +638,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) const IDocumentSettingAccess& rIDSA = rMaster.getIDocumentSettingAccess(); if (rIDSA.get(DocumentSettingId::CONTINUOUS_ENDNOTES)) { - oGrabBag->GetGrabBag()["ContinuousEndnotes"] <<= true; + oGrabBag->GetGrabBag()[u"ContinuousEndnotes"_ustr] <<= true; } rSet.Put(*oGrabBag); diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx index d8c6d1ffc5d6..8e32f2e34569 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx @@ -146,9 +146,9 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon m_pImpl->SetDocumentSettingsProperty(u"NoGapAfterNoteNumber"_ustr, uno::Any(true)); // Enable only for new documents, since pasting from clipboard can influence existing doc - m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true)); + m_pImpl->SetDocumentSettingsProperty(u"NoNumberingShowFollowBy"_ustr, uno::Any(true)); //paint background frames after header/footer when anchored in body - m_pImpl->SetDocumentSettingsProperty("PaintHellOverHeaderFooter",uno::Any(true)); + m_pImpl->SetDocumentSettingsProperty(u"PaintHellOverHeaderFooter"_ustr,uno::Any(true)); } // Initialize RDF metadata, to be able to add statements during the import. diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx b/sw/source/writerfilter/dmapper/GraphicImport.cxx index bab91d2b7fe0..b05e3f2334d5 100644 --- a/sw/source/writerfilter/dmapper/GraphicImport.cxx +++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx @@ -1954,54 +1954,54 @@ rtl::Reference GraphicImport::createGraphicObject(uno::Ref } // copy the image fill area properties - xGraphicObject->setPropertyValue("FillBackground", - xShapeProps->getPropertyValue("FillBackground")); - xGraphicObject->setPropertyValue("FillBitmap", - xShapeProps->getPropertyValue("FillBitmap")); + xGraphicObject->setPropertyValue(u"FillBackground"_ustr, + xShapeProps->getPropertyValue(u"FillBackground"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmap"_ustr, + xShapeProps->getPropertyValue(u"FillBitmap"_ustr)); xGraphicObject->setPropertyValue( - "FillBitmapLogicalSize", xShapeProps->getPropertyValue("FillBitmapLogicalSize")); - xGraphicObject->setPropertyValue("FillBitmapMode", - xShapeProps->getPropertyValue("FillBitmapMode")); - xGraphicObject->setPropertyValue("FillBitmapOffsetX", - xShapeProps->getPropertyValue("FillBitmapOffsetX")); + u"FillBitmapLogicalSize"_ustr, xShapeProps->getPropertyValue(u"FillBitmapLogicalSize"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapMode"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapMode"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapOffsetX"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapOffsetX"_ustr)); xGraphicObject->setPropertyValue( - "FillBitmapPositionOffsetX", - xShapeProps->getPropertyValue("FillBitmapPositionOffsetX")); + u"FillBitmapPositionOffsetX"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapPositionOffsetX"_ustr)); xGraphicObject->setPropertyValue( - "FillBitmapPositionOffsetY", - xShapeProps->getPropertyValue("FillBitmapPositionOffsetY")); + u"FillBitmapPositionOffsetY"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapPositionOffsetY"_ustr)); xGraphicObject->setPropertyValue( - "FillBitmapRectanglePoint", - xShapeProps->getPropertyValue("FillBitmapRectanglePoint")); - xGraphicObject->setPropertyValue("FillBitmapSizeX", - xShapeProps->getPropertyValue("FillBitmapSizeX")); - xGraphicObject->setPropertyValue("FillBitmapSizeY", - xShapeProps->getPropertyValue("FillBitmapSizeY")); - xGraphicObject->setPropertyValue("FillBitmapStretch", - xShapeProps->getPropertyValue("FillBitmapStretch")); - xGraphicObject->setPropertyValue("FillBitmapTile", - xShapeProps->getPropertyValue("FillBitmapTile")); - xGraphicObject->setPropertyValue("FillBitmapURL", - xShapeProps->getPropertyValue("FillBitmapURL")); - xGraphicObject->setPropertyValue("FillColor", - xShapeProps->getPropertyValue("FillColor")); - xGraphicObject->setPropertyValue("FillColor2", - xShapeProps->getPropertyValue("FillColor2")); - xGraphicObject->setPropertyValue("FillComplexColor", - xShapeProps->getPropertyValue("FillComplexColor")); - xGraphicObject->setPropertyValue("FillGradient", - xShapeProps->getPropertyValue("FillGradient")); + u"FillBitmapRectanglePoint"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapRectanglePoint"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapSizeX"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapSizeX"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapSizeY"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapSizeY"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapStretch"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapStretch"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapTile"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapTile"_ustr)); + xGraphicObject->setPropertyValue(u"FillBitmapURL"_ustr, + xShapeProps->getPropertyValue(u"FillBitmapURL"_ustr)); + xGraphicObject->setPropertyValue(u"FillColor"_ustr, + xShapeProps->getPropertyValue(u"FillColor"_ustr)); + xGraphicObject->setPropertyValue(u"FillColor2"_ustr, + xShapeProps->getPropertyValue(u"FillColor2"_ustr)); + xGraphicObject->setPropertyValue(u"FillComplexColor"_ustr, + xShapeProps->getPropertyValue(u"FillComplexColor"_ustr)); + xGraphicObject->setPropertyValue(u"FillGradient"_ustr, + xShapeProps->getPropertyValue(u"FillGradient"_ustr)); xGraphicObject->setPropertyValue( - "FillGradientStepCount", xShapeProps->getPropertyValue("FillGradientStepCount")); - xGraphicObject->setPropertyValue("FillHatch", - xShapeProps->getPropertyValue("FillHatch")); - xGraphicObject->setPropertyValue("FillStyle", - xShapeProps->getPropertyValue("FillStyle")); - xGraphicObject->setPropertyValue("FillTransparence", - xShapeProps->getPropertyValue("FillTransparence")); + u"FillGradientStepCount"_ustr, xShapeProps->getPropertyValue(u"FillGradientStepCount"_ustr)); + xGraphicObject->setPropertyValue(u"FillHatch"_ustr, + xShapeProps->getPropertyValue(u"FillHatch"_ustr)); + xGraphicObject->setPropertyValue(u"FillStyle"_ustr, + xShapeProps->getPropertyValue(u"FillStyle"_ustr)); + xGraphicObject->setPropertyValue(u"FillTransparence"_ustr, + xShapeProps->getPropertyValue(u"FillTransparence"_ustr)); xGraphicObject->setPropertyValue( - "FillTransparenceGradient", - xShapeProps->getPropertyValue("FillTransparenceGradient")); + u"FillTransparenceGradient"_ustr, + xShapeProps->getPropertyValue(u"FillTransparenceGradient"_ustr)); m_pImpl->applyZOrder(xGraphicObject); diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx b/sw/source/writerfilter/dmapper/PropertyMap.cxx index 6c169b610d4b..3d071ff427bd 100644 --- a/sw/source/writerfilter/dmapper/PropertyMap.cxx +++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx @@ -766,7 +766,7 @@ void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XP { std::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE ); if ( pProp ) - xSection->setPropertyValue( "WritingMode", pProp->second ); + xSection->setPropertyValue( u"WritingMode"_ustr, pProp->second ); if (rDM_Impl.GetSettingsTable()->GetEndnoteIsCollectAtSectionEnd()) { diff --git a/sw/source/writerfilter/filter/WriterFilter.cxx b/sw/source/writerfilter/filter/WriterFilter.cxx index f026a1f35e6c..0ad349bb3eda 100644 --- a/sw/source/writerfilter/filter/WriterFilter.cxx +++ b/sw/source/writerfilter/filter/WriterFilter.cxx @@ -323,19 +323,19 @@ void WriterFilter::setTargetDocument(const uno::Reference& xDo xSettings->setPropertyValue(u"TabOverSpacing"_ustr, uno::Any(true)); xSettings->setPropertyValue(u"UnbreakableNumberings"_ustr, uno::Any(true)); - xSettings->setPropertyValue("ClippedPictures", uno::Any(true)); - xSettings->setPropertyValue("BackgroundParaOverDrawings", uno::Any(true)); - xSettings->setPropertyValue("TreatSingleColumnBreakAsPageBreak", uno::Any(true)); - xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::Any(true)); - xSettings->setPropertyValue("DoNotCaptureDrawObjsOnPage", uno::Any(true)); - xSettings->setPropertyValue("DisableOffPagePositioning", uno::Any(true)); - xSettings->setPropertyValue("DropCapPunctuation", uno::Any(true)); - xSettings->setPropertyValue("PaintHellOverHeaderFooter", uno::Any(true)); + xSettings->setPropertyValue(u"ClippedPictures"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"BackgroundParaOverDrawings"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"TreatSingleColumnBreakAsPageBreak"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"PropLineSpacingShrinksFirstLine"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"DoNotCaptureDrawObjsOnPage"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"DisableOffPagePositioning"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"DropCapPunctuation"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"PaintHellOverHeaderFooter"_ustr, uno::Any(true)); // rely on default for HyphenateURLs=false // rely on default for APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH=true - xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true)); - xSettings->setPropertyValue("ContinuousEndnotes", uno::Any(true)); + xSettings->setPropertyValue(u"DoNotMirrorRtlDrawObjs"_ustr, uno::Any(true)); + xSettings->setPropertyValue(u"ContinuousEndnotes"_ustr, uno::Any(true)); } void WriterFilter::setSourceDocument(const uno::Reference& xDoc) diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index ea0c4ccfaf7a..862b78027ed7 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -417,7 +417,7 @@ void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDes ( !aImageURL.isEmpty() )) { OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::Any(aImageURL)); - xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl, "" ); + xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl, u""_ustr ); ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::Any( xGraphic ), true ); } } @@ -632,7 +632,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang ( !aImageURL.isEmpty() )) { OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::Any(aImageURL)); - xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl, "" ); + xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl, u""_ustr ); } ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::Any( xGraphic ), true ); break; diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 452d1dc41542..e3a73822a155 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -62,7 +62,7 @@ uno::Reference< graphic::XGraphic > ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const OUString& _rURL ) { xOutGraphicObj = nullptr; - return ImageHelper::getGraphicFromURL_nothrow( _rURL, "" ); + return ImageHelper::getGraphicFromURL_nothrow( _rURL, u""_ustr ); } css::uno::Reference< css::graphic::XGraphic > diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index b7a04d98ad80..62b8ac2777dc 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -628,7 +628,7 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107612) CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testPartialKoreanJamoComposition) { OUString aStr = u"은"_ustr; - vcl::Font aFont("DejaVu Sans", "Book", Size(0, 2048)); + vcl::Font aFont(u"DejaVu Sans"_ustr, u"Book"_ustr, Size(0, 2048)); ScopedVclPtrInstance pOutDev; pOutDev->SetFont(aFont); @@ -664,7 +664,7 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testPartialKoreanJamoComposition) CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testPartialArabicComposition) { OUString aStr = u"سُكُونْ"_ustr; - vcl::Font aFont("DejaVu Sans", "Book", Size(0, 2048)); + vcl::Font aFont(u"DejaVu Sans"_ustr, u"Book"_ustr, Size(0, 2048)); ScopedVclPtrInstance pOutDev; pOutDev->SetFont(aFont); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 5ede679fcdab..6c0f39e977bd 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -5012,7 +5012,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf159817) // Tests that kerning is correctly applied across color changes CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf61444) { - aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); + aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; saveAsPDF(u"tdf61444.odt"); std::unique_ptr pPdfDocument = parsePDFExport(); @@ -5061,7 +5061,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf61444) // tdf#124116 - Tests that track-changes inside a grapheme cluster does not break positioning CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf124116TrackUntrack) { - aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); + aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; saveAsPDF(u"tdf124116-hebrew-track-untrack.odt"); std::unique_ptr pPdfDocument = parsePDFExport(); @@ -5118,7 +5118,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf124116TrackUntrack) // tdf#134226 - Tests that shaping is not broken by invisible spans CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf134226) { - aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); + aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; saveAsPDF(u"tdf134226-shadda-in-hidden-span.fodt"); std::unique_ptr pPdfDocument = parsePDFExport(); @@ -5176,7 +5176,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf134226) // tdf#71956 - Tests that glyphs can be individually styled CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf71956) { - aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); + aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; saveAsPDF(u"tdf71956-styled-diacritics.fodt"); std::unique_ptr pPdfDocument = parsePDFExport(); diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index f3773424ea65..e3f54e451898 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -883,8 +883,8 @@ void SvmTest::checkTextArrayWithContext(const GDIMetaFile& rMetaFile) { "length", "4" }, { "layoutcontextindex", "0" }, { "layoutcontextlength", "5" } }); - assertXPathContent(pDoc, "/metafile/textarray[1]/dxarray"_ostr, "15 20 25 "); - assertXPathContent(pDoc, "/metafile/textarray[1]/text"_ostr, "123456"); + assertXPathContent(pDoc, "/metafile/textarray[1]/dxarray"_ostr, u"15 20 25 "_ustr); + assertXPathContent(pDoc, "/metafile/textarray[1]/text"_ostr, u"123456"_ustr); } void SvmTest::testTextArrayWithContext() @@ -893,7 +893,7 @@ void SvmTest::testTextArrayWithContext() ScopedVclPtrInstance pVirtualDev; setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); sal_Int32 const aDX[] = { 10, 15, 20, 25, 30, 35 }; - pVirtualDev->DrawPartialTextArray(Point(4, 6), "123456", KernArraySpan(aDX), {}, 0, 5, 1, 4); + pVirtualDev->DrawPartialTextArray(Point(4, 6), u"123456"_ustr, KernArraySpan(aDX), {}, 0, 5, 1, 4); checkTextArrayWithContext(writeAndReadStream(aGDIMetaFile)); checkTextArrayWithContext(readFile(u"textarraycontext.svm")); diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx index 3cf88138eb29..23c8d5f963c4 100644 --- a/vcl/qa/cppunit/text.cxx +++ b/vcl/qa/cppunit/text.cxx @@ -1024,7 +1024,7 @@ CPPUNIT_TEST_FIXTURE(VclTextTest, testGetRightBottomAlignedMultiLineTextRect) CPPUNIT_TEST_FIXTURE(VclTextTest, testPartialTextArraySizeMatch) { OUString aWater = u"Water"_ustr; - vcl::Font aFont("DejaVu Sans", "Book", Size(0, 2048)); + vcl::Font aFont(u"DejaVu Sans"_ustr, u"Book"_ustr, Size(0, 2048)); ScopedVclPtrInstance pOutDev; pOutDev->SetFont(aFont); diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index feb4f0b2011f..9614c7493c90 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -51,7 +51,7 @@ namespace { SvMemoryStream aOStm(65535, 65535); // Use fastest compression "1" css::uno::Sequence aFilterData{ - comphelper::makePropertyValue("Compression", sal_Int32(1)), + comphelper::makePropertyValue(u"Compression"_ustr, sal_Int32(1)), }; vcl::PngImageWriter aPNGWriter(aOStm); aPNGWriter.setParameters(aFilterData); diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index a77aca26482d..61c091a2d015 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -73,6 +73,7 @@ X11SalInstance::X11SalInstance(std::unique_ptr pMutex) , mpXLib(nullptr) { ImplSVData* pSVData = ImplGetSVData(); + // [-loplugin:ostr] if we use a literal here, we get use-after-free on shutdown pSVData->maAppData.mxToolkitName = OUString("x11"); m_bSupportsOpenGL = true; #if HAVE_FEATURE_SKIA diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index d354fd4b7bbd..d3e1493f8f3b 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -245,8 +245,10 @@ void GtkInstance::EnsureInit() ImplSVData* pSVData = ImplGetSVData(); #ifdef GTK_TOOLKIT_NAME + // [-loplugin:ostr] if we use a literal here, we get use-after-free on shutdown pSVData->maAppData.mxToolkitName = OUString(GTK_TOOLKIT_NAME); #else + // [-loplugin:ostr] if we use a literal here, we get use-after-free on shutdown pSVData->maAppData.mxToolkitName = OUString("gtk3"); #endif diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 82ce06b7245f..cff6a4d40d8f 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -571,7 +571,7 @@ namespace xmloff { try { props->setPropertyValue( - "Referer", css::uno::Any(m_rFormImport.getGlobalContext().GetBaseURL())); + u"Referer"_ustr, css::uno::Any(m_rFormImport.getGlobalContext().GetBaseURL())); } catch (css::uno::Exception &) { TOOLS_INFO_EXCEPTION("xmloff.forms", "setPropertyValue Referer failed"); }