From da3a91e89f803d1c42b764c90071b30b547e686b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 19 Oct 2023 10:30:24 +0200 Subject: Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: sc Change-Id: Ieed908bfa2cb6370ead922dfc00dbdb4f905f3cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158216 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 2 +- sc/source/filter/xml/XMLCodeNameProvider.cxx | 4 ++-- sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 2 +- sc/source/filter/xml/XMLStylesExportHelper.cxx | 2 +- sc/source/filter/xml/xmlexprt.cxx | 8 ++++---- sc/source/filter/xml/xmlimprt.cxx | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sc/source/filter/xml') diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index efe429b49faa..076ceda030f9 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -28,7 +28,7 @@ #include #include -constexpr OStringLiteral SC_CHANGE_ID_PREFIX = "ct"; +constexpr OString SC_CHANGE_ID_PREFIX = "ct"_ostr; ScMyCellInfo::ScMyCellInfo( ScCellValue aCell, OUString aFormulaAddress, OUString aFormula, diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx index 063729d5c2f8..347f21d0f850 100644 --- a/sc/source/filter/xml/XMLCodeNameProvider.cxx +++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx @@ -48,8 +48,8 @@ bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, OUString& rCodeNam return false; } -constexpr OUStringLiteral gsDocName( u"*doc*" ); -constexpr OUStringLiteral gsCodeNameProp( u"CodeName" ); +constexpr OUString gsDocName( u"*doc*"_ustr ); +constexpr OUString gsCodeNameProp( u"CodeName"_ustr ); XMLCodeNameProvider::XMLCodeNameProvider( ScDocument* pDoc ) : mpDoc( pDoc ) diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 61c01d236bfa..6905e02d651b 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -50,7 +50,7 @@ #include //! not found in unonames.hxx -constexpr OUStringLiteral SC_USERLIST = u"UserList"; +constexpr OUString SC_USERLIST = u"UserList"_ustr; using namespace com::sun::star; using namespace xmloff::token; diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index a100c61e5c8d..0708bfd6c25d 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -384,7 +384,7 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) // and the property name is "MacroName". bool bScriptURL = SfxApplication::IsXScriptURL( rValidation.sErrorTitle ); - static constexpr OUStringLiteral sScript(u"Script"); + static constexpr OUString sScript(u"Script"_ustr); uno::Sequence aSeq( comphelper::InitPropertySequence({ { "EventType", uno::Any(bScriptURL ? sScript : OUString("StarBasic")) }, { "Library", uno::Any(OUString()) }, diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 9acae7b1ec0d..e1d1b7bc0f79 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -167,7 +167,7 @@ namespace com::sun::star::uno { class XComponentContext; } //! not found in unonames.hxx -constexpr OUStringLiteral SC_LAYERID = u"LayerID"; +constexpr OUString SC_LAYERID = u"LayerID"_ustr; #define SC_VIEWCHANGES_COUNT 13 #define SC_SHOW_CHANGES 0 @@ -895,7 +895,7 @@ void ScXMLExport::ExportExternalRefCacheStyles() // Export each unique number format used in the external ref cache. vector aNumFmts; pRefMgr->getAllCachedNumberFormats(aNumFmts); - static constexpr OUStringLiteral aDefaultStyle(u"Default"); + static constexpr OUString aDefaultStyle(u"Default"_ustr); for (const auto& rNumFmt : aNumFmts) { sal_Int32 nNumFmt = static_cast(rNumFmt); @@ -905,7 +905,7 @@ void ScXMLExport::ExportExternalRefCacheStyles() uno::Any aVal; aVal <<= nNumFmt; vector aProps; - aVal <<= OUString(aDefaultStyle); + aVal <<= aDefaultStyle; aProps.emplace_back(nEntryIndex, aVal); OUString aName; @@ -1828,7 +1828,7 @@ void ScXMLExport::CopySourceStream( sal_Int64 nStartOffset, sal_Int64 nEndOffset if ( getExportFlags() & SvXMLExportFlags::PRETTY ) { - static constexpr OStringLiteral aOutStr("\n "); + static constexpr OString aOutStr("\n "_ostr); uno::Sequence aOutSeq( reinterpret_cast(aOutStr.getStr()), aOutStr.getLength() ); xDestStream->writeBytes( aOutSeq ); } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index b440d5ca0392..db113a47b4b1 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -101,7 +101,7 @@ #include #include -constexpr OUStringLiteral SC_LOCALE = u"Locale"; +constexpr OUString SC_LOCALE = u"Locale"_ustr; constexpr OUStringLiteral SC_CURRENCYSYMBOL = u"CurrencySymbol"; constexpr OUStringLiteral SC_REPEAT_ROW = u"repeat-row"; constexpr OUStringLiteral SC_FILTER = u"filter"; @@ -1171,7 +1171,7 @@ void SAL_CALL ScXMLImport::startDocument() xImportInfo.is() ? xImportInfo->getPropertySetInfo() : nullptr); if (xPropertySetInfo.is()) { - static constexpr OUStringLiteral sOrganizerMode(u"OrganizerMode"); + static constexpr OUString sOrganizerMode(u"OrganizerMode"_ustr); if (xPropertySetInfo->hasPropertyByName(sOrganizerMode)) { bool bStyleOnly(false); -- cgit v1.2.3