From a0656ec6fc2b41e65f1b40dbd64f546175e2762f Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 25 Mar 2021 09:53:33 +0300 Subject: const OUString -> const OUStringLiteral Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 2 +- chart2/source/controller/dialogs/tp_DataSource.cxx | 4 ++-- .../controller/itemsetwrapper/GraphicPropertyItemConverter.cxx | 4 ++-- chart2/source/controller/main/DrawCommandDispatch.cxx | 5 ++--- chart2/source/model/template/PieChartTypeTemplate.cxx | 2 +- chart2/source/tools/InternalDataProvider.cxx | 2 +- chart2/source/tools/RegressionCurveHelper.cxx | 2 +- chart2/source/tools/StatisticsHelper.cxx | 2 +- chart2/source/tools/UncachedDataSequence.cxx | 2 +- chart2/source/view/axes/VCartesianAxis.cxx | 2 +- chart2/source/view/main/VLegend.cxx | 2 +- 11 files changed, 14 insertions(+), 15 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index aa12dbc27eea..8b068a9a57c7 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -468,7 +468,7 @@ sal_Int32 lcl_getNewAPIIndexForOldAPIIndex( OUString lcl_getDiagramType( const OUString & rTemplateServiceName ) { - const OUString aPrefix("com.sun.star.chart2.template."); + static const OUStringLiteral aPrefix(u"com.sun.star.chart2.template."); if( rTemplateServiceName.match( aPrefix )) { diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 90eb974ca0d5..8586bd7260c7 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -355,7 +355,7 @@ void DataSourceTabPage::fillSeriesListBox() OUString aResString(::chart::SchResId( STR_DATA_UNNAMED_SERIES_WITH_INDEX )); // replace index of unnamed series - const OUString aReplacementStr( "%NUMBER" ); + static const OUStringLiteral aReplacementStr( u"%NUMBER" ); sal_Int32 nIndex = aResString.indexOf( aReplacementStr ); if( nIndex != -1 ) aLabel = aResString.replaceAt( @@ -485,7 +485,7 @@ IMPL_LINK_NOARG(DataSourceTabPage, RoleSelectionChangedHdl, weld::TreeView&, voi OUString aSelectedRange = lcl_GetSelectedRolesRange( *m_xLB_ROLE ); // replace role in fixed text label - const OUString aReplacementStr( "%VALUETYPE" ); + static const OUStringLiteral aReplacementStr( u"%VALUETYPE" ); sal_Int32 nIndex = m_aFixedTextRange.indexOf( aReplacementStr ); if( nIndex != -1 ) { diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index 55e954e946d9..f553ff16bc34 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -426,7 +426,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLBMP_STRETCH: if( lcl_supportsFillProperties( m_GraphicObjectType )) { - const OUString aModePropName("FillBitmapMode"); + static const OUStringLiteral aModePropName(u"FillBitmapMode"); bool bStretched = rItemSet.Get( XATTR_FILLBMP_STRETCH ).GetValue(); drawing::BitmapMode aMode = (bStretched ? drawing::BitmapMode_STRETCH : drawing::BitmapMode_NO_REPEAT); @@ -448,7 +448,7 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( case XATTR_FILLBMP_TILE: if( lcl_supportsFillProperties( m_GraphicObjectType )) { - const OUString aModePropName("FillBitmapMode"); + static const OUStringLiteral aModePropName(u"FillBitmapMode"); bool bTiled = rItemSet.Get( XATTR_FILLBMP_TILE ).GetValue(); drawing::BitmapMode aMode = (bTiled ? drawing::BitmapMode_REPEAT : drawing::BitmapMode_NO_REPEAT); diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index ef0bdfd5af5b..f2011022595f 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -350,12 +350,11 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea pDrawViewWrapper->SetCreateMode(); } - const OUString sKeyModifier( "KeyModifier" ); const beans::PropertyValue* pIter = rArgs.getConstArray(); const beans::PropertyValue* pEnd = pIter + rArgs.getLength(); const beans::PropertyValue* pKeyModifier = std::find_if(pIter, pEnd, - [&sKeyModifier](const beans::PropertyValue& lhs) - {return lhs.Name == sKeyModifier;} ); + [](const beans::PropertyValue& lhs) + {return lhs.Name == "KeyModifier";} ); sal_Int16 nKeyModifier = 0; if ( !(pKeyModifier != pEnd && ( pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1) ) return; diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index bf71bfc48fc1..0848f0e98239 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -478,7 +478,7 @@ void SAL_CALL PieChartTypeTemplate::applyStyle( if( nSeriesIndex == nOuterSeriesIndex ) //@todo in future this will depend on Orientation of the radius axis scale { - const OUString aOffsetPropName( "Offset" ); + static const OUStringLiteral aOffsetPropName( u"Offset" ); // get offset mode chart2::PieChartOffsetMode ePieOffsetMode; getFastPropertyValue( PROP_PIE_TEMPLATE_OFFSET_MODE ) >>= ePieOffsetMode; diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index edbef2f39401..1b2f6ae28351 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -1227,7 +1227,7 @@ OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXM return ""; } - const OUString aPivotTableID("PT@"); + static const OUStringLiteral aPivotTableID(u"PT@"); if (aXMLRange.startsWith(aPivotTableID)) return aXMLRange.copy(aPivotTableID.getLength()); diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index 66f56725133b..61f155011664 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -712,7 +712,7 @@ void RegressionCurveHelper::resetEquationPosition( try { - const OUString aPosPropertyName( "RelativePosition" ); + static const OUStringLiteral aPosPropertyName( u"RelativePosition" ); Reference< beans::XPropertySet > xEqProp( xCurve->getEquationProperties()); // since m233: , uno::UNO_SET_THROW ); if( xEqProp->getPropertyValue( aPosPropertyName ).hasValue()) xEqProp->setPropertyValue( aPosPropertyName, uno::Any()); diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 02dab3b9bd89..ef9c141208a1 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -146,7 +146,7 @@ void lcl_setXMLRangePropertyAtDataSequence( { try { - const OUString aXMLRangePropName( "CachedXMLRange"); + static const OUStringLiteral aXMLRangePropName( u"CachedXMLRange"); Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW ); Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo()); if( xInfo.is() && xInfo->hasPropertyByName( aXMLRangePropName )) diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index 40412ffa16ae..1eae8def8f4e 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -214,7 +214,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data: // auto-generated label sal_Int32 nSeries = m_aSourceRepresentation.toInt32() + 1; OUString aResString(::chart::SchResId(STR_DATA_UNNAMED_SERIES_WITH_INDEX)); - const OUString aReplacementStr("%NUMBER"); + static const OUStringLiteral aReplacementStr(u"%NUMBER"); sal_Int32 nIndex = aResString.indexOf(aReplacementStr); OUString aName; if( nIndex != -1 ) diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index cb57a6a62207..ebd045a24845 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -97,7 +97,7 @@ static void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape > if( !nAvgCharWidth ) return; - const OUString sDots = "..."; + static const OUStringLiteral sDots = u"..."; const sal_Int32 nCharsToRemove = ( nTextSize - nMaxLabelsSize ) / nAvgCharWidth + 1; sal_Int32 nNewLen = rLabel.getLength() - nCharsToRemove - sDots.getLength(); // Prevent from showing only dots diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index e05aa94db702..0e3ea7de79e9 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -419,7 +419,7 @@ awt::Size lcl_placeLegendEntries( try { OUString aLabelString = rEntries[0].aLabel[0]->getString(); - const OUString sDots = "..."; + static const OUStringLiteral sDots = u"..."; ShapeFactory* pShapeFactory = ShapeFactory::getOrCreateShapeFactory(xShapeFactory); for (sal_Int32 nNewLen = aLabelString.getLength() - sDots.getLength(); nNewLen > 0; nNewLen--) { -- cgit