sc/source/ui/undo/undoblk.cxx | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
New commits: commit c2c651ee229a1d153cf515777d018ca6eda55d98 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Thu Feb 1 22:45:42 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Feb 8 20:51:37 2024 +0100 lok: calc: missing invalidation of position on undo a drag and drop When undo/redo a drag and drop of a block of cells cached position was not invalidated. Change-Id: I538815bba46f6759db3b09a583eca9481148cdbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162915 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163035 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 7313337af681..8577e058ca17 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1352,6 +1352,13 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) pDocShell->UpdatePaintExt(mnPaintExtFlags, aPaintRange); maPaintRanges.Join(aPaintRange); + if (comphelper::LibreOfficeKit::isActive()) + { + ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell(); + pTabViewShell->OnLOKSetWidthOrHeight(aPaintRange.aStart.Col(), true); + pTabViewShell->OnLOKSetWidthOrHeight(aPaintRange.aStart.Row(), false); + } + ScTabViewShell::notifyAllViewsSheetGeomInvalidation( ScTabViewShell::GetActiveViewShell(), true /* bColumns */, true /* bRows */, @@ -1507,6 +1514,18 @@ void ScUndoDragDrop::Redo() if (comphelper::LibreOfficeKit::isActive()) { + SCCOL nStartCol = aDestRange.aStart.Col(); + SCROW nStartRow = aDestRange.aStart.Row(); + if (bCut) + { + nStartCol = std::min(nStartCol, aSrcRange.aStart.Col()); + nStartRow = std::min(nStartRow, aSrcRange.aStart.Row()); + } + + ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell(); + pTabViewShell->OnLOKSetWidthOrHeight(nStartCol, true); + pTabViewShell->OnLOKSetWidthOrHeight(nStartRow, false); + SCTAB nStartTab = aDestRange.aStart.Tab(); SCTAB nEndTab = aDestRange.aEnd.Tab(); if (bCut) commit 25ebd193de97880ecca23afb473f0439dc3fb0ac Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Tue Jan 30 14:54:18 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Feb 8 20:51:29 2024 +0100 lok: calc: missing update of sheet geometry data on undo a drag and drop When undo/redo a drag and drop of a block of cells sheet geometry data was not invalidated. Change-Id: I0579de814ed61357c70a64d0e4ebf862525d3c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162776 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163034 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 08f9958ebb59..7313337af681 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1351,6 +1351,12 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) pDocShell->UpdatePaintExt(mnPaintExtFlags, aPaintRange); maPaintRanges.Join(aPaintRange); + + ScTabViewShell::notifyAllViewsSheetGeomInvalidation( + ScTabViewShell::GetActiveViewShell(), + true /* bColumns */, true /* bRows */, + true /* bSizes */, true /* bHidden */, true /* bFiltered */, + true /* bGroups */, aPaintRange.aStart.Tab()); } void ScUndoDragDrop::Undo() @@ -1498,6 +1504,24 @@ void ScUndoDragDrop::Redo() EndRedo(); SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) ); + + if (comphelper::LibreOfficeKit::isActive()) + { + SCTAB nStartTab = aDestRange.aStart.Tab(); + SCTAB nEndTab = aDestRange.aEnd.Tab(); + if (bCut) + { + nStartTab = std::min(nStartTab, aSrcRange.aStart.Tab()); + nEndTab = std::max(nEndTab, aSrcRange.aEnd.Tab()); + } + for (nTab = nStartTab; nTab <= nEndTab; ++nTab) + { + ScTabViewShell::notifyAllViewsSheetGeomInvalidation( + ScTabViewShell::GetActiveViewShell(), true /* bColumns */, true /* bRows */, + true /* bSizes */, true /* bHidden */, true /* bFiltered */, true /* bGroups */, + nTab); + } + } } void ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */)