sc/source/core/data/table1.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
New commits: commit 6a2bb433a0367f91ac7e4867d3988a77db4b7ad6 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Tue May 21 05:56:18 2024 +0300 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Tue May 21 18:02:03 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit bb605f31f92eeeca292824931ef0e8d1db750702) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167829 Reviewed-by: Pranam Lashkari <lpra...@collabora.com> diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 9064c5241acf..a2a577bf4e60 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -48,6 +48,7 @@ #include <refupdatecontext.hxx> #include <rowheightcontext.hxx> #include <compressedarray.hxx> +#include <tabvwsh.hxx> #include <vcl/svapp.hxx> #include <formula/vectortoken.hxx> @@ -487,6 +488,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; } @@ -508,10 +521,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 )