sc/source/ui/view/viewfun2.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit b2fc048cb2d5f5bd1095a8110fa4a16a305a8acc Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Tue May 4 10:51:21 2021 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon May 10 09:25:29 2021 +0200 tdf#43175 - Adjust chart references on every copied sheet Change-Id: I92fcfeecb9aa10bf8974de953399d780ffe02176 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115058 Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit d55bf8aab008d84fac673f3cd907f5199347ce77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115210 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 9bad80bb01d0..c68f2586c3f0 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -3060,6 +3060,16 @@ void ScViewFunc::MoveTable( } pDocShell->MoveTable( nMovTab, nDestTab1, bCopy, false ); // Undo is here + // tdf#43175 - Adjust chart references on every copied sheet + if (bCopy) + { + // New position of source table after moving + SCTAB nSrcTab = (nDestTab1 <= nMovTab) ? nMovTab + 1 : nMovTab; + //#i29848# adjust references to data on the copied sheet + ScChartHelper::AdjustRangesOfChartsOnDestinationPage(rDoc, rDestDoc, nSrcTab, + nDestTab1); + } + if(bCopy && rDoc.IsScenario(nMovTab)) { OUString aComment; @@ -3132,10 +3142,6 @@ void ScViewFunc::MoveTable( nNewTab--; 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