diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-23 13:16:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-26 14:51:15 +0100 |
commit | a3d0091d185f39eddabf4d372ebe0ac3061dbb89 (patch) | |
tree | 4d70cedc274972ccc21b6b8e7105f042090cf5d6 /chart2 | |
parent | af791fb775e35c11ad01c42a7085dd121ab9c7a6 (diff) |
New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/ElementSelector.cxx | 3 | ||||
-rw-r--r-- | chart2/source/model/filter/XMLFilter.cxx | 6 | ||||
-rw-r--r-- | chart2/source/model/main/CartesianCoordinateSystem.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/main/PolarCoordinateSystem.cxx | 3 | ||||
-rw-r--r-- | chart2/source/tools/CachedDataSequence.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/ConfigColorScheme.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/ErrorBar.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/InternalDataProvider.cxx | 6 | ||||
-rw-r--r-- | chart2/source/tools/ReferenceSizeProvider.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/Scaling.cxx | 8 | ||||
-rw-r--r-- | chart2/source/tools/UncachedDataSequence.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/axes/DateScaling.cxx | 5 |
13 files changed, 24 insertions, 21 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx index 373fec6c8344..3b48c7907a4c 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx @@ -60,7 +60,7 @@ WrappedScaleTextProperty::WrappedScaleTextProperty(const std::shared_ptr<Chart2M void WrappedScaleTextProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const { - static const char aRefSizeName[] = "ReferencePageSize"; + static const OUStringLiteral aRefSizeName = u"ReferencePageSize"; if( !xInnerPropertySet.is() ) return; diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 2fa6fa360616..91e299d4906d 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -48,7 +48,8 @@ using ::com::sun::star::uno::Sequence; namespace { -const char lcl_aServiceName[] = "com.sun.star.comp.chart.ElementSelectorToolbarController"; +const OUStringLiteral lcl_aServiceName + = u"com.sun.star.comp.chart.ElementSelectorToolbarController"; } SelectorListBox::SelectorListBox(vcl::Window* pParent) diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index ec1bf1f8b3a3..96b66e95e338 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -58,9 +58,9 @@ using ::osl::MutexGuard; namespace { -char const sXML_metaStreamName[] = "meta.xml"; -char const sXML_styleStreamName[] = "styles.xml"; -char const sXML_contentStreamName[] = "content.xml"; +OUStringLiteral const sXML_metaStreamName = u"meta.xml"; +OUStringLiteral const sXML_styleStreamName = u"styles.xml"; +OUStringLiteral const sXML_contentStreamName = u"content.xml"; uno::Reference< embed::XStorage > lcl_getWriteStorage( diff --git a/chart2/source/model/main/CartesianCoordinateSystem.cxx b/chart2/source/model/main/CartesianCoordinateSystem.cxx index dd0f77b40e58..f8cc8f17ad88 100644 --- a/chart2/source/model/main/CartesianCoordinateSystem.cxx +++ b/chart2/source/model/main/CartesianCoordinateSystem.cxx @@ -31,7 +31,7 @@ namespace com::sun::star::uno { class XComponentContext; } namespace { -const char CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME[] = "com.sun.star.chart2.CoordinateSystems.Cartesian"; +const OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Cartesian"; } diff --git a/chart2/source/model/main/PolarCoordinateSystem.cxx b/chart2/source/model/main/PolarCoordinateSystem.cxx index 5ec3252ae582..2d2497bc23c9 100644 --- a/chart2/source/model/main/PolarCoordinateSystem.cxx +++ b/chart2/source/model/main/PolarCoordinateSystem.cxx @@ -31,7 +31,8 @@ using ::com::sun::star::uno::Sequence; namespace { -const char CHART2_COOSYSTEM_POLAR_SERVICE_NAME[] = "com.sun.star.chart2.CoordinateSystems.Polar"; +const OUStringLiteral CHART2_COOSYSTEM_POLAR_SERVICE_NAME + = u"com.sun.star.chart2.CoordinateSystems.Polar"; } diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx index 4eaf5d8f2743..dc44985589cc 100644 --- a/chart2/source/tools/CachedDataSequence.cxx +++ b/chart2/source/tools/CachedDataSequence.cxx @@ -42,7 +42,7 @@ using ::chart::impl::CachedDataSequence_Base; namespace { -const char lcl_aServiceName[] = "com.sun.star.comp.chart.CachedDataSequence"; +const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.CachedDataSequence"; enum { diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index 5645fb22b68f..2aaf672800ac 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -34,7 +34,7 @@ using ::com::sun::star::uno::Sequence; namespace { -const char aSeriesPropName[] = "Series"; +const OUStringLiteral aSeriesPropName = u"Series"; } // anonymous namespace diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 91d6c003a067..6dd803093365 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -41,7 +41,7 @@ using namespace ::com::sun::star; namespace { -const char lcl_aServiceName[] = "com.sun.star.comp.chart2.ErrorBar"; +const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart2.ErrorBar"; bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq ) { diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 94481ce9e5f8..abc3aea59d8f 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -57,12 +57,12 @@ namespace chart namespace { -const char lcl_aCategoriesRangeName[] = "categories"; +const OUStringLiteral lcl_aCategoriesRangeName = u"categories"; const char lcl_aCategoriesLevelRangeNamePrefix[] = "categoriesL "; //L <-> level const char lcl_aCategoriesPointRangeNamePrefix[] = "categoriesP "; //P <-> point -const char lcl_aCategoriesRoleName[] = "categories"; +const OUStringLiteral lcl_aCategoriesRoleName = u"categories"; const char lcl_aLabelRangePrefix[] = "label "; -const char lcl_aCompleteRange[] = "all"; +const OUStringLiteral lcl_aCompleteRange = u"all"; typedef std::multimap< OUString, uno::WeakReference< chart2::data::XDataSequence > > lcl_tSequenceMap; diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index 44109500552a..8e254903929e 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -131,7 +131,7 @@ void ReferenceSizeProvider::setValuesAtPropertySet( if( ! xProp.is()) return; - static const char aRefSizeName[] = "ReferencePageSize"; + static const OUStringLiteral aRefSizeName = u"ReferencePageSize"; try { diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx index 27a9c51a7a44..212eadba54ee 100644 --- a/chart2/source/tools/Scaling.cxx +++ b/chart2/source/tools/Scaling.cxx @@ -27,10 +27,10 @@ namespace com::sun::star::uno { class XComponentContext; } namespace { -const char lcl_aServiceName_Logarithmic[] = "com.sun.star.chart2.LogarithmicScaling"; -const char lcl_aServiceName_Exponential[] = "com.sun.star.chart2.ExponentialScaling"; -const char lcl_aServiceName_Linear[] = "com.sun.star.chart2.LinearScaling"; -const char lcl_aServiceName_Power[] = "com.sun.star.chart2.PowerScaling"; +const OUStringLiteral lcl_aServiceName_Logarithmic = u"com.sun.star.chart2.LogarithmicScaling"; +const OUStringLiteral lcl_aServiceName_Exponential = u"com.sun.star.chart2.ExponentialScaling"; +const OUStringLiteral lcl_aServiceName_Linear = u"com.sun.star.chart2.LinearScaling"; +const OUStringLiteral lcl_aServiceName_Power = u"com.sun.star.chart2.PowerScaling"; } diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index 8851988b6d85..bdffa24a458d 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -41,7 +41,7 @@ using ::chart::impl::UncachedDataSequence_Base; namespace { -const char lcl_aServiceName[] = "com.sun.star.comp.chart.UncachedDataSequence"; +const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.UncachedDataSequence"; enum { diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx index 60ffc14bbfae..b5a690e203aa 100644 --- a/chart2/source/view/axes/DateScaling.cxx +++ b/chart2/source/view/axes/DateScaling.cxx @@ -25,8 +25,9 @@ namespace { -const char lcl_aServiceName_DateScaling[] = "com.sun.star.chart2.DateScaling"; -const char lcl_aServiceName_InverseDateScaling[] = "com.sun.star.chart2.InverseDateScaling"; +const OUStringLiteral lcl_aServiceName_DateScaling = u"com.sun.star.chart2.DateScaling"; +const OUStringLiteral lcl_aServiceName_InverseDateScaling + = u"com.sun.star.chart2.InverseDateScaling"; const double lcl_fNumberOfMonths = 12.0;//todo: this needs to be offered by basic tools Date class if it should be more generic } |