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

Ouyang Leyan (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 2 06:22:07 UTC 2021


 sc/source/ui/view/viewfun2.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 3078044653f1e1b0a055c47eeb8d27834c07268a
Author:     Ouyang Leyan <ouyang.leyan at hotmail.com>
AuthorDate: Tue Jan 5 08:49:54 2021 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Mar 2 07:21:18 2021 +0100

    tdf#43175: Adapt ranges when copying or moving several sheets
    
    When copying several sheets at once using the "Move or copy sheets..."
    feature, the ranges were not updated, in charts for example. Same when
    moving a sheet and choosing a new name at the same time.
    
    Change-Id: I0d05f2d123dfe1174ba126d7f73845988ec1e983
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108739
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 112226405232..814e3a05b7b3 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3084,6 +3084,10 @@ void ScViewFunc::MoveTable(
                     nDestTab1=nTabCount;
                 }
             }
+            //If sheets are copied or renamed when moved, the references to the data inside the sheets have to be adapted
+            if (bCopy || bRename)
+                ScChartHelper::AdjustRangesOfChartsOnDestinationPage(rDoc, rDestDoc, nMovTab,
+                                                                     nDestTab1);
 
             pDestTabs->push_back(nDestTab1);
         }
@@ -3133,9 +3137,6 @@ void ScViewFunc::MoveTable(
 
         SetTabNo( nNewTab, true );
 
-        //#i29848# adjust references to data on the copied sheet
-        if( bCopy )
-            ScChartHelper::AdjustRangesOfChartsOnDestinationPage( rDoc, rDestDoc, nTab, nNewTab );
     }
 }
 


More information about the Libreoffice-commits mailing list