[Libreoffice-commits] core.git: Branch 'libreoffice-5-1-6' - sc/source

Eike Rathke erack at redhat.com
Tue Oct 18 06:28:15 UTC 2016


 sc/source/core/tool/refupdat.cxx |    4 ++++
 sc/source/core/tool/token.cxx    |   21 +++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 74e0e87c06867aeb60c0b9c64a4be8953920751f
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Oct 7 19:43:32 2016 +0200

    Resolves: tdf#101562 ScRefUpdate::Update() needs to flag sticky even unchanged
    
    ... so area broadcasters can be "adapted" (though not changed) and
    broadcast a change to invalidate listening lookup caches.
    
    This is the delete row part of the bug scenario.
    
    (cherry picked from commit 866eb4a7f93414932b8669d1a6afe0611655dfb4)
    
    tdf#101562 inserting within an entire col/row reference needs to flag change
    
    This is the insert part (e.g. Undo) of the bug scenario.
    
    (cherry picked from commit 180fe3e991432a5ab1ef573686ff9b35c732756b)
    
    87060bd9f0ad6d58a11308e58e7ce56875327c52
    
    Change-Id: Ie6072a6b8e7967faa135a3c4d0a9024b6afcd69c
    Reviewed-on: https://gerrit.libreoffice.org/29597
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 602a636..300dd1d 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -235,6 +235,8 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo
             {
                 // End was sticky, but start may have been moved. Only on range.
                 theCol2 = oldCol2;
+                if (eRet == UR_NOTHING)
+                    eRet = UR_STICKY;
             }
             // Else, if (bCut2 && theCol2 == MAXCOL) then end becomes sticky,
             // but currently there's nothing to do.
@@ -267,6 +269,8 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo
             {
                 // End was sticky, but start may have been moved. Only on range.
                 theRow2 = oldRow2;
+                if (eRet == UR_NOTHING)
+                    eRet = UR_STICKY;
             }
             // Else, if (bCut2 && theRow2 == MAXROW) then end becomes sticky,
             // but currently there's nothing to do.
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index fd390a4..ffb9a29 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2974,10 +2974,23 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon
 
                         if (rCxt.maRange.In(aAbs))
                         {
-                            ScRange aErrorRange( ScAddress::UNINITIALIZED );
-                            if (!aAbs.MoveSticky(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorRange))
-                                aAbs = aErrorRange;
-                            aRes.mbReferenceModified = true;
+                            // We shift either by column or by row, not both,
+                            // so moving the reference has only to be done in
+                            // the non-sticky case.
+                            if ((rCxt.mnRowDelta && rRef.IsEntireCol()) || (rCxt.mnColDelta && rRef.IsEntireRow()))
+                            {
+                                // In entire col/row, values are shifted within
+                                // the reference, which affects all positional
+                                // results like in MATCH or matrix positions.
+                                aRes.mbValueChanged = true;
+                            }
+                            else
+                            {
+                                ScRange aErrorRange( ScAddress::UNINITIALIZED );
+                                if (!aAbs.MoveSticky(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorRange))
+                                    aAbs = aErrorRange;
+                                aRes.mbReferenceModified = true;
+                            }
                         }
                         else if (rCxt.maRange.Intersects(aAbs))
                         {


More information about the Libreoffice-commits mailing list