diff options
author | Ouyang Leyan <ouyang.leyan@hotmail.com> | 2021-01-05 08:49:54 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-02 07:21:18 +0100 |
commit | 3078044653f1e1b0a055c47eeb8d27834c07268a (patch) | |
tree | 9399728a20fed7be381c81a0244ae117dbf90e10 /sc | |
parent | 8ab75c40e349463c89988680c0a194a00018e420 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
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 ); } } |