summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/inc/tabview.hxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx12
-rw-r--r--sc/source/ui/view/tabview3.cxx33
4 files changed, 24 insertions, 25 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index d825eca1f1d8..9c6a2138e6d7 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -632,6 +632,8 @@ public:
SCROW GetLOKEndHeaderRow() const { return mnLOKEndHeaderRow; }
SCCOL GetLOKStartHeaderCol() const { return mnLOKStartHeaderCol; }
SCCOL GetLOKEndHeaderCol() const { return mnLOKEndHeaderCol; }
+
+ void SyncGridWindowMapModeFromDrawMapMode();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index da265c97a1b0..f1599ed413d5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1061,6 +1061,8 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int
return;
pViewData->SetZoom(newZoomX, newZoomY, true);
+ if (ScTabViewShell* pViewShell = pViewData->GetViewShell())
+ pViewShell->SyncGridWindowMapModeFromDrawMapMode();
// refresh our view's take on other view's cursors & selections
pViewData->GetActiveWin()->updateKitOtherCursors();
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<ScGridWindow> & 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<ScGridWindow> & 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<ScGridWindow> & p : pGridWin)
- if (p)
- p->SetMapMode( p->GetDrawMapMode() );
+ SyncGridWindowMapModeFromDrawMapMode();
SetNewVisArea();
RepeatResize(bUpdateFix);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 4a78aa38e710..444b78b20b64 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2052,11 +2052,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa
// Form Layer must know the visible area of the new sheet
// that is why MapMode must already be correct here
- for (VclPtr<ScGridWindow> & pWin : pGridWin)
- {
- if (pWin)
- pWin->SetMapMode(pWin->GetDrawMapMode());
- }
+ SyncGridWindowMapModeFromDrawMapMode();
SetNewVisArea();
PaintGrid();
@@ -3100,6 +3096,20 @@ void ScTabView::UpdateInputLine()
SC_MOD()->InputEnterHandler();
}
+void ScTabView::SyncGridWindowMapModeFromDrawMapMode()
+{
+ // AW: Discussed with NN if there is a reason that new map mode was only set for one window,
+ // but is not. Setting only on one window causes the first repaint to have the old mapMode
+ // in three of four views, so the overlay will save the wrong content e.g. when zooming out.
+ // Changing to setting map mode at all windows.
+ for (VclPtr<ScGridWindow> & pWin : pGridWin)
+ {
+ if (!pWin)
+ continue;
+ pWin->SetMapMode(pWin->GetDrawMapMode());
+ }
+}
+
void ScTabView::ZoomChanged()
{
ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
@@ -3110,18 +3120,9 @@ void ScTabView::ZoomChanged()
UpdateScrollBars();
- // VisArea...
- // AW: Discussed with NN if there is a reason that new map mode was only set for one window,
- // but is not. Setting only on one window causes the first repaint to have the old mapMode
- // in three of four views, so the overlay will save the wrong content e.g. when zooming out.
- // Changing to setting map mode at all windows.
-
- for (sal_uInt32 i = 0; i < 4; i++)
- {
- if (pGridWin[i])
- pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
- }
+ SyncGridWindowMapModeFromDrawMapMode();
+ // VisArea...
SetNewVisArea();
InterpretVisible(); // have everything calculated before painting