Kaydet (Commit) 3842967e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Ensure progress bar LibreOfficeKit callbacks don't repeat the same percentage

Gets rid of superfluous sequential callbacks with the same percentage when
loading large documents.

This reverts commit cec72eff.

Change-Id: I70f43f7e3a650c76cbcbbc60ebb2d47efaca06a5
üst 66f866d2
......@@ -69,6 +69,8 @@ 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:
......
......@@ -38,6 +38,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText ,
if (comphelper::LibreOfficeKit::isActive())
{
m_nRange = nRange;
m_nLastCallbackPercent = -1;
comphelper::LibreOfficeKit::statusIndicatorStart();
return;
......@@ -102,7 +103,11 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
if (comphelper::LibreOfficeKit::isActive())
{
int nPercent = (100*nValue)/m_nRange;
comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent);
if (nPercent != m_nLastCallbackPercent)
{
comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent);
m_nLastCallbackPercent = nPercent;
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment