summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-07-17 15:10:51 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-08-31 07:18:51 +0000
commit488c8053dc824d4736b02020bb440d43c4933eb2 (patch)
tree7d50b57c1bfee39dba87775d99f44624a4a881d0 /chart2/source
parente53bb6a0f0257da68790437d7ac39a7e103fe9ea (diff)
Improve polynomial trendline equation representation
Insert a blank between x variable and its coefficient Aplly also to linear trendline Change-Id: I7d1e61f12aa1cf98b4181df6a4849df1e5293793 Reviewed-on: https://gerrit.libreoffice.org/27265 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/tools/PolynomialRegressionCurveCalculator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 9b885993d563..ef3ba7eb3014 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -252,7 +252,7 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
nCharMin += 3; // " + "
if ( i > 0 )
{
- nCharMin += mXName.getLength(); // "x"
+ nCharMin += mXName.getLength() + 1; // " x"
if ( i > 1 )
nCharMin +=1; // "^i"
if ( i >= 10 )
@@ -292,7 +292,11 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
sal_Int32* pValueLength = nValueLength ? &nValueLength : nullptr;
OUString aValueString = getFormattedString( xNumFormatter, nNumberFormatKey, aValue, pValueLength );
if ( i == 0 || aValueString != "1" ) // aValueString may be rounded to 1 if nValueLength is small
+ {
aTmpBuf.append( aValueString );
+ if ( i > 0 ) // insert blank between coefficient and x
+ aTmpBuf.append( " " );
+ }
if(i > 0)
{