diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-01-24 20:48:21 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2020-01-27 10:50:03 +0100 |
commit | 95725c3030161709115d04a1862550666120af31 (patch) | |
tree | d3ed0d9cdc4396404e08bc0f38e2b77a9fcba6be | |
parent | e923ef390a622e9d302d0721976e77b653992e90 (diff) |
lok: status update - avoid SIGFPE on zero range.
Change-Id: I75597696b529f833bbc699f66f5a4bcdc06748d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87367
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit c4b78d40aa43adeb90087c190d9fbee6a6d073ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87411
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | framework/source/helper/statusindicator.cxx | 11 |
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; } |