sc/source/core/tool/interpr2.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 98cb91686901dc0133c5c23dc5658d9623dbd436 Author: Eike Rathke <er...@redhat.com> AuthorDate: Tue Aug 28 11:41:37 2018 +0200 Commit: Eike Rathke <er...@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 <er...@redhat.com> Tested-by: Eike Rathke <er...@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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits