diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-19 10:30:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-20 22:46:53 +0200 |
commit | fe7f4eab95c0f8262c8e08ef6cfaf54b2cb24f18 (patch) | |
tree | 2f41f0f43f403c52e3fb46dce7d8b28938829f4d /xmloff | |
parent | 335e73a7f37f5efc08a6691d8e4b271c68e0a2ac (diff) |
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: xmloff
Change-Id: I2d58bbea770c4dd188cae13e11218a29f4cd5d05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158294
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmloff')
47 files changed, 269 insertions, 269 deletions
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 225f77a09536..c3a556f54967 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -758,8 +758,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTdf156975_ThemeExport) // and check the markup. xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"); - static constexpr OStringLiteral sThemePath - = "//office:master-styles/style:master-page/loext:theme"; + static constexpr OString sThemePath + = "//office:master-styles/style:master-page/loext:theme"_ostr; assertXPath(pXmlDoc, sThemePath, 1); assertXPath(pXmlDoc, sThemePath + "[@loext:name='Custom']"); diff --git a/xmloff/source/chart/ColorPropertySet.cxx b/xmloff/source/chart/ColorPropertySet.cxx index 237888980d6a..b7a4b45dd893 100644 --- a/xmloff/source/chart/ColorPropertySet.cxx +++ b/xmloff/source/chart/ColorPropertySet.cxx @@ -44,7 +44,7 @@ protected: virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override; private: - static constexpr OUStringLiteral g_aColorPropName = u"FillColor"; + static constexpr OUString g_aColorPropName = u"FillColor"_ustr; Property m_aColorProp; }; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e07fb6a77693..200ef0aa42d2 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -282,7 +282,7 @@ public: rtl::Reference< XMLPropertySetMapper > mxPropertySetMapper; rtl::Reference< XMLChartExportPropertyMapper > mxExpPropMapper; - static constexpr OUStringLiteral gsTableName = u"local-table"; + static constexpr OUString gsTableName = u"local-table"_ustr; OUStringBuffer msStringBuffer; OUString msString; diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index b559d5f075e0..cf4e33e769cf 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -886,7 +886,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe // this property) bool bHasErrorBarRangesFromData = false; { - static constexpr OUStringLiteral aErrorBarStylePropName( u"ErrorBarStyle"); + static constexpr OUString aErrorBarStylePropName( u"ErrorBarStyle"_ustr); uno::Any aErrorBarStyle( SchXMLTools::getPropertyFromContext( aErrorBarStylePropName, pPropStyleContext, pStylesCtxt )); if( aErrorBarStyle.hasValue()) diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index b12f5886e69b..ac0e9aeed524 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -57,7 +57,7 @@ using ::com::sun::star::uno::Reference; namespace { -constexpr OUStringLiteral aCategoriesRange = u"categories"; +constexpr OUString aCategoriesRange = u"categories"_ustr; typedef ::std::multimap< OUString, OUString > lcl_tOriginalRangeToInternalRangeMap; @@ -104,7 +104,7 @@ void lcl_fillRangeMapping( sal_Int32 nColOffset = ( rTable.bHasHeaderColumn ? 1 : 0 ); const OUString lcl_aCategoriesRange(aCategoriesRange); - static constexpr OUStringLiteral lcl_aLabelPrefix(u"label "); + static constexpr OUString lcl_aLabelPrefix(u"label "_ustr); // Fill range mapping const size_t nTableRowCount( rTable.aData.size()); diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index ff344f164edc..120e361f84f0 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -91,7 +91,7 @@ sal_Int32 lcl_getBuildIDFromGenerator( std::u16string_view rGenerator ) { //returns -1 if nothing found sal_Int32 nBuildId = -1; - static constexpr OUStringLiteral sBuildCompare( u"$Build-" ); + static constexpr OUString sBuildCompare( u"$Build-"_ustr ); size_t nBegin = rGenerator.find( sBuildCompare ); if( nBegin != std::u16string_view::npos ) { @@ -632,7 +632,7 @@ void setXMLRangePropertyAtDataSequence( return; try { - static constexpr OUStringLiteral aXMLRangePropName( u"CachedXMLRange" ); + static constexpr OUString aXMLRangePropName( u"CachedXMLRange"_ustr ); Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW ); Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo()); if( xInfo.is() && xInfo->hasPropertyByName( aXMLRangePropName )) @@ -654,7 +654,7 @@ bool getXMLRangePropertyFromDataSequence( { try { - static constexpr OUStringLiteral aXMLRangePropName( u"CachedXMLRange" ); + static constexpr OUString aXMLRangePropName( u"CachedXMLRange"_ustr ); Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW ); Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo()); bResult = @@ -840,7 +840,7 @@ Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Refere Reference< lang::XMultiServiceFactory > xFact( xChild->getParent(), uno::UNO_QUERY ); if( xFact.is() ) { - static constexpr OUStringLiteral aDataProviderServiceName( u"com.sun.star.chart2.data.DataProvider"); + static constexpr OUString aDataProviderServiceName( u"com.sun.star.chart2.data.DataProvider"_ustr); const uno::Sequence< OUString > aServiceNames( xFact->getAvailableServiceNames()); const OUString * pBegin = aServiceNames.getConstArray(); const OUString * pEnd = pBegin + aServiceNames.getLength(); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 1f0f5a9780d8..7c6be149fac3 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -114,17 +114,17 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::io; using namespace ::xmloff::token; -constexpr OUStringLiteral XML_MODEL_SERVICE_WRITER = u"com.sun.star.text.TextDocument"; -constexpr OUStringLiteral XML_MODEL_SERVICE_CALC = u"com.sun.star.sheet.SpreadsheetDocument"; -constexpr OUStringLiteral XML_MODEL_SERVICE_DRAW = u"com.sun.star.drawing.DrawingDocument"; -constexpr OUStringLiteral XML_MODEL_SERVICE_IMPRESS = u"com.sun.star.presentation.PresentationDocument"; -constexpr OUStringLiteral XML_MODEL_SERVICE_MATH = u"com.sun.star.formula.FormulaProperties"; -constexpr OUStringLiteral XML_MODEL_SERVICE_CHART = u"com.sun.star.chart.ChartDocument"; +constexpr OUString XML_MODEL_SERVICE_WRITER = u"com.sun.star.text.TextDocument"_ustr; +constexpr OUString XML_MODEL_SERVICE_CALC = u"com.sun.star.sheet.SpreadsheetDocument"_ustr; +constexpr OUString XML_MODEL_SERVICE_DRAW = u"com.sun.star.drawing.DrawingDocument"_ustr; +constexpr OUString XML_MODEL_SERVICE_IMPRESS = u"com.sun.star.presentation.PresentationDocument"_ustr; +constexpr OUString XML_MODEL_SERVICE_MATH = u"com.sun.star.formula.FormulaProperties"_ustr; +constexpr OUString XML_MODEL_SERVICE_CHART = u"com.sun.star.chart.ChartDocument"_ustr; constexpr OUStringLiteral XML_USEPRETTYPRINTING = u"UsePrettyPrinting"; -constexpr OUStringLiteral XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE = u"vnd.sun.star.GraphicObject:"; -constexpr OUStringLiteral XML_EMBEDDEDOBJECT_URL_BASE = u"vnd.sun.star.EmbeddedObject:"; +constexpr OUString XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE = u"vnd.sun.star.GraphicObject:"_ustr; +constexpr OUString XML_EMBEDDEDOBJECT_URL_BASE = u"vnd.sun.star.EmbeddedObject:"_ustr; const std::pair<OUString, OUString> aServiceMap[] = { { XML_MODEL_SERVICE_WRITER, XML_EXPORT_FILTER_WRITER }, @@ -540,9 +540,9 @@ SvXMLExport::~SvXMLExport() { if (mpProgressBarHelper) { - static constexpr OUStringLiteral sProgressMax(XML_PROGRESSMAX); - static constexpr OUStringLiteral sProgressCurrent(XML_PROGRESSCURRENT); - static constexpr OUStringLiteral sRepeat(XML_PROGRESSREPEAT); + static constexpr OUString sProgressMax(XML_PROGRESSMAX); + static constexpr OUString sProgressCurrent(XML_PROGRESSCURRENT); + static constexpr OUString sRepeat(XML_PROGRESSREPEAT); if (xPropertySetInfo->hasPropertyByName(sProgressMax) && xPropertySetInfo->hasPropertyByName(sProgressCurrent)) { @@ -556,7 +556,7 @@ SvXMLExport::~SvXMLExport() } if (mpNumExport && (mnExportFlags & (SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::STYLES))) { - static constexpr OUStringLiteral sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); + static constexpr OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) { mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(mpNumExport->GetWasUsed())); @@ -701,7 +701,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = mxExportInfo->getPropertySetInfo(); - static constexpr OUStringLiteral sBaseURI = u"BaseURI"; + static constexpr OUString sBaseURI = u"BaseURI"_ustr; if( xPropertySetInfo->hasPropertyByName(sBaseURI) ) { uno::Any aAny = mxExportInfo->getPropertyValue(sBaseURI); @@ -710,14 +710,14 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen mpImpl->SetSchemeOf( msOrigFileName ); } OUString sRelPath; - static constexpr OUStringLiteral sStreamRelPath = u"StreamRelPath"; + static constexpr OUString sStreamRelPath = u"StreamRelPath"_ustr; if( xPropertySetInfo->hasPropertyByName(sStreamRelPath) ) { uno::Any aAny = mxExportInfo->getPropertyValue(sStreamRelPath); aAny >>= sRelPath; } OUString sName; - static constexpr OUStringLiteral sStreamName = u"StreamName"; + static constexpr OUString sStreamName = u"StreamName"_ustr; if( xPropertySetInfo->hasPropertyByName(sStreamName) ) { uno::Any aAny = mxExportInfo->getPropertyValue(sStreamName); @@ -734,8 +734,8 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen mpImpl->mStreamName = sName; // Note: may be empty (XSLT) // Written OpenDocument file format doesn't fit to the created text document (#i69627#) - static constexpr OUStringLiteral sOutlineStyleAsNormalListStyle( - u"OutlineStyleAsNormalListStyle" ); + static constexpr OUString sOutlineStyleAsNormalListStyle( + u"OutlineStyleAsNormalListStyle"_ustr ); if( xPropertySetInfo->hasPropertyByName( sOutlineStyleAsNormalListStyle ) ) { uno::Any aAny = mxExportInfo->getPropertyValue( sOutlineStyleAsNormalListStyle ); @@ -746,8 +746,8 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen if( xPropertySetInfo->hasPropertyByName( sTargetStorage ) ) mxExportInfo->getPropertyValue( sTargetStorage ) >>= mpImpl->mxTargetStorage; - static constexpr OUStringLiteral sExportTextNumberElement( - u"ExportTextNumberElement" ); + static constexpr OUString sExportTextNumberElement( + u"ExportTextNumberElement"_ustr ); if( xPropertySetInfo->hasPropertyByName( sExportTextNumberElement ) ) { uno::Any aAny = mxExportInfo->getPropertyValue( sExportTextNumberElement ); @@ -869,7 +869,7 @@ uno::Sequence< OUString > SAL_CALL SvXMLExport::getSupportedServiceNames( ) OUString SvXMLExport::EnsureNamespace(OUString const & i_rNamespace) { - static constexpr OUStringLiteral aPreferredPrefix(u"gen"); + static constexpr OUString aPreferredPrefix(u"gen"_ustr); OUString sPrefix; sal_uInt16 nKey( GetNamespaceMap_().GetKeyByName( i_rNamespace ) ); if( XML_NAMESPACE_UNKNOWN == nKey ) @@ -1084,8 +1084,8 @@ void SvXMLExport::ImplExportStyles() if( ( mnExportFlags & SvXMLExportFlags::CONTENT ) || !mxExportInfo.is() ) return; - static constexpr OUStringLiteral sStyleNames( u"StyleNames" ); - static constexpr OUStringLiteral sStyleFamilies( u"StyleFamilies" ); + static constexpr OUString sStyleNames( u"StyleNames"_ustr ); + static constexpr OUString sStyleFamilies( u"StyleFamilies"_ustr ); uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = mxExportInfo->getPropertySetInfo(); if ( xPropertySetInfo->hasPropertyByName( sStyleNames ) && xPropertySetInfo->hasPropertyByName( sStyleFamilies ) ) { diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx index a13c58b41d91..de6b50a1471e 100644 --- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx +++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx @@ -119,7 +119,7 @@ void XMLGraphicsDefaultStyle::SetDefaults() ) ) bWordWrapDefault = false; - static constexpr OUStringLiteral sTextWordWrap( u"TextWordWrap" ); + static constexpr OUString sTextWordWrap( u"TextWordWrap"_ustr ); Reference< XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo() ); if ( xInfo->hasPropertyByName( sTextWordWrap ) ) xDefaults->setPropertyValue( sTextWordWrap, Any( bWordWrapDefault ) ); diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index a9c70f2c70d4..e3a16c08636c 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -483,7 +483,7 @@ void XMLImageMapCircleContext::Prepare( } -constexpr OUStringLiteral gsImageMap(u"ImageMap"); +constexpr OUString gsImageMap(u"ImageMap"_ustr); XMLImageMapContext::XMLImageMapContext( SvXMLImport& rImport, diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx index 918d13ad07ce..833df40af214 100644 --- a/xmloff/source/draw/XMLImageMapExport.cxx +++ b/xmloff/source/draw/XMLImageMapExport.cxx @@ -56,7 +56,7 @@ using ::com::sun::star::drawing::PointSequence; constexpr OUStringLiteral gsBoundary(u"Boundary"); constexpr OUStringLiteral gsCenter(u"Center"); constexpr OUStringLiteral gsDescription(u"Description"); -constexpr OUStringLiteral gsImageMap(u"ImageMap"); +constexpr OUString gsImageMap(u"ImageMap"_ustr); constexpr OUStringLiteral gsIsActive(u"IsActive"); constexpr OUStringLiteral gsName(u"Name"); constexpr OUStringLiteral gsPolygon(u"Polygon"); diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index ed280f1e1060..0c78f4f1d85b 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -232,18 +232,18 @@ class AnimExpImpl public: std::list<XMLEffectHint> maEffects; - static constexpr OUStringLiteral gsDimColor = u"DimColor"; - static constexpr OUStringLiteral gsDimHide = u"DimHide"; - static constexpr OUStringLiteral gsDimPrev = u"DimPrevious"; - static constexpr OUStringLiteral gsEffect = u"Effect"; - static constexpr OUStringLiteral gsPlayFull = u"PlayFull"; - static constexpr OUStringLiteral gsPresOrder = u"PresentationOrder"; - static constexpr OUStringLiteral gsSound = u"Sound"; - static constexpr OUStringLiteral gsSoundOn = u"SoundOn"; - static constexpr OUStringLiteral gsSpeed = u"Speed"; - static constexpr OUStringLiteral gsTextEffect = u"TextEffect"; - static constexpr OUStringLiteral gsIsAnimation = u"IsAnimation"; - static constexpr OUStringLiteral gsAnimPath = u"AnimationPath"; + static constexpr OUString gsDimColor = u"DimColor"_ustr; + static constexpr OUString gsDimHide = u"DimHide"_ustr; + static constexpr OUString gsDimPrev = u"DimPrevious"_ustr; + static constexpr OUString gsEffect = u"Effect"_ustr; + static constexpr OUString gsPlayFull = u"PlayFull"_ustr; + static constexpr OUString gsPresOrder = u"PresentationOrder"_ustr; + static constexpr OUString gsSound = u"Sound"_ustr; + static constexpr OUString gsSoundOn = u"SoundOn"_ustr; + static constexpr OUString gsSpeed = u"Speed"_ustr; + static constexpr OUString gsTextEffect = u"TextEffect"_ustr; + static constexpr OUString gsIsAnimation = u"IsAnimation"_ustr; + static constexpr OUString gsAnimPath = u"AnimationPath"_ustr; }; XMLAnimationsExporter::XMLAnimationsExporter() diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 1fdf818a8be1..dd0c77ec8efc 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx |