[ooo-build-commit] patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Sat Jun 20 09:12:16 PDT 2009


 patches/dev300/calc-perf-rowheight-no-progress-bar.diff |   29 ++++++++--------
 1 file changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 0434b86ab5ff072b84d75eaed63a46761fbc2617
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Sat Jun 20 12:09:07 2009 -0400

    Slightly better way to prevent progress bar instantiation.
    
    * patches/dev300/calc-perf-rowheight-no-progress-bar.diff:

diff --git a/patches/dev300/calc-perf-rowheight-no-progress-bar.diff b/patches/dev300/calc-perf-rowheight-no-progress-bar.diff
index c18bef1..943fdaa 100644
--- a/patches/dev300/calc-perf-rowheight-no-progress-bar.diff
+++ b/patches/dev300/calc-perf-rowheight-no-progress-bar.diff
@@ -1,27 +1,30 @@
 diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx
-index 288378b..c2ce616 100644
+index 288378b..d46dba2 100644
 --- sc/source/core/data/table1.cxx
 +++ sc/source/core/data/table1.cxx
-@@ -324,12 +324,22 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra,
+@@ -324,12 +324,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(),
+-    if ( pOuterProgress )
+-        pProgress = pOuterProgress;
+-    else if ( nCount > 1 )
+-        pProgress = new ScProgress( pDocument->GetDocumentShell(),
 -                            ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), GetWeightedCount() );
-+                            ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nTotalCount );
-+
-+    if (nTotalCount < 1000)
++    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 is very
-+        // expensive.
-+        delete pProgress;
-+        pProgress = NULL;
++        // 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 !


More information about the ooo-build-commit mailing list