summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-01-24 20:48:21 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-01-25 12:30:52 +0100
commit8eeac03bcafac6b2a4984ad70d0694cad01d5615 (patch)
treee437e399a060f3e64f5e1a8bb8c7f1b9517ba63e /framework
parent451eab287acd88abc19c97bd99e50cbfa4480bb4 (diff)
lok: status update - avoid SIGFPE on zero range.
Change-Id: I75597696b529f833bbc699f66f5a4bcdc06748d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87368 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/helper/statusindicator.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx
index e729702125d6..25d67694c5df 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -105,11 +105,14 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
{
if (comphelper::LibreOfficeKit::isActive())
{
- int nPercent = (100*nValue)/m_nRange;
- if (nPercent >= m_nLastCallbackPercent)
+ if (m_nRange > 0)
{
- comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent);
- m_nLastCallbackPercent = nPercent;
+ int nPercent = (100*nValue)/m_nRange;
+ if (nPercent >= m_nLastCallbackPercent)
+ {
+ comphelper::LibreOfficeKit::statusIndicatorSetValue(nPercent);
+ m_nLastCallbackPercent = nPercent;
+ }
}
return;
}