sc/source/ui/view/viewfun2.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit 3078044653f1e1b0a055c47eeb8d27834c07268a Author: Ouyang Leyan <ouyang.le...@hotmail.com> AuthorDate: Tue Jan 5 08:49:54 2021 +0100 Commit: Noel Grandin <noel.gran...@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.gran...@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 ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits