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

Tor Lillqvist tml at collabora.com
Wed Sep 27 18:15:10 UTC 2017


 sc/source/core/data/formulacell.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 05b3614cac57abc414955f8b1047cf5ca168580e
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 27 19:42:10 2017 +0300

    If we are going to avoid repeated calls to pDocument->GetRecursionHelper(),
    
    do it from the start of the function then.
    
    Change-Id: I4699fbd9c70f6ec0110d202062631e8861095aa0

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 22ef81ca2495..d75a93582b15 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1464,6 +1464,8 @@ public:
 
 void ScFormulaCell::Interpret()
 {
+    ScRecursionHelper& rRecursionHelper = pDocument->GetRecursionHelper();
+
 #if DEBUG_CALCULATION
     static bool bDebugCalculationInit = true;
     if (bDebugCalculationInit)
@@ -1475,7 +1477,7 @@ void ScFormulaCell::Interpret()
     DebugCalculationStacker aDebugEntry( aPos, pDocument);
 #endif
 
-    if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn())
+    if (!IsDirtyOrInTableOpDirty() || rRecursionHelper.IsInReturn())
         return;     // no double/triple processing
 
     //FIXME:
@@ -1496,20 +1498,19 @@ void ScFormulaCell::Interpret()
             aResult.SetResultError( FormulaError::NONE );
 
         // Start or add to iteration list.
-        if (!pDocument->GetRecursionHelper().IsDoingIteration() ||
-                !pDocument->GetRecursionHelper().GetRecursionInIterationStack().top()->bIsIterCell)
-            pDocument->GetRecursionHelper().SetInIterationReturn( true);
+        if (!rRecursionHelper.IsDoingIteration() ||
+                !rRecursionHelper.GetRecursionInIterationStack().top()->bIsIterCell)
+            rRecursionHelper.SetInIterationReturn( true);
 
         return;
     }
     // no multiple interprets for GetErrCode, IsValue, GetValue and
     // different entry point recursions. Would also lead to premature
     // convergence in iterations.
-    if (pDocument->GetRecursionHelper().GetIteration() && nSeenInIteration ==
-            pDocument->GetRecursionHelper().GetIteration())
+    if (rRecursionHelper.GetIteration() && nSeenInIteration ==
+            rRecursionHelper.GetIteration())
         return ;
 
-    ScRecursionHelper& rRecursionHelper = pDocument->GetRecursionHelper();
     bool bOldRunning = bRunning;
     if (rRecursionHelper.GetRecursionCount() > MAXRECURSION)
     {


More information about the Libreoffice-commits mailing list