summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2019-11-01 21:28:41 +0530
committerDennis Francis <dennis.francis@collabora.com>2019-11-07 07:55:48 +0100
commit0f4ba703038fb8678d4b1e7e6e0fd5e2d3025908 (patch)
tree10e0a7dbd0400182ffbb9b54a38396357530c5b6 /sc/inc
parent25c390e17a7f1c018b5eed1ef7dfd568b76f4a84 (diff)
tdf#124270 : improve formula-group cycle detection
When a cycle of formula-groups is detected, do not conclude that there is a circular dependency of cells. Only mark the cells with Err:522 when all formula-groups in the cycle have cleanly backed off from the dependency evaluation mode. This commit also fixes places where we overlooked to back-off from dependency evaluation mode on detection of a cycle of formula-groups. Additionally mark formula-groups with self references as "part of cycle" by setting mbPartOfCycle. Unit tests for all these fixes are in a follow-up commit. Change-Id: I57a88bbc88adf177d49768a5d4585b3e53729aea Reviewed-on: https://gerrit.libreoffice.org/82074 Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Tested-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/recursionhelper.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx
index 5962f11eb61a..cff958f52fea 100644
--- a/sc/inc/recursionhelper.hxx
+++ b/sc/inc/recursionhelper.hxx
@@ -52,6 +52,9 @@ class ScRecursionHelper
ScFormulaRecursionList::iterator aLastIterationStart;
ScRecursionInIterationStack aRecursionInIterationStack;
ScFGList aFGList;
+ // Flag list corresponding to aFGList to indicate whether each formula-group
+ // is in a depedency evaluation mode or not.
+ std::vector< bool > aInDependencyEvalMode;
sal_uInt16 nRecursionCount;
sal_uInt16 nIteration;
// Count of ScFormulaCell::CheckComputeDependencies in current call-stack.
@@ -110,7 +113,9 @@ public:
/** Detects a simple cycle involving formula-groups and singleton formula-cells. */
bool PushFormulaGroup(ScFormulaCell* pCell);
void PopFormulaGroup();
+ bool AnyCycleMemberInDependencyEvalMode(ScFormulaCell* pCell);
bool AnyParentFGInCycle();
+ void SetFormulaGroupDepEvalMode(bool bSet);
void AddTemporaryGroupCell(ScFormulaCell* cell);
void CleanTemporaryGroupCells();