[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 28 10:01:28 UTC 2019
sc/source/core/data/formulacell.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 906b505940f6330d2336164f341e338ff4b9b9ee
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Jan 25 15:08:16 2019 +0100
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Jan 28 11:01:06 2019 +0100
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 at collabora.com>
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
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;
More information about the Libreoffice-commits
mailing list