summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-11-07 15:36:27 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-11-29 12:54:49 +0100
commit1a9bde76620449f2e718bc02a954ebcfd3426f18 (patch)
tree470c9894d0b41b47ee834e22997418383dced38d /sc
parentf73cdd5680505523e0eb20f828f1a294f342b93c (diff)
calc threads cycle detection should not break computing a value
If ScFormulaCell::Interpret() is called to actually compute the cell's value (bRunning==true), do not bail out on a detected cycle, it needs to be detected as an actual cyclic reference. Happens with testCopyPasteMixedReferenceFormula when during computing dependencies cell C1 actually has a cyclic dependency on itself. Without this change, it would simply use its previously computed value. Change-Id: Ibf90b118b87d3536f5014004ea4a1dbad93ab270 Reviewed-on: https://gerrit.libreoffice.org/63183 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/formulacell.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index bdc832c55d39..bad0192822b8 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1523,8 +1523,10 @@ void ScFormulaCell::Interpret()
ScFormulaCell* pTopCell = mxGroup ? mxGroup->mpTopCell : this;
- if (pTopCell->mbSeenInPath && rRecursionHelper.GetDepComputeLevel())
+ if (pTopCell->mbSeenInPath && rRecursionHelper.GetDepComputeLevel() && !bRunning)
{
+ // This call arose from a dependency calculation and we just found a cycle.
+ // This will mark all elements in the cycle as parts-of-cycle.
ScFormulaGroupCycleCheckGuard aCycleCheckGuard(rRecursionHelper, pTopCell);
return;
}