diff options
author | Łukasz Hryniuk <lukasz.hryniuk@wp.pl> | 2015-03-22 17:22:29 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-03-23 09:12:41 +0000 |
commit | 38e247046ec38cdab0f7d56614a183dcfc49389c (patch) | |
tree | a8269f4c2dedee1c4af0daf9e118721bb6c86c7d /sc | |
parent | 12168aeea91a57e63159c3103c904d630c44c62e (diff) |
tdf#89387 Change summing loop to SumSquare method
Change-Id: I996a984763f9fece9074f8bc318db25f01b8f4ed
Reviewed-on: https://gerrit.libreoffice.org/14954
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr5.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 81bcdfc927da..c030c8df7383 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); } } |