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

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 18 00:56:22 UTC 2019


 sc/source/core/data/column.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 491e8f60bf7f216a3bb3092b22334924b6c9aee1
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue Dec 17 23:51:54 2019 +0100
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Wed Dec 18 01:55:02 2019 +0100

    Resolves: tdf#129396 Refresh shared formula group area listeners upon shifting
    
    Regression from
    
        commit 47230a036fe35b9a7a7c0609232849fcbb51efcc
        CommitDate: Thu Feb 5 11:52:51 2015 +0100
    
            Resolves: tdf#88792 do not hold a ScFormulaCell** in group area listener
    
    where previously the listener position's column was taken from the
    group's remembered top formula cell (then updated) position, which
    holding the cell was wrong in other cases.
    
    Change-Id: Ida1503daa7cbda2b41459ff5d63652a6febd91e0
    Reviewed-on: https://gerrit.libreoffice.org/85347
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3cfe18891f63..268475df4d1c 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2157,6 +2157,7 @@ class UpdateRefOnNonCopy
         // Run this before the position gets updated.
         sc::RefUpdateResult aRes = pCode->AdjustReferenceOnShift(*mpCxt, aOldPos);
 
+        bool bGroupShifted = false;
         if (pTop->UpdatePosOnShift(*mpCxt))
         {
             ScAddress aErrorPos( ScAddress::UNINITIALIZED );
@@ -2172,6 +2173,15 @@ class UpdateRefOnNonCopy
 
             if (pCode->IsRecalcModeOnRefMove())
                 aRes.mbValueChanged = true;
+
+            // FormulaGroupAreaListener (contrary to ScBroadcastArea) is not
+            // updated but needs to be re-setup, else at least its mpColumn
+            // would indicate the old column to collect cells from. tdf#129396
+            /* TODO: investigate if that could be short-cut to avoid all the
+             * EndListeningTo() / StartListeningTo() overhead and is really
+             * only necessary when shifting the column, not also when shifting
+             * rows. */
+            bGroupShifted = true;
         }
         else if (aRes.mbReferenceModified && pCode->IsRecalcModeOnRefMove())
         {
@@ -2183,7 +2193,7 @@ class UpdateRefOnNonCopy
         if (aRes.mbNameModified)
             recompileTokenArray(*pTop);
 
-        if (aRes.mbReferenceModified || aRes.mbNameModified)
+        if (aRes.mbReferenceModified || aRes.mbNameModified || bGroupShifted)
         {
             sc::EndListeningContext aEndCxt(mpCxt->mrDoc, pOldCode.get());
             aEndCxt.setPositionDelta(


More information about the Libreoffice-commits mailing list