diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-11-07 15:36:27 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-11-29 12:54:49 +0100 |
commit | 1a9bde76620449f2e718bc02a954ebcfd3426f18 (patch) | |
tree | 470c9894d0b41b47ee834e22997418383dced38d /sc | |
parent | f73cdd5680505523e0eb20f828f1a294f342b93c (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.cxx | 4 |
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; } |