[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon Jun 25 19:39:33 UTC 2018


 sc/source/core/data/formulacell.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 86d02e1fde746988adc17c9e8480ae9967c5a299
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jun 25 19:08:06 2018 +0200

    Close circle once in iterations only if not 'this'
    
    ... as 'this' was just appended hence calculated.
    Question remains if there's any situation where the last cell
    would not be 'this'.
    
    Change-Id: I9cc1a7e38bdd6aca0e36a4cf1ef1b827003e72a9
    Reviewed-on: https://gerrit.libreoffice.org/56412
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 462d09891698..edc8e004706f 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1613,10 +1613,15 @@ void ScFormulaCell::Interpret()
                     // Close circle once. If 'this' is self-referencing only
                     // (e.g. counter or self-adder) then it is already
                     // implicitly closed.
-                    if (rRecursionHelper.GetList().size() > 1)
+                    /* TODO: does this even make sense anymore? The last cell
+                     * added above with rRecursionHelper.Insert() should always
+                     * be 'this', shouldn't it? */
+                    ScFormulaCell* pLastCell = nullptr;
+                    if (rRecursionHelper.GetList().size() > 1 &&
+                            ((pLastCell = rRecursionHelper.GetList().back().pCell) != this))
                     {
                         pDocument->IncInterpretLevel();
-                        rRecursionHelper.GetList().back().pCell->InterpretTail(
+                        pLastCell->InterpretTail(
                                 pDocument->GetNonThreadedContext(), SCITP_CLOSE_ITERATION_CIRCLE);
                         pDocument->DecInterpretLevel();
                     }


More information about the Libreoffice-commits mailing list