57d3fbb
From 52ac64848e41c6c3bba86c98361757aaf89ef3c6 Mon Sep 17 00:00:00 2001
57d3fbb
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
57d3fbb
Date: Tue, 15 Jul 2014 16:42:42 +0100
57d3fbb
Subject: [PATCH] scrolling very slow in calc
57d3fbb
57d3fbb
even on a short spreadsheet scrolling up and down leaves
57d3fbb
the first/last row (depending on the direction of scroll)
57d3fbb
unchanged until the scrolling stops.
57d3fbb
57d3fbb
http://people.freedesktop.org/~mst/calc_4.2_scrolling.webm
57d3fbb
57d3fbb
On larger document there are rendering artifacts during scrolling which go away
57d3fbb
after scrolling for me and mstahl, but a bunch of people can show us piles of
57d3fbb
horribly broken spreadsheets after scrolling, esp wheel scrolling
57d3fbb
57d3fbb
Revert "fdo#75026: Sometimes we need to update grid view...
57d3fbb
57d3fbb
while not being active."
57d3fbb
57d3fbb
This reverts commit 52cc88d6191ba0c4b6477e5c4b9c5d0f0228030d.
57d3fbb
57d3fbb
Revert "fdo#68961: Check visible range during scrolling, and re-paint if necessary."
57d3fbb
57d3fbb
This reverts commit e36c8a674845ab19577fc06d44b780549757e1e7.
57d3fbb
57d3fbb
Revert "Repaint grid view when the visible area changes."
57d3fbb
57d3fbb
This reverts commit b54c1a53b4d400b1c2d282c186af1fa8f151894e.
57d3fbb
57d3fbb
Conflicts:
57d3fbb
	sc/source/ui/app/scmod.cxx
57d3fbb
57d3fbb
Revert "Update visible ranges when updating the scroll bars."
57d3fbb
57d3fbb
This reverts commit 391a57ef65687f2e373bac8d410e551aafa780ec.
57d3fbb
57d3fbb
Change-Id: Ie170308cba18a9a74c7c72daf07dfa0a4ef7bd13
57d3fbb
---
57d3fbb
 sc/source/ui/inc/tabview.hxx   |  6 ------
57d3fbb
 sc/source/ui/view/gridwin4.cxx |  2 ++
57d3fbb
 sc/source/ui/view/tabview.cxx  |  4 ----
57d3fbb
 sc/source/ui/view/tabview3.cxx | 10 ----------
57d3fbb
 sc/source/ui/view/tabview4.cxx |  7 ++++++-
57d3fbb
 5 files changed, 8 insertions(+), 21 deletions(-)
57d3fbb
57d3fbb
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
57d3fbb
index a5d7392..891af9e 100644
57d3fbb
--- a/sc/source/ui/inc/tabview.hxx
57d3fbb
+++ b/sc/source/ui/inc/tabview.hxx
57d3fbb
@@ -204,12 +204,6 @@ private:
57d3fbb
 
57d3fbb
     void            PaintRangeFinderEntry (ScRangeFindData* pData, SCTAB nTab);
57d3fbb
 
57d3fbb
-    /**
57d3fbb
-     * Check the visible grid area to see if the visible range has changed. If
57d3fbb
-     * so, update the stored visible range, and re-paint the grid area.
57d3fbb
-     */
57d3fbb
-    void UpdateGrid();
57d3fbb
-
57d3fbb
 protected:
57d3fbb
     void            UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
57d3fbb
                                         const SCROW* pPosY = NULL );
57d3fbb
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
57d3fbb
index fa697ee5..a60fb82 100644
57d3fbb
--- a/sc/source/ui/view/gridwin4.cxx
57d3fbb
+++ b/sc/source/ui/view/gridwin4.cxx
57d3fbb
@@ -390,6 +390,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
57d3fbb
 
57d3fbb
     OSL_ENSURE( ValidCol(nX2) && ValidRow(nY2), "GridWin Draw Bereich zu gross" );
57d3fbb
 
57d3fbb
+    UpdateVisibleRange();
57d3fbb
+
57d3fbb
     if (nX2 < maVisibleRange.mnCol1 || nY2 < maVisibleRange.mnRow1)
57d3fbb
         return;
57d3fbb
                     // unsichtbar
57d3fbb
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
57d3fbb
index aafd114..02b99b9 100644
57d3fbb
--- a/sc/source/ui/view/tabview.cxx
57d3fbb
+++ b/sc/source/ui/view/tabview.cxx
57d3fbb
@@ -1198,8 +1198,6 @@ void ScTabView::ScrollX( long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
57d3fbb
         if (pColOutline[eWhich]) pColOutline[eWhich]->ScrollPixel( nDiff );
57d3fbb
         if (bUpdBars)
57d3fbb
             UpdateScrollBars();
57d3fbb
-        else
57d3fbb
-            UpdateGrid();
57d3fbb
     }
57d3fbb
 
57d3fbb
     if (nDeltaX==1 || nDeltaX==-1)
57d3fbb
@@ -1285,8 +1283,6 @@ void ScTabView::ScrollY( long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
57d3fbb
         if (pRowOutline[eWhich]) pRowOutline[eWhich]->ScrollPixel( nDiff );
57d3fbb
         if (bUpdBars)
57d3fbb
             UpdateScrollBars();
57d3fbb
-        else
57d3fbb
-            UpdateGrid();
57d3fbb
     }
57d3fbb
 
57d3fbb
     if (nDeltaY==1 || nDeltaY==-1)
57d3fbb
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
57d3fbb
index 7053037..50066ba 100644
57d3fbb
--- a/sc/source/ui/view/tabview3.cxx
57d3fbb
+++ b/sc/source/ui/view/tabview3.cxx
57d3fbb
@@ -2089,16 +2089,6 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab)
57d3fbb
     }
57d3fbb
 }
57d3fbb
 
57d3fbb
-void ScTabView::UpdateGrid()
57d3fbb
-{
57d3fbb
-    if (!UpdateVisibleRange())
57d3fbb
-        // Visible range hasn't changed. No need to re-paint.
57d3fbb
-        return;
57d3fbb
-
57d3fbb
-    SC_MOD()->AnythingChanged();                // if visible area has changed
57d3fbb
-    PaintGrid();
57d3fbb
-}
57d3fbb
-
57d3fbb
 void ScTabView::PaintRangeFinder( long nNumber )
57d3fbb
 {
57d3fbb
     ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
57d3fbb
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
57d3fbb
index 2f72a20..8528431 100644
57d3fbb
--- a/sc/source/ui/view/tabview4.cxx
57d3fbb
+++ b/sc/source/ui/view/tabview4.cxx
57d3fbb
@@ -421,7 +421,12 @@ void ScTabView::UpdateScrollBars()
57d3fbb
     }
57d3fbb
 
57d3fbb
     //      set visible area for online spelling
57d3fbb
-    UpdateGrid();
57d3fbb
+
57d3fbb
+    if ( aViewData.IsActive() )
57d3fbb
+    {
57d3fbb
+        if (UpdateVisibleRange())
57d3fbb
+            SC_MOD()->AnythingChanged();                // if visible area has changed
57d3fbb
+    }
57d3fbb
 }
57d3fbb
 
57d3fbb
 #ifndef HDR_SLIDERSIZE
57d3fbb
-- 
57d3fbb
1.9.3
57d3fbb