1 diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx
2 index 288378b..d46dba2 100644
3 --- sc/source/core/data/table1.cxx
4 +++ sc/source/core/data/table1.cxx
5 @@ -324,12 +324,21 @@ BOOL ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra,
7 SCSIZE nCount = static_cast<SCSIZE>(nEndRow-nStartRow+1);
9 + ULONG nTotalCount = GetWeightedCount();
10 ScProgress* pProgress = NULL;
11 - if ( pOuterProgress )
12 - pProgress = pOuterProgress;
13 - else if ( nCount > 1 )
14 - pProgress = new ScProgress( pDocument->GetDocumentShell(),
15 - ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), GetWeightedCount() );
16 + if (nTotalCount >= 1000)
18 + // if the total number of rows is less than 1000, don't even bother
19 + // with the progress bar because drawing progress bar can be very
20 + // expensive especially in GTK.
22 + if ( pOuterProgress )
23 + pProgress = pOuterProgress;
24 + else if ( nCount > 1 )
25 + pProgress = new ScProgress(
26 + pDocument->GetDocumentShell(),
27 + ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nTotalCount );
30 USHORT* pHeight = new USHORT[nCount]; // Twips !
31 memset( pHeight, 0, sizeof(USHORT) * nCount );