[Libreoffice-commits] core.git: Branch 'feature/fixes27' - sc/source

Michael Meeks michael.meeks at collabora.com
Tue Jul 26 09:23:20 UTC 2016


 sc/source/core/tool/interpr1.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit d355837860131e99e83bc3fb34477e13abbd39ff
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Jul 26 09:21:23 2016 +0100

    tdf#100753 - Move error checking out of the inner loop.
    
    Avoids a performance regression.
    
    Change-Id: I984378d190bbf36ad26d7d3dc962bca2625c09b4

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 143aec6..95ac726 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3613,8 +3613,6 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount,
             case svDouble :
             {
                 fVal = GetDouble();
-                if ( nGlobalError )
-                    return;
                 values.push_back(fVal);
                 fSum    += fVal;
                 rValCount++;
@@ -3627,8 +3625,6 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount,
                 if (aCell.hasNumeric())
                 {
                     fVal = GetCellValue(aAdr, aCell);
-                    if ( nGlobalError )
-                        return;
                     values.push_back(fVal);
                     fSum += fVal;
                     rValCount++;
@@ -3709,6 +3705,12 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount,
         }
     }
 
+    if ( nGlobalError )
+    {
+        rValCount = 0.0;
+        return;
+    }
+
     ::std::vector<double>::size_type n = values.size();
     vMean = fSum / n;
     for (::std::vector<double>::size_type i = 0; i < n; i++)


More information about the Libreoffice-commits mailing list