[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - framework/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon May 11 11:19:00 UTC 2020


 framework/source/helper/statusindicator.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit f7fb6d11e185bf5c462457d6d977fba308cea414
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jan 24 20:48:21 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon May 11 13:18:30 2020 +0200

    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 at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93834
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

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;
     }


More information about the Libreoffice-commits mailing list