diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-05-06 16:32:58 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-05-06 17:55:58 +0300 |
commit | cec72eff99d1d683f2236c8a86a2814b34ad861e (patch) | |
tree | e1c4e536c8901ef1522e43cba6640696f0b9c551 | |
parent | 951c986d79c4674bcd9e63e81d9dded7d2c1a2fa (diff) |
Don't bother ensuring progress bar LibreOfficeKit callbacks are monotonical
It can well be that the StatusIndicator code is called for multiple
independent sections while loading some document format, and that the first
progress is not the one that actually takes much time at all, so following
just the progress of that would be misleading, the progress would be "stuck"
at the highest value set by the first progress (forever, if it has gone up to
100%).
For example, when loading the odk/examples/java/DocumentHandling/
test/test1.odt sample document, the code first calls the StatusIndicator while
parsing the styles.xml, going from 0% to 100%. But the styles.xml is typically
rather small. Then the code calls the StatusIndicator *again* while parsing
the much more relevant concent.xml. For that particular document, this time
the progress goes from 0% to 27% only, for some reason. Oh well, GIGO.
Change-Id: I87bfc586a53efcbeb94924f21dd365ca63da88d7
-rw-r--r-- | framework/inc/helper/statusindicator.hxx | 2 | ||||
-rw-r--r-- | framework/source/helper/statusindicator.cxx | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/framework/inc/helper/statusindicator.hxx b/framework/inc/helper/statusindicator.hxx index 6043cf2a2071..d52216eccde5 100644 --- a/framework/inc/helper/statusindicator.hxx +++ b/framework/inc/helper/statusindicator.hxx @@ -69,8 +69,6 @@ class StatusIndicator : public ::cppu::WeakImplHelper1< css::task::XStatusIndic css::uno::WeakReference< css::task::XStatusIndicatorFactory > m_xFactory; sal_Int32 m_nRange; - // We want the callback percentages to increase monotonically - int m_nLastCallbackPercent; // c++ interface public: diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx index 1b76a1e2f2b3..88c247e9a312 100644 --- a/framework/source/helper/statusindicator.cxx +++ b/framework/source/helper/statusindicator.cxx @@ -38,7 +38,6 @@ void SAL_CALL StatusIndicator::start(const OUString& sText , if (comphelper::LibreOfficeKit::isActive()) { m_nRange = nRange; - m_nLastCallbackPercent = -1; comphelper::LibreOfficeKit::statusIndicatorStart(); return; @@ -103,11 +102,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue) if (comphelper::LibreOfficeKit::isActive()) { int nPercent = (100*nValue)/m_nRange; - if (nPercent > m_nLastCallbackPercent) - { - comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent); - m_nLastCallbackPercent = nPercent; - } + comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent); return; } |