diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-03-24 10:21:11 +0530 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-03-29 09:51:28 +0200 |
commit | 066076255277261898278102b49cf91fdd3d2881 (patch) | |
tree | bdcb815eeb1113ab98fca1d6857beb931edd1a66 /sc | |
parent | 772ef157a20efd3243e6d05825a88d4cbd55b67a (diff) |
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/+/132015
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index f4ea10273b1e..6391547f23ef 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1096,6 +1096,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]; @@ -1118,11 +1123,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)) { @@ -1144,6 +1151,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() |