diff options
author | Eike Rathke <erack@redhat.com> | 2018-06-20 17:22:14 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-06-20 19:46:33 +0200 |
commit | 678f8ab7eb90f5b0dd99328957b21d11e3be68b4 (patch) | |
tree | 54e9766ddd877b1123e6e8bd11ed305a7a48db11 | |
parent | f53a5dfae6d07ea314c5c742c7ceeb94e2066ac1 (diff) |
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 <erack@redhat.com>
Tested-by: Jenkins
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 5378d0084c31..615dccfce416 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. |