[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 28 10:50:00 UTC 2018


 sc/source/core/tool/interpr2.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 98cb91686901dc0133c5c23dc5658d9623dbd436
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue Aug 28 11:41:37 2018 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Aug 28 12:49:39 2018 +0200

    Shortcut small negative values to 0:0:0, tdf#119533 tdf#118800 follow-up
    
    ... instead of letting them end up as 24:0:0
    
    Change-Id: I0212a2b422a931a24fd2748aa2826a5b60d2a397
    Reviewed-on: https://gerrit.libreoffice.org/59699
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index a50f4ea9aa9c..92bd4ebd1aae 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -152,7 +152,10 @@ static void lcl_getHourMinuteSecond( double fTimeInDays, sal_Int32& nHour, sal_I
     // If < 0 then approxFloor() effectively returned the ceiling (note this
     // also holds for negative fTimeInDays values) because of a near identical
     // value, shortcut this to a full day as well.
-    if (fTime <= 0.0)
+    // If >= 1.0 (actually == 1.0) then fTimeInDays is a negative small value
+    // not significant for a representable time and approxFloor() returned -1,
+    // shortcut to 0:0:0, otherwise it would become 24:0:0.
+    if (fTime <= 0.0 || fTime >= 1.0)
     {
         nHour = nMinute = nSecond = 0;
         return;


More information about the Libreoffice-commits mailing list