diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-19 16:39:09 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-23 11:04:42 +0200 |
commit | bd6fb0cd3eee3c7d414e55a7678c0097aadc7646 (patch) | |
tree | 5f754d7e485ab31dd4e04782b8eccd50d854d91e /chart2/source | |
parent | 3501c52176d1122d9de08462435f633cd21de370 (diff) |
Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files. This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.
Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/inc/helpids.h | 8 | ||||
-rw-r--r-- | chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx | 4 | ||||
-rw-r--r-- | chart2/source/inc/servicenames.hxx | 44 | ||||
-rw-r--r-- | chart2/source/inc/servicenames_charttypes.hxx | 40 | ||||
-rw-r--r-- | chart2/source/inc/servicenames_coosystems.hxx | 4 | ||||
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/StatisticsHelper.cxx | 4 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 4 |
10 files changed, 59 insertions, 59 deletions
diff --git a/chart2/source/controller/inc/helpids.h b/chart2/source/controller/inc/helpids.h index 8e683334fdd3..775ec1489b42 100644 --- a/chart2/source/controller/inc/helpids.h +++ b/chart2/source/controller/inc/helpids.h @@ -21,12 +21,12 @@ #include <rtl/ustring.hxx> -inline constexpr OUStringLiteral HID_SCH_WIN_DOCUMENT = u"CHART2_HID_SCH_WIN_DOCUMENT"; -inline constexpr OUStringLiteral HID_SCH_ERROR_BARS_FROM_DATA = u"CHART2_SCH_ERROR_BARS_FROM_DATA"; +inline constexpr OUString HID_SCH_WIN_DOCUMENT = u"CHART2_HID_SCH_WIN_DOCUMENT"_ustr; +inline constexpr OUString HID_SCH_ERROR_BARS_FROM_DATA = u"CHART2_SCH_ERROR_BARS_FROM_DATA"_ustr; -inline constexpr OUStringLiteral HID_SCH_WIZARD_ROADMAP = u"CHART2_HID_SCH_WIZARD_ROADMAP"; -inline constexpr OUStringLiteral HID_SCH_DATA_SERIES_LABEL = u"CHART2_HID_SCH_DATA_SERIES_LABEL"; +inline constexpr OUString HID_SCH_WIZARD_ROADMAP = u"CHART2_HID_SCH_WIZARD_ROADMAP"_ustr; +inline constexpr OUString HID_SCH_DATA_SERIES_LABEL = u"CHART2_HID_SCH_DATA_SERIES_LABEL"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 458c35830db0..8ac9b33cdb08 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -109,7 +109,7 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); + OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? CHART_UNONAME_NUMFMT : OUString( "PercentageNumberFormat" ); sal_uInt16 nSourceWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; if( rItemSet.GetItemState( nSourceWhich ) != SfxItemState::SET ) @@ -156,7 +156,7 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); + OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? CHART_UNONAME_NUMFMT : OUString( "PercentageNumberFormat" ); sal_uInt16 nFormatWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; if( rItemSet.GetItemState( nWhichId ) != SfxItemState::SET ) diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index 1d7dadd1fe5c..c725972c249b 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -50,7 +50,7 @@ uno::Reference< beans::XPropertySet > lcl_GetErrorBar( if( xProp.is()) try { - ( xProp->getPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X) ) >>= xResult ); + ( xProp->getPropertyValue( bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X ) >>= xResult ); } catch( const uno::Exception & ) { @@ -308,7 +308,7 @@ bool StatisticsItemConverter::ApplySpecialItem( if( !xErrorBarProp.is() ) { xErrorBarProp = lcl_GetDefaultErrorBar(); - GetPropertySet()->setPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X), + GetPropertySet()->setPropertyValue( bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X, uno::Any( xErrorBarProp )); } diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx index df7c46a6b342..4d2e6749f1fe 100644 --- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx @@ -102,7 +102,7 @@ bool numberFormatFromItemToPropertySet( if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? CHART_UNONAME_NUMFMT : OUString("PercentageNumberFormat"); sal_uInt16 nSourceWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; if (rItemSet.GetItemState(nSourceWhich) != SfxItemState::SET) @@ -150,7 +150,7 @@ bool useSourceFormatFromItemToPropertySet( bool bChanged = false; if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? CHART_UNONAME_NUMFMT : OUString("PercentageNumberFormat"); sal_uInt16 nFormatWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; if (rItemSet.GetItemState(nWhichId) != SfxItemState::SET) diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx index 48fbbffd370d..0f5cbe2b40f9 100644 --- a/chart2/source/inc/servicenames.hxx +++ b/chart2/source/inc/servicenames.hxx @@ -20,34 +20,34 @@ #include <rtl/ustring.hxx> -inline constexpr OUStringLiteral CHART_MODEL_SERVICE_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.ChartModel"; -inline constexpr OUStringLiteral CHART_MODEL_SERVICE_NAME = u"com.sun.star.chart2.ChartDocument"; +inline constexpr OUString CHART_MODEL_SERVICE_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.ChartModel"_ustr; +inline constexpr OUString CHART_MODEL_SERVICE_NAME = u"com.sun.star.chart2.ChartDocument"_ustr; //@todo create your own service containing the service com.sun.star.document.OfficeDocument -inline constexpr OUStringLiteral CHART_VIEW_SERVICE_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.ChartView"; -inline constexpr OUStringLiteral CHART_VIEW_SERVICE_NAME = u"com.sun.star.chart2.ChartView"; +inline constexpr OUString CHART_VIEW_SERVICE_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.ChartView"_ustr; +inline constexpr OUString CHART_VIEW_SERVICE_NAME = u"com.sun.star.chart2.ChartView"_ustr; -inline constexpr OUStringLiteral CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.ChartFrameLoader"; -inline constexpr OUStringLiteral CHART_FRAMELOADER_SERVICE_NAME - = u"com.sun.star.frame.SynchronousFrameLoader"; +inline constexpr OUString CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.ChartFrameLoader"_ustr; +inline constexpr OUString CHART_FRAMELOADER_SERVICE_NAME + = u"com.sun.star.frame.SynchronousFrameLoader"_ustr; -inline constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.WizardDialog"; -inline constexpr OUStringLiteral CHART_WIZARD_DIALOG_SERVICE_NAME - = u"com.sun.star.chart2.WizardDialog"; +inline constexpr OUString CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.WizardDialog"_ustr; +inline constexpr OUString CHART_WIZARD_DIALOG_SERVICE_NAME + = u"com.sun.star.chart2.WizardDialog"_ustr; -inline constexpr OUStringLiteral CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.ChartTypeDialog"; -inline constexpr OUStringLiteral CHART_TYPE_DIALOG_SERVICE_NAME - = u"com.sun.star.chart2.ChartTypeDialog"; +inline constexpr OUString CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.ChartTypeDialog"_ustr; +inline constexpr OUString CHART_TYPE_DIALOG_SERVICE_NAME + = u"com.sun.star.chart2.ChartTypeDialog"_ustr; // wrapper for old UNO API (com.sun.star.chart) -inline constexpr OUStringLiteral CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME - = u"com.sun.star.comp.chart2.ChartDocumentWrapper"; -inline constexpr OUStringLiteral CHART_CHARTAPIWRAPPER_SERVICE_NAME - = u"com.sun.star.chart2.ChartDocumentWrapper"; +inline constexpr OUString CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME + = u"com.sun.star.comp.chart2.ChartDocumentWrapper"_ustr; +inline constexpr OUString CHART_CHARTAPIWRAPPER_SERVICE_NAME + = u"com.sun.star.chart2.ChartDocumentWrapper"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/servicenames_charttypes.hxx b/chart2/source/inc/servicenames_charttypes.hxx index 0c06c2d3ea57..5ab2dcbf4929 100644 --- a/chart2/source/inc/servicenames_charttypes.hxx +++ b/chart2/source/inc/servicenames_charttypes.hxx @@ -20,25 +20,25 @@ #include <rtl/ustring.hxx> -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_AREA - = u"com.sun.star.chart2.AreaChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_BAR - = u"com.sun.star.chart2.BarChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_COLUMN - = u"com.sun.star.chart2.ColumnChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_LINE - = u"com.sun.star.chart2.LineChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_SCATTER - = u"com.sun.star.chart2.ScatterChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_PIE - = u"com.sun.star.chart2.PieChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_NET - = u"com.sun.star.chart2.NetChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET - = u"com.sun.star.chart2.FilledNetChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK - = u"com.sun.star.chart2.CandleStickChartType"; -inline constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE - = u"com.sun.star.chart2.BubbleChartType"; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_AREA + = u"com.sun.star.chart2.AreaChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BAR + = u"com.sun.star.chart2.BarChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_COLUMN + = u"com.sun.star.chart2.ColumnChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_LINE + = u"com.sun.star.chart2.LineChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_SCATTER + = u"com.sun.star.chart2.ScatterChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_PIE + = u"com.sun.star.chart2.PieChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_NET + = u"com.sun.star.chart2.NetChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET + = u"com.sun.star.chart2.FilledNetChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK + = u"com.sun.star.chart2.CandleStickChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE + = u"com.sun.star.chart2.BubbleChartType"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/inc/servicenames_coosystems.hxx b/chart2/source/inc/servicenames_coosystems.hxx index f8472a3dfeec..065155a8bb37 100644 --- a/chart2/source/inc/servicenames_coosystems.hxx +++ b/chart2/source/inc/servicenames_coosystems.hxx @@ -20,7 +20,7 @@ #include <rtl/ustring.hxx> -inline constexpr OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.CartesianView"; -inline constexpr OUStringLiteral CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.PolarView"; +inline constexpr OUString CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.CartesianView"_ustr; +inline constexpr OUString CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.PolarView"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 68eea85a0918..f1001f3333ea 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -708,7 +708,7 @@ void XMLFilter::isOasisFormat(const Sequence< beans::PropertyValue >& _rMediaDes } OUString XMLFilter::getMediaType(bool _bOasis) { - return _bOasis ? OUString(MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII) : OUString(MIMETYPE_VND_SUN_XML_CHART_ASCII); + return _bOasis ? MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII : MIMETYPE_VND_SUN_XML_CHART_ASCII; } OUString SAL_CALL XMLFilter::getImplementationName() diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 64ce94f3b179..06eba5da4c44 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -290,7 +290,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( return xErrorBar; const OUString aPropName( - bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X)); + bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X); if( !( xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar ) || !xErrorBar.is()) { @@ -314,7 +314,7 @@ Reference< beans::XPropertySet > StatisticsHelper::getErrorBars( { Reference< beans::XPropertySet > xErrorBar; const OUString aPropName( - bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X)); + bYError ? CHART_UNONAME_ERRORBAR_Y : CHART_UNONAME_ERRORBAR_X); if ( xDataSeries.is()) xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 49b606ae0a6c..abfc7766d762 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -525,7 +525,7 @@ double VDataSeries::getBubble_Size( sal_Int32 index ) const bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const { - OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT); + OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : CHART_UNONAME_NUMFMT; bool bHasNumberFormat = false; bool bLinkToSource = true; uno::Reference< beans::XPropertySet > xPointProp( getPropertiesOfPoint( nPointIndex )); @@ -539,7 +539,7 @@ bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPerce } sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const { - OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT); + OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : CHART_UNONAME_NUMFMT; sal_Int32 nNumberFormat = -1; uno::Reference< beans::XPropertySet > xPointProp( getPropertiesOfPoint( nPointIndex )); if( xPointProp.is() ) |