summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-25 08:14:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-30 12:32:14 +0100
commit8332d6d8200e8ca1f22dd98d9373efd5a431d09c (patch)
treedd45d452202998297b8562743ea6345462304d04 /chart2/source/tools
parentd05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 (diff)
loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx14
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx30
2 files changed, 22 insertions, 22 deletions
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index c1d0008098ab..94481ce9e5f8 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -486,7 +486,7 @@ void InternalDataProvider::decreaseMapReferences(
Reference< chart2::data::XDataSequence > InternalDataProvider::createDataSequenceAndAddToMap(
const OUString & rRangeRepresentation )
{
- Reference<chart2::data::XDataSequence> xSeq = createDataSequenceFromArray(rRangeRepresentation, OUString());
+ Reference<chart2::data::XDataSequence> xSeq = createDataSequenceFromArray(rRangeRepresentation, u"");
if (xSeq.is())
return xSeq;
@@ -496,7 +496,7 @@ Reference< chart2::data::XDataSequence > InternalDataProvider::createDataSequenc
}
uno::Reference<chart2::data::XDataSequence>
-InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, const OUString& rRole )
+InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, std::u16string_view rRole )
{
if (rArrayStr.indexOf('{') != 0 || rArrayStr[rArrayStr.getLength()-1] != '}')
{
@@ -562,8 +562,8 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, co
aRawElems.push_back(aElem);
}
- if (rRole == "values-y" || rRole == "values-first" || rRole == "values-last" ||
- rRole == "values-min" || rRole == "values-max" || rRole == "values-size")
+ if (rRole == u"values-y" || rRole == u"values-first" || rRole == u"values-last" ||
+ rRole == u"values-min" || rRole == u"values-max" || rRole == u"values-size")
{
// Column values. Append a new data column and populate it.
@@ -584,7 +584,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, co
xSeq.set(new UncachedDataSequence(this, aRangeRep));
addDataSequenceToMap(aRangeRep, xSeq);
}
- else if (rRole == "values-x")
+ else if (rRole == u"values-x")
{
std::vector<double> aValues;
aValues.reserve(aRawElems.size());
@@ -611,7 +611,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, co
xSeq.set(new UncachedDataSequence(this, aRangeRep));
addDataSequenceToMap(aRangeRep, xSeq);
}
- else if (rRole == "categories")
+ else if (rRole == u"categories")
{
// Category labels.
@@ -624,7 +624,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, co
xSeq.set(new UncachedDataSequence(this, lcl_aCategoriesRangeName));
addDataSequenceToMap(lcl_aCategoriesRangeName, xSeq);
}
- else if (rRole == "label")
+ else if (rRole == u"label")
{
// Data series label. There should be only one element. This always
// goes to the last data column.
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 47f6a4b0ebfe..66f56725133b 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -91,32 +91,32 @@ Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine()
}
Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServiceName(
- const OUString& aServiceName )
+ std::u16string_view aServiceName )
{
Reference< XRegressionCurve > xResult;
// todo: use factory methods with service name
- if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" )
+ if( aServiceName == u"com.sun.star.chart2.LinearRegressionCurve" )
{
xResult.set( new LinearRegressionCurve );
}
- else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.LogarithmicRegressionCurve" )
{
xResult.set( new LogarithmicRegressionCurve );
}
- else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.ExponentialRegressionCurve" )
{
xResult.set( new ExponentialRegressionCurve );
}
- else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.PotentialRegressionCurve" )
{
xResult.set( new PotentialRegressionCurve );
}
- else if( aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.PolynomialRegressionCurve" )
{
xResult.set( new PolynomialRegressionCurve );
}
- else if( aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.MovingAverageRegressionCurve" )
{
xResult.set( new MovingAverageRegressionCurve );
}
@@ -125,36 +125,36 @@ Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServ
}
Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionCurveCalculatorByServiceName(
- const OUString& aServiceName )
+ std::u16string_view aServiceName )
{
Reference< XRegressionCurveCalculator > xResult;
// todo: use factory methods with service name
- if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" )
+ if( aServiceName == u"com.sun.star.chart2.MeanValueRegressionCurve" )
{
xResult.set( new MeanValueRegressionCurveCalculator() );
}
- if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" )
+ if( aServiceName == u"com.sun.star.chart2.LinearRegressionCurve" )
{
xResult.set( new LinearRegressionCurveCalculator() );
}
- else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.LogarithmicRegressionCurve" )
{
xResult.set( new LogarithmicRegressionCurveCalculator() );
}
- else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.ExponentialRegressionCurve" )
{
xResult.set( new ExponentialRegressionCurveCalculator() );
}
- else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.PotentialRegressionCurve" )
{
xResult.set( new PotentialRegressionCurveCalculator() );
}
- else if( aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.PolynomialRegressionCurve" )
{
xResult.set( new PolynomialRegressionCurveCalculator() );
}
- else if( aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve" )
+ else if( aServiceName == u"com.sun.star.chart2.MovingAverageRegressionCurve" )
{
xResult.set( new MovingAverageRegressionCurveCalculator() );
}