summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 0ff929302cd6..6d0ea85cbc40 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -96,12 +96,14 @@ namespace {
void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
{
- if( rxProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
- {
- double fPosition = static_cast< double >( nRow - rUsedArea.StartRow + 1 ) / (rUsedArea.EndRow - rUsedArea.StartRow + 1);
- if( rxProgressBar->getPosition() < fPosition )
- rxProgressBar->setPosition( fPosition );
- }
+ if (!rxProgressBar || nRow < rUsedArea.StartRow || rUsedArea.EndRow < nRow)
+ return;
+
+ double fCurPos = rxProgressBar->getPosition();
+ double fNewPos = static_cast<double>(nRow - rUsedArea.StartRow + 1.0) / (rUsedArea.EndRow - rUsedArea.StartRow + 1.0);
+ if (fCurPos < fNewPos && (fNewPos - fCurPos) > 0.3)
+ // Try not to re-draw progress bar too frequently.
+ rxProgressBar->setPosition(fNewPos);
}
void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, double fPosition )