diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/ProgressBarHelper.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xmloff/source/core/ProgressBarHelper.cxx b/xmloff/source/core/ProgressBarHelper.cxx index ef7292f0fd7e..09f12d699850 100644 --- a/xmloff/source/core/ProgressBarHelper.cxx +++ b/xmloff/source/core/ProgressBarHelper.cxx @@ -25,6 +25,7 @@ using namespace ::com::sun::star; static const sal_Int32 nDefaultProgressBarRange = 1000000; +static const float fProgressStep = 0.5; ProgressBarHelper::ProgressBarHelper(const css::uno::Reference < css::task::XStatusIndicator>& xTempStatusIndicator, const bool bTempStrict) @@ -32,6 +33,7 @@ ProgressBarHelper::ProgressBarHelper(const css::uno::Reference < css::task::XSta , nRange(nDefaultProgressBarRange) , nReference(100) , nValue(0) +, fOldPercent(0.0) , bStrict(bTempStrict) , bRepeat(true) #ifdef DBG_UTIL @@ -86,9 +88,12 @@ void ProgressBarHelper::SetValue(sal_Int32 nTempValue) double fValue(nValue); double fNewValue ((fValue * nRange) / nReference); - xStatusIndicator->setValue((sal_Int32)fNewValue); - - // #95181# disabled, because we want to call setValue very often to enable a good reschedule + double fPercent((fNewValue * 100) / nRange); + if (fPercent >= (fOldPercent + fProgressStep) || fPercent < fOldPercent) + { + xStatusIndicator->setValue((sal_Int32)fNewValue); + fOldPercent = fPercent; + } } #ifdef DBG_UTIL else if (!bFailure) |