From 774a939f3be9bff97a43f8b5573ff6215b749842 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 19 Oct 2023 10:30:22 +0200 Subject: Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: reportdesign Change-Id: I5e45fd5d464db3cf038a844b955144649f980ba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158208 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- reportdesign/source/core/api/ReportDefinition.cxx | 2 +- reportdesign/source/core/api/ReportEngineJFree.cxx | 2 +- reportdesign/source/core/misc/conditionalexpression.cxx | 4 ++-- reportdesign/source/core/sdr/formatnormalizer.cxx | 2 +- reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 2 +- reportdesign/source/filter/xml/xmlfilter.cxx | 10 +++++----- reportdesign/source/ui/inspection/DataProviderHandler.cxx | 4 ++-- reportdesign/source/ui/inspection/GeometryHandler.cxx | 6 +++--- reportdesign/source/ui/inspection/ReportComponentHandler.cxx | 4 ++-- reportdesign/source/ui/report/ReportController.cxx | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 9c9a44991842..f9f988255b03 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1303,7 +1303,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY); if ( xProp.is() ) { - static constexpr OUStringLiteral sPropName = u"MediaType"; + static constexpr OUString sPropName = u"MediaType"_ustr; OUString sOldMediaType; xProp->getPropertyValue(sPropName) >>= sOldMediaType; if ( !xProp->getPropertyValue(sPropName).hasValue() || sOldMediaType.isEmpty() || MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII != sOldMediaType ) diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index 3ac69bbeae60..11686905272e 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -148,7 +148,7 @@ OUString OReportEngineJFree::getNewOutputName() if ( !m_xReport.is() || !m_xActiveConnection.is() ) throw lang::IllegalArgumentException(); - static constexpr OUStringLiteral s_sMediaType = u"MediaType"; + static constexpr OUString s_sMediaType = u"MediaType"_ustr; MimeConfigurationHelper aConfighelper(m_xContext); const OUString sMimeType = m_xReport->getMimeType(); diff --git a/reportdesign/source/core/misc/conditionalexpression.cxx b/reportdesign/source/core/misc/conditionalexpression.cxx index d913d0e132bc..40126acfc550 100644 --- a/reportdesign/source/core/misc/conditionalexpression.cxx +++ b/reportdesign/source/core/misc/conditionalexpression.cxx @@ -74,8 +74,8 @@ namespace rptui OUString sMatchExpression( m_sPattern ); sMatchExpression = sMatchExpression.replaceAll(u"$$", _rFieldDataSource); - static constexpr OUStringLiteral sLHSPattern( u"$1" ); - static constexpr OUStringLiteral sRHSPattern( u"$2" ); + static constexpr OUString sLHSPattern( u"$1"_ustr ); + static constexpr OUString sRHSPattern( u"$2"_ustr ); sal_Int32 nLHSIndex( sMatchExpression.indexOf( sLHSPattern ) ); sal_Int32 nRHSIndex( sMatchExpression.indexOf( sRHSPattern ) ); diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx index cf208f4465ce..3c97abc08dba 100644 --- a/reportdesign/source/core/sdr/formatnormalizer.cxx +++ b/reportdesign/source/core/sdr/formatnormalizer.cxx @@ -219,7 +219,7 @@ namespace rptui return; OUString sDataField( _rxFormatted->getDataField() ); - static constexpr OUStringLiteral sFieldPrefix( u"field:[" ); + static constexpr OUString sFieldPrefix( u"field:["_ustr ); if ( sDataField.indexOf( sFieldPrefix ) != 0 ) // not bound to a table field // TODO: we might also do this kind of thing for functions and expressions ... diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index b5f3383b3061..60784020b622 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -346,7 +346,7 @@ void ExportDocumentHandler::exportTableRows() const OUString sRElement(lcl_createAttribute(XML_NP_RPT,XML_REPORT_ELEMENT) ); const OUString sRComponent( lcl_createAttribute(XML_NP_RPT,XML_REPORT_COMPONENT) ) ; const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) ); - static constexpr OUStringLiteral s_sFloat = u"float"; + static constexpr OUString s_sFloat = u"float"_ustr; rtl::Reference pCellAtt = new comphelper::AttributeList(); pCellAtt->AddAttribute(sValueType, "string"); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index caf2c7b9907c..5ba253629c87 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -415,7 +415,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) aArgs.getArray()[0] <<= beans::NamedValue("Storage", uno::Any(xStorage)); xEmbeddedObjectResolver.set( xReportServiceFactory->createInstanceWithArguments("com.sun.star.document.ImportEmbeddedObjectResolver",aArgs) , uno::UNO_QUERY); - static constexpr OUStringLiteral s_sOld = u"OldFormat"; + static constexpr OUString s_sOld = u"OldFormat"_ustr; static comphelper::PropertyMapEntry const pMap[] = { { OUString("OldFormat") , 1, cppu::UnoType::get(), beans::PropertyAttribute::BOUND, 0 }, @@ -433,9 +433,9 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) xProp->setPropertyValue("StreamRelPath", uno::Any(sHierarchicalDocumentName)); uno::Reference xModel = GetModel(); - static constexpr OUStringLiteral s_sMeta = u"meta.xml"; - static constexpr OUStringLiteral s_sStreamName = u"StreamName"; - xProp->setPropertyValue(s_sStreamName, uno::Any(OUString(s_sMeta))); + static constexpr OUString s_sMeta = u"meta.xml"_ustr; + static constexpr OUString s_sStreamName = u"StreamName"_ustr; + xProp->setPropertyValue(s_sStreamName, uno::Any(s_sMeta)); ErrCode nRet = ReadThroughComponent( xStorage ,xModel ,"meta.xml" @@ -748,7 +748,7 @@ bool ORptFilter::isOldFormat() const uno::Reference xProp = getImportInfo(); if ( xProp.is() ) { - static constexpr OUStringLiteral s_sOld = u"OldFormat"; + static constexpr OUString s_sOld = u"OldFormat"_ustr; if ( xProp->getPropertySetInfo()->hasPropertyByName(s_sOld)) { xProp->getPropertyValue(s_sOld) >>= bOldFormat; diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index d00a82a3d895..163782602f57 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -112,11 +112,11 @@ void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface try { uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY); - static constexpr OUStringLiteral sFormComponent(u"FormComponent"); + static constexpr OUString sFormComponent(u"FormComponent"_ustr); if ( xNameCont->hasByName(sFormComponent) ) { uno::Reference xProp(xNameCont->getByName(sFormComponent),uno::UNO_QUERY); - static constexpr OUStringLiteral sModel(u"Model"); + static constexpr OUString sModel(u"Model"_ustr); if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sModel) ) { m_xChartModel.set(xProp->getPropertyValue(sModel),uno::UNO_QUERY); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 81065f0fe83e..95a224bfeb9e 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -282,7 +282,7 @@ void SAL_CALL GeometryHandler::inspect( const uno::Reference< uno::XInterface > const uno::Reference< container::XNameContainer > xObjectAsContainer( _rxInspectee, uno::UNO_QUERY ); m_xReportComponent.set( xObjectAsContainer->getByName("ReportComponent"), uno::UNO_QUERY ); - static constexpr OUStringLiteral sRowSet(u"RowSet"); + static constexpr OUString sRowSet(u"RowSet"_ustr); if ( xObjectAsContainer->hasByName( sRowSet ) ) { const uno::Any aRowSet( xObjectAsContainer->getByName(sRowSet) ); @@ -2093,8 +2093,8 @@ void GeometryHandler::impl_createFunction(const OUString& _sFunctionName,std::u1 m_xFunction.set(report::Function::create(m_xContext)); m_xFunction->setName( _sFunctionName ); - static constexpr OUStringLiteral sPlaceHolder1(u"%Column"); - static constexpr OUStringLiteral sPlaceHolder2(u"%FunctionName"); + static constexpr OUString sPlaceHolder1(u"%Column"_ustr); + static constexpr OUString sPlaceHolder2(u"%FunctionName"_ustr); OUString sFormula(_aFunction.m_sFormula); sFormula = sFormula.replaceAll(sPlaceHolder1,_sDataField); sFormula = sFormula.replaceAll(sPlaceHolder2,_sFunctionName); diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx index 76dd1dfcf0d3..f2032df2b77a 100644 --- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx +++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx @@ -86,10 +86,10 @@ void SAL_CALL ReportComponentHandler::inspect(const uno::Reference< uno::XInterf try { uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY); - static constexpr OUStringLiteral sFormComponent(u"FormComponent"); + static constexpr OUString sFormComponent(u"FormComponent"_ustr); if ( xNameCont->hasByName(sFormComponent) ) xNameCont->getByName(sFormComponent) >>= m_xFormComponent; - static constexpr OUStringLiteral sRowSet(u"RowSet"); + static constexpr OUString sRowSet(u"RowSet"_ustr); if ( xNameCont->hasByName(sRowSet) ) { uno::Reference xProp(m_xFormComponentHandler,uno::UNO_QUERY); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 9c33e4437d2d..4f159400667c 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3983,7 +3983,7 @@ void OReportController::checkChartEnabled() ::utl::OConfigurationTreeRoot::createWithComponentContext( m_xContext, "/org.openoffice.Office.ReportDesign" ) ); bool bChartEnabled = false; - static constexpr OUStringLiteral sPropertyName( u"UserData/Chart" ); + static constexpr OUString sPropertyName( u"UserData/Chart"_ustr ); if ( aConfiguration.hasByHierarchicalName(sPropertyName) ) aConfiguration.getNodeValue( sPropertyName ) >>= bChartEnabled; m_bChartEnabled = bChartEnabled; -- cgit v1.2.3