summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-23 16:07:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-27 14:07:56 +0200
commitc7c6f0af6c836ebe0968967a1e7c8320b0ac17d6 (patch)
tree4bc5b2fa623b9765b88bbfe7de10a7590c87d5c8 /chart2
parent99482297c7dd497e41fad2e7193759043e305101 (diff)
loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/ExponentialRegressionCurveCalculator.cxx10
-rw-r--r--chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx8
-rw-r--r--chart2/source/tools/PolynomialRegressionCurveCalculator.cxx2
-rw-r--r--chart2/source/tools/PotentialRegressionCurveCalculator.cxx6
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx2
5 files changed, 14 insertions, 14 deletions
diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
index 1aa962ab5e3e..1d389d6f99bf 100644
--- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
@@ -183,13 +183,13 @@ OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation(
// if nValueLength not calculated then nullptr
sal_Int32* pValueLength = nValueLength ? &nValueLength : nullptr;
if ( m_fSign < 0.0 )
- aTmpBuf.append( OUStringChar(aMinusSign) ).append( " " );
+ aTmpBuf.append( OUStringChar(aMinusSign) + " " );
if ( bHasIntercept )
{
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, fIntercept, pValueLength );
if ( aValueString != "1" ) // aValueString may be rounded to 1 if nValueLength is small
{
- aTmpBuf.append( aValueString ).append( " " );
+ aTmpBuf.append( aValueString + " " );
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
aTmpBuf.truncate();
}
@@ -208,16 +208,16 @@ OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation(
}
}
if ( m_fLogSlope < 0.0 )
- aTmpBuf.append( OUStringChar(aMinusSign) ).append( " " );
+ aTmpBuf.append( OUStringChar(aMinusSign) + " " );
if ( bHasLogSlope )
{
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope), pValueLength );
if ( aValueString != "1" ) // aValueString may be rounded to 1 if nValueLength is small
{
- aTmpBuf.append( aValueString ).append( " " );
+ aTmpBuf.append( aValueString + " " );
}
}
- aTmpBuf.append( mXName ).append(" )");
+ aTmpBuf.append( mXName + " )");
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
return aBuf.makeStringAndClear();
diff --git a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
index c09eab50975c..bfa5d9e4be5d 100644
--- a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx
@@ -156,17 +156,17 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation(
{
if( m_fSlope < 0.0 )
{
- aTmpBuf.append( OUStringChar(aMinusSign) ).append( " " );
+ aTmpBuf.append( OUStringChar(aMinusSign) + " " );
}
if( bHasSlope )
{
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fSlope), pValueLength );
if ( aValueString != "1" ) // aValueString may be rounded to 1 if nValueLength is small
{
- aTmpBuf.append( aValueString ).append( " " );
+ aTmpBuf.append( aValueString + " " );
}
}
- aTmpBuf.append( "ln(" ).append( mXName ).append( ") " );
+ aTmpBuf.append( "ln(" + mXName + ") " );
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
aTmpBuf.truncate();
@@ -175,7 +175,7 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation(
}
// add intercept value
if( m_fIntercept < 0.0 )
- aTmpBuf.append( OUStringChar(aMinusSign) ).append( " " );
+ aTmpBuf.append( OUStringChar(aMinusSign) + " " );
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fIntercept), pValueLength );
if ( aValueString != "0" ) // aValueString may be rounded to 0 if nValueLength is small
{
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index b3585b71f5e3..38e326cbbbc4 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -345,7 +345,7 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
{
if ( bFindValue ) // if it is not the first aValue
aTmpBuf.append( " " );
- aTmpBuf.append( OUStringChar(aMinusSign) ).append(" ");
+ aTmpBuf.append( OUStringChar(aMinusSign) + " ");
aValue = - aValue;
}
else
diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
index eb054bd8db66..89f6dc5b9e6e 100644
--- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
@@ -170,18 +170,18 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation(
// if nValueLength not calculated then nullptr
sal_Int32* pValueLength = nValueLength ? &nValueLength : nullptr;
if ( m_fIntercept < 0.0 ) // add intercept value
- aTmpBuf.append( OUStringChar(aMinusSign) ).append( " " );
+ aTmpBuf.append( OUStringChar(aMinusSign) + " " );
if( bHasIntercept )
{
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fIntercept), pValueLength );
if ( aValueString != "1" ) // aValueString may be rounded to 1 if nValueLength is small
{
- aTmpBuf.append( aValueString ).append( " " );
+ aTmpBuf.append( aValueString + " " );
}
}
if( m_fSlope != 0.0 ) // add slope value
{
- aTmpBuf.append( mXName ).append( "^" );
+ aTmpBuf.append( mXName + "^" );
aTmpBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength ));
}
addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 39a97c618a47..fda17a91964b 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1542,7 +1542,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
}
if( bShowCorrCoeff )
{
- aFormula.append( "R" ).append( OUStringChar( aSuperscriptFigures[2] ) ).append( " = " );
+ aFormula.append( "R" + OUStringChar( aSuperscriptFigures[2] ) + " = " );
double fR( xRegressionCurveCalculator->getCorrelationCoefficient());
if (m_apNumberFormatterWrapper)
{