sc/source/core/data/formulacell.cxx | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
New commits: commit 545f5f8abd1df1f9818fbc62c95006149bcc18ef Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Nov 11 21:17:01 2016 -0500 Guarantee that InterpretFormulaGroup() is always called first. This makes it easier to profile group calculations via formula log. You can always bail out of that function when unfavorable condition hits. Change-Id: I49664c3e34b9efc98f39845379631649f76769de Reviewed-on: https://gerrit.libreoffice.org/30790 Reviewed-by: Kohei Yoshida <libreoff...@kohei.us> Tested-by: Kohei Yoshida <libreoff...@kohei.us> diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 6231bc6..8b2e62a 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1537,24 +1537,16 @@ void ScFormulaCell::Interpret() } else { - // Do not attempt to interpret a group when calculations are already - // running, otherwise we may run into a circular reference hell. See - // tdf#95748 - if (rRecursionHelper.GetRecursionCount()) - InterpretTail( SCITP_NORMAL); - else - { #if DEBUG_CALCULATION - aDC.enterGroup(); - bool bGroupInterpreted = InterpretFormulaGroup(); - aDC.leaveGroup(); - if (!bGroupInterpreted) - InterpretTail( SCITP_NORMAL); + aDC.enterGroup(); + bool bGroupInterpreted = InterpretFormulaGroup(); + aDC.leaveGroup(); + if (!bGroupInterpreted) + InterpretTail( SCITP_NORMAL); #else - if (!InterpretFormulaGroup()) - InterpretTail( SCITP_NORMAL); + if (!InterpretFormulaGroup()) + InterpretTail( SCITP_NORMAL); #endif - } } // While leaving a recursion or iteration stack, insert its cells to the @@ -4033,6 +4025,15 @@ bool ScFormulaCell::InterpretFormulaGroup() auto aScope = sc::FormulaLogger::get().enterGroup(*pDocument, *this); + if (pDocument->GetRecursionHelper().GetRecursionCount()) + { + // Do not attempt to interpret a group when calculations are already + // running, otherwise we may run into a circular reference hell. See + // tdf#95748 + aScope.addMessage("group calc disabled during recursive calculation."); + return false; + } + if (mxGroup->meCalcState == sc::GroupCalcDisabled) { aScope.addMessage("group calc disabled"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits