sc/source/ui/undo/undoblk.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit e0a1bf062cfe031a8ac9eba72e09a844353629f8
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Thu Feb 1 22:45:42 2024 +0100
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Fri Feb 2 06:36:48 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>

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 2a92d87361fc..52e55973f345 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1350,6 +1350,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 */,
@@ -1505,6 +1512,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)

Reply via email to