Kaydet (Commit) e36c8a67 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#68961: Check visible range during scrolling, and re-paint if necessary.

Change-Id: I47383cc0c4cf0ec48ce621ba5acac33db44ba313
üst deb39c01
......@@ -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 );
......
......@@ -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)
......
......@@ -2109,6 +2109,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() );
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment