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