sc/source/core/data/formulacell.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
New commits: commit 8cbd64985af140b2afac6ea2fd3b9b93300f6f7c Author: Eike Rathke <[email protected]> Date: Wed Jun 20 17:22:14 2018 +0200 Resolves: tdf#117049 do not re-interpret a single circular self-reference ... to not execute the calculation twice, which added an implicit iteration step. Change-Id: I943f770d32ebe84a8359f2f94c1f0bf5731b6f88 Reviewed-on: https://gerrit.libreoffice.org/56170 Reviewed-by: Eike Rathke <[email protected]> Tested-by: Jenkins (cherry picked from commit 678f8ab7eb90f5b0dd99328957b21d11e3be68b4) Reviewed-on: https://gerrit.libreoffice.org/56178 diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index e996b8c2318f..d20ea590441d 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1610,11 +1610,16 @@ void ScFormulaCell::Interpret() else { bResumeIteration = false; - // Close circle once. - pDocument->IncInterpretLevel(); - rRecursionHelper.GetList().back().pCell->InterpretTail( pDocument->GetNonThreadedContext(), - SCITP_CLOSE_ITERATION_CIRCLE); - pDocument->DecInterpretLevel(); + // Close circle once. If 'this' is self-referencing only + // (e.g. counter or self-adder) then it is already + // implicitly closed. + if (rRecursionHelper.GetList().size() > 1) + { + pDocument->IncInterpretLevel(); + rRecursionHelper.GetList().back().pCell->InterpretTail( + pDocument->GetNonThreadedContext(), SCITP_CLOSE_ITERATION_CIRCLE); + pDocument->DecInterpretLevel(); + } // Start at 1, init things. rRecursionHelper.StartIteration(); // Mark all cells being in iteration. _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
