summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/tabview.hxx6
-rw-r--r--sc/source/ui/view/tabview.cxx4
-rw-r--r--sc/source/ui/view/tabview3.cxx13
-rw-r--r--sc/source/ui/view/tabview4.cxx10
4 files changed, 24 insertions, 9 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index e13d088f2804..056942575487 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -208,6 +208,12 @@ private:
void PaintRangeFinderEntry (ScRangeFindData* pData, SCTAB nTab);
+ /**
+ * Check the visible grid area to see if the visible range has changed. If
+ * so, update the stored visible range, and re-paint the grid area.
+ */
+ void UpdateGrid();
+
protected:
void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
const SCROW* pPosY = NULL );
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 1c52550dd280..219653ba5ebe 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1236,6 +1236,8 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
if (pColOutline[eWhich]) pColOutline[eWhich]->ScrollPixel( nDiff );
if (bUpdBars)
UpdateScrollBars();
+ else
+ UpdateGrid();
}
if (nDeltaX==1 || nDeltaX==-1)
@@ -1321,6 +1323,8 @@ void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
if (pRowOutline[eWhich]) pRowOutline[eWhich]->ScrollPixel( nDiff );
if (bUpdBars)
UpdateScrollBars();
+ else
+ UpdateGrid();
}
if (nDeltaY==1 || nDeltaY==-1)
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index cedb9bab0194..9553184ed7c0 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2105,6 +2105,19 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab)
}
}
+void ScTabView::UpdateGrid()
+{
+ if (!aViewData.IsActive())
+ return;
+
+ if (!UpdateVisibleRange())
+ // Visible range hasn't changed. No need to re-paint.
+ return;
+
+ SC_MOD()->AnythingChanged(); // if visible area has changed
+ PaintGrid();
+}
+
void ScTabView::PaintRangeFinder( long nNumber )
{
ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 3aa9a47efeea..ab0208129438 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -424,15 +424,7 @@ void ScTabView::UpdateScrollBars()
}
// set visible area for online spelling
-
- if ( aViewData.IsActive() )
- {
- if (UpdateVisibleRange())
- {
- SC_MOD()->AnythingChanged(); // if visible area has changed
- PaintGrid();
- }
- }
+ UpdateGrid();
}
#ifndef HDR_SLIDERSIZE