[Libreoffice-commits] core.git: chart2/source

Tomaž Vajngerl quikee at gmail.com
Wed Jul 3 14:05:23 PDT 2013


 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit e14e818ac3b890ee35c7be349ae39e8e3bdc277d
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Wed Jul 3 23:00:43 2013 +0200

    Polynomial curve equation: show "x^1" as "x"
    
    Change-Id: I86ff9b5cc2f3fa60533794ed9ecd1175924c1d25

diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index ce64ed6..19d224d 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -189,8 +189,15 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
 
         if(i > 0)
         {
-            aBuf.appendAscii( "x^" );
-            aBuf.append(i);
+            if (i == 1)
+            {
+                aBuf.appendAscii( "x" );
+            }
+            else
+            {
+                aBuf.appendAscii( "x^" );
+                aBuf.append(i);
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list