summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r--sc/source/ui/view/gridwin.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d350da754433..335f5ad14490 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5100,6 +5100,26 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
return sal_False;
}
+void ScGridWindow::UpdateVisibleRange()
+{
+ // #163911# Update the visible range outside of paint (called when switching sheets).
+ // Use the same logic here as in ScGridWindow::Draw.
+
+ SCCOL nPosX = pViewData->GetPosX( eHWhich );
+ SCROW nPosY = pViewData->GetPosY( eVWhich );
+
+ SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
+ if (nXRight > MAXCOL) nXRight = MAXCOL;
+ SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
+ if (nYBottom > MAXROW) nYBottom = MAXROW;
+
+ // Store the current visible range.
+ maVisibleRange.mnCol1 = nPosX;
+ maVisibleRange.mnCol2 = nXRight;
+ maVisibleRange.mnRow1 = nPosY;
+ maVisibleRange.mnRow2 = nYBottom;
+}
+
// #114409#
void ScGridWindow::DrawLayerCreated()
{