sc/source/core/data/table1.cxx |   27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

New commits:
commit bb605f31f92eeeca292824931ef0e8d1db750702
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Tue May 21 05:56:18 2024 +0300
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue May 21 12:25:35 2024 +0200

    sc: LOK: invalidate sheet geometry on row height changes
    
    sometimes if undo/redeo affected row heights (i.e: undo an autofill)
    sheet geometry was not updated in LOK
    
    Change-Id: I995d23752712f6baf3c348f6fe5fb292f7c9043b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167878
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 4df5d92ec5e5..b1bb083c3f0d 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -51,6 +51,7 @@
 #include <refupdatecontext.hxx>
 #include <rowheightcontext.hxx>
 #include <compressedarray.hxx>
+#include <tabvwsh.hxx>
 #include <vcl/svapp.hxx>
 
 #include <formula/vectortoken.hxx>
@@ -488,6 +489,18 @@ bool ScTable::SetOptimalHeight(
 
     mpRowHeights->enableTreeSearch(true);
 
+    if (bChanged)
+    {
+        if (ScViewData* pViewData = ScDocShell::GetViewData())
+        {
+            ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+                pViewData->GetViewShell(),
+                false /* bColsAffected */, true /* bRowsAffected */,
+                true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
+                false /* bGroups */, nTab);
+        }
+    }
+
     return bChanged;
 }
 
@@ -509,10 +522,22 @@ void ScTable::SetOptimalHeightOnly(
 
     SetRowHeightOnlyFunc aFunc(this);
 
-    SetOptimalHeightsToRows(rCxt, aFunc, pRowFlags.get(), nStartRow, nEndRow, 
true);
+    bool bChanged = SetOptimalHeightsToRows(rCxt, aFunc, pRowFlags.get(), 
nStartRow, nEndRow, true);
 
     if ( pProgress != pOuterProgress )
         delete pProgress;
+
+    if (bChanged)
+    {
+        if (ScViewData* pViewData = ScDocShell::GetViewData())
+        {
+            ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
+                pViewData->GetViewShell(),
+                false /* bColsAffected */, true /* bRowsAffected */,
+                true /* bSizes*/, false /* bHidden */, false /* bFiltered */,
+                false /* bGroups */, nTab);
+        }
+    }
 }
 
 bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const

Reply via email to