sc/source/ui/undo/undoblk.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit 6ade0f41805261c9c8c7ac784f5bddb2ad47efda Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Thu Mar 24 10:21:11 2022 +0530 Commit: Dennis Francis <dennis.fran...@collabora.com> CommitDate: Thu Mar 31 07:42:25 2022 +0200 lok: paste-undo: invalidate sheetgeometry In case of copy/pasting of whole column(row) and its undo/redo may result in column(row) width(height) changes. Hence a corresponding sheet-geometry invalidation message needs to be sent to the lok client(s). Change-Id: I7aa471d9770fc21c567a3c6f5d5926df0fd5dacb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132174 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 77a7bc096860..e3b10f78bca8 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1094,6 +1094,11 @@ void ScUndoPaste::DoChange(bool bUndo) ScRangeList aDrawRanges(maBlockRanges); PaintPartFlags nPaint = PaintPartFlags::Grid; + + // For sheet geometry invalidation. + bool bColsAffected = false; + bool bRowsAffected = false; + for (size_t i = 0, n = aDrawRanges.size(); i < n; ++i) { ScRange& rDrawRange = aDrawRanges[i]; @@ -1116,11 +1121,13 @@ void ScUndoPaste::DoChange(bool bUndo) { nPaint |= PaintPartFlags::Top; rDrawRange.aEnd.SetCol(rDoc.MaxCol()); + bColsAffected = true; } if (maBlockRanges[i].aStart.Col() == 0 && maBlockRanges[i].aEnd.Col() == rDoc.MaxCol()) // whole row { nPaint |= PaintPartFlags::Left; rDrawRange.aEnd.SetRow(rDoc.MaxRow()); + bRowsAffected = true; } if (pViewShell && pViewShell->AdjustBlockHeight(false, &aData)) { @@ -1142,6 +1149,13 @@ void ScUndoPaste::DoChange(bool bUndo) pDocShell->PostDataChanged(); if (pViewShell) pViewShell->CellContentChanged(); + + if (bColsAffected || bRowsAffected) + ScTabViewShell::notifyAllViewsSheetGeomInvalidation( + pViewShell, + bColsAffected, bRowsAffected, + true /* bSizes*/, true /* bHidden */, true /* bFiltered */, + true /* bGroups */, aDrawRanges[0].aStart.Tab()); } void ScUndoPaste::Undo()