[ooo-build-commit] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Sep 28 12:01:52 PDT 2010


 sc/source/core/data/table1.cxx |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 8767fd0a8dbf79c7d4257f45f1be9227fd24abe7
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Sep 28 15:00:21 2010 -0400

    Ported calc-perf-rowheight-no-progress-bar.diff from ooo-build.

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index b6788eb..e2c9701 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -292,12 +292,21 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra,
     BOOL    bChanged = FALSE;
     SCSIZE  nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
 
+    ULONG nTotalCount = GetWeightedCount();
     ScProgress* pProgress = NULL;
-    if ( pOuterProgress )
-        pProgress = pOuterProgress;
-    else if ( nCount > 1 )
-        pProgress = new ScProgress( pDocument->GetDocumentShell(),
-                            ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), GetWeightedCount() );
+    if (nTotalCount >= 1000)
+    {
+        // if the total number of rows is less than 1000, don't even bother
+        // with the progress bar because drawing progress bar can be very
+        // expensive especially in GTK.
+
+        if ( pOuterProgress )
+            pProgress = pOuterProgress;
+        else if ( nCount > 1 )
+            pProgress = new ScProgress(
+                pDocument->GetDocumentShell(),
+                ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nTotalCount );
+    }
 
     USHORT* pHeight = new USHORT[nCount];                   // Twips !
     memset( pHeight, 0, sizeof(USHORT) * nCount );


More information about the ooo-build-commit mailing list