diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-01-25 15:08:16 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-01-28 11:01:06 +0100 |
commit | 906b505940f6330d2336164f341e338ff4b9b9ee (patch) | |
tree | 87de1e848215c0c0cfb22017fd859d807e87f482 | |
parent | 6f5991261a152812d5023fd146398c1528683676 (diff) |
avoid a calc threads assert because of an undetected cyclic dependency
ooo#103156-1 has a quite complex cycle of cells, some of them (and only some)
in formula groups. And the complex Interpret() nesting confuses its cycle
detection into believing that Interpret() can simply return without providing
a value, which is ok if it's called from dependency checking of threaded
calculation, but is not ok when it's called for a single cell evalution.
So make the code set cyclic-dependency error even when it's possibly
inside dependency checking, since if it's really that case, the error
will be later overwritten by the actual value.
This is still not a completely correct fix, as the document on repeated hard
recals alternates some cells between correctly reporting an error and providing
some bogus values (e.g. column S in the second sheet). But the document uses
iteration, which complicates all this stuff even more, and after spending
quite some time on this I'm still not sure on how to fix that. So at least
for now, at least avoid the assert.
Change-Id: I395f97d104d98b5c043d1f17878338d3f1b31146
Reviewed-on: https://gerrit.libreoffice.org/66911
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 900bd2e71990..3137cfd53a42 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1519,9 +1519,10 @@ void ScFormulaCell::Interpret() ScFormulaCell* pTopCell = mxGroup ? mxGroup->mpTopCell : this; - if (pTopCell->mbSeenInPath && rRecursionHelper.GetDepComputeLevel() && !bRunning) + if (pTopCell->mbSeenInPath && rRecursionHelper.GetDepComputeLevel()) { // This call arose from a dependency calculation and we just found a cycle. + aResult.SetResultError( FormulaError::CircularReference ); // This will mark all elements in the cycle as parts-of-cycle. ScFormulaGroupCycleCheckGuard aCycleCheckGuard(rRecursionHelper, pTopCell); return; |