Hi Eike,
I presume it is the combination of BackSolver iteration and recursion.
Setting an error if MAXRECURSION is reached is not appropriate.
[..]
That thing is a beast and time consuming to debug. To understand what
it does it would help to set MAXRECURSION to 5 or so and have a few
more simple recursing formula cells to step through. (A9:=A8 A8:=A7
...)
Setting up a simple BackSolver scenario that kicks in badly with the
reduced limit might be equally challenging..
Well, after a short break (after all, it's summer here) I resumed work on this problem.
I set MAXRECURSION to 4, made a simple spreadsheet (A2:=A1+1, A3:=A2=1, etc.) and started 'Goal
Seeking'.
With the target at A5 and the variable cell at A1, the recursion count reached 4 every time
Interpret() was called from BackSolver(); BackSolver() was called once and a valid solution was
found (as expected).
With the target at A6 and the variable cell at A1, the recursion count reached 5 every time
Interpret() was called from BackSolver(); Interpret() was called a zillion times and I aborted the
application (more or less as expected).
I changed a littel bit in the code of ScFormulaCell::Interpret():
if (rRecursionHelper.GetRecursionCount() > MAXRECURSION)
{
bRunning = true;
rRecursionHelper.SetInRecursionReturn( true);
return; //line added for testing
}
I changed this so that Interpret does not continue its recursive work, as it seems to do.
With the target at A6 and the variable cell at A1, the recursion count reached 5, Interpret() was
called once from BackSolver(); BackSolver() was called twice; Goal Seek reported a failure
(circular reference), but (better than expected).
To me, it _seems_ as if reaching the maximum recusrion count is not handled correctly in
ScFormulaCell::Interpret().
Before I start digging in the wrong direction and messing up things that I shouldn't touch I would
very much like your expert opinion ;-)
Winfried
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.