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

Łukasz Hryniuk lukasz.hryniuk at wp.pl
Mon Mar 23 02:13:53 PDT 2015


 sc/source/core/tool/interpr5.cxx |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 38e247046ec38cdab0f7d56614a183dcfc49389c
Author: Łukasz Hryniuk <lukasz.hryniuk at wp.pl>
Date:   Sun Mar 22 17:22:29 2015 +0100

    tdf#89387 Change summing loop to SumSquare method
    
    Change-Id: I996a984763f9fece9074f8bc318db25f01b8f4ed
    Reviewed-on: https://gerrit.libreoffice.org/14954
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 81bcdfc..c030c8d 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1786,14 +1786,8 @@ void ScInterpreter::ScSumXMY2()
     }
     else
     {
-        double fVal, fSum = 0.0;
-        SCSIZE nCount = pResMat->GetElementCount();
-        for (SCSIZE i = 0; i < nCount; i++)
-            if (!pResMat->IsString(i))
-            {
-                fVal = pResMat->GetDouble(i);
-                fSum += fVal * fVal;
-            }
+        ScMatrix::IterateResult aRes = pResMat->SumSquare(false);
+        double fSum = aRes.mfRest;
         PushDouble(fSum);
     }
 }


More information about the Libreoffice-commits mailing list