Undo my poor mans recursion control in favour of the real thing

i.e. undo

commit ea441294e15b23f703f139055e9a18287745ca23
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Thu Apr 2 13:19:32 2015 +0100

    avoid endless recursion in fdo84763-2.ods

and rely on

commit 29ee431c1cf859c3d5a5041cff5cb04b89db27a0
Author: Eike Rathke <erack@redhat.com>
Date:   Tue Mar 15 17:39:03 2016 +0100

    Resolves: tdf#93196 add RecursionCounter guard also to InterpretFormulaGroup()

    ... same as for ScFormulaCell::InterpretTail()

Change-Id: I85dc6e37d987ce9fe41a9e4c337e02a1cec4f0c8
This commit is contained in:
Caolán McNamara 2016-03-15 21:11:24 +00:00
parent f87317c326
commit 1c122eb61d
3 changed files with 4 additions and 14 deletions

View File

@ -4036,8 +4036,7 @@ bool ScFormulaCell::InterpretFormulaGroup()
ScTokenArray aCode;
ScGroupTokenConverter aConverter(aCode, *pDocument, *this, xGroup->mpTopCell->aPos);
std::vector<ScTokenArray*> aLoopControl;
if (!aConverter.convert(*pCode, aLoopControl))
if (!aConverter.convert(*pCode))
{
SAL_INFO("sc.opencl", "conversion of group " << this << " failed, disabling");
mxGroup->meCalcState = sc::GroupCalcDisabled;

View File

@ -89,7 +89,7 @@ ScGroupTokenConverter::ScGroupTokenConverter(ScTokenArray& rGroupTokens, ScDocum
{
}
bool ScGroupTokenConverter::convert(ScTokenArray& rCode, std::vector<ScTokenArray*>& rConversionStack)
bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
{
#if 0
{ // debug to start with:
@ -232,16 +232,7 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode, std::vector<ScTokenArra
mrGroupTokens.AddOpCode(ocOpen);
if (std::find(rConversionStack.begin(), rConversionStack.end(), pNamedTokens) != rConversionStack.end())
{
SAL_WARN("sc", "loop in recursive ScGroupTokenConverter::convert");
return false;
}
rConversionStack.push_back(pNamedTokens);
bool bOk = convert(*pNamedTokens, rConversionStack);
rConversionStack.pop_back();
if (!bOk)
if (!convert(*pNamedTokens))
return false;
mrGroupTokens.AddOpCode(ocClose);

View File

@ -30,7 +30,7 @@ class SC_DLLPUBLIC ScGroupTokenConverter
public:
ScGroupTokenConverter(ScTokenArray& rGroupTokens, ScDocument& rDoc, ScFormulaCell& rCell, const ScAddress& rPos);
bool convert(ScTokenArray& rCode, std::vector<ScTokenArray*>& rConversionStack);
bool convert(ScTokenArray& rCode);
};
#endif // INCLUDED_SC_SOURCE_CORE_INC_GROUPTOKENCONVERTER_HXX