From d8af51f9c521dca999c22a025e625f09002907b6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 17 Jan 2024 21:09:41 +0000 Subject: calc doc with saved zoom in settings causes disjoint invalidations... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in multiple views, while the invalidations rectangles should be reported at the same place from each view. on load, ScTabView::SetZoom gets called with the zoom stored in the document settings, which both calls sets Zoom on the ViewData, and then calls ZoomChanged, which syncs the GridWindows MapMode from the ViewData derived GetDrawMapMode(). Later lok sets zoom via setClientArea which leaves the GridWindows MapMode untouched and out of sync with the newly changed ViewData MapMode. Typically then, on e.g. on deleting text in one view then ScViewFunc::DeleteContents or similar is called which calls ScTabView::UpdateCopySourceOverlay which calls ScGridWindow::UpdateCopySourceOverlay and that sets the GridWindow MapMode to the DrawMapMode but then *for lokit* returns early (among a few other unlikely early return cases) while every other similar func restores the orig GridWindow mode before returning. So the view which is used to make the change ends up with GridWindows synced to the ViewData MapMode, which looks like accident. While the other view remains with GridWindows with MapModes unsynced with that views ViewData MapMode. So on invalidate, the view that was used to make the change has GridWindows with MapModes that report the correct rectangle, while the other unsynced view will report an incorrect rectangle, until something happens in that view to get it to exec UpdateCopySourceOverlay and get synced. Here add the sync to ScModelObj::setClientZoom so the two MapModes remain synced once that is called. Change-Id: I2da59f50ae2b0e3ea6b7ef8b54debdab1ee98266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162312 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162322 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 7edfb1b85cef5e5435cd2bf46e1b91b68f1e6427) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162482 --- sc/source/ui/view/tabview.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sc/source/ui/view/tabview.cxx') diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 71a37ddce9da..1bf2b710ba01 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1719,9 +1719,7 @@ void ScTabView::DoHSplit(tools::Long nSplitPos) // Form Layer needs to know the visible part of all windows // that is why MapMode must already be correct here - for (VclPtr & pWin : pGridWin) - if (pWin) - pWin->SetMapMode( pWin->GetDrawMapMode() ); + SyncGridWindowMapModeFromDrawMapMode(); SetNewVisArea(); PaintGrid(); @@ -1791,9 +1789,7 @@ void ScTabView::DoVSplit(tools::Long nSplitPos) // Form Layer needs to know the visible part of all windows // that is why MapMode must already be correct here - for (VclPtr & pWin : pGridWin) - if (pWin) - pWin->SetMapMode( pWin->GetDrawMapMode() ); + SyncGridWindowMapModeFromDrawMapMode(); SetNewVisArea(); PaintGrid(); @@ -2211,9 +2207,7 @@ void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod, SCCOLRO // Form Layer needs to know the visible part of all windows // that is why MapMode must already be correct here - for (VclPtr & p : pGridWin) - if (p) - p->SetMapMode( p->GetDrawMapMode() ); + SyncGridWindowMapModeFromDrawMapMode(); SetNewVisArea(); RepeatResize(bUpdateFix); -- cgit