Kaydet (Commit) 98cb9168 authored tarafından Eike Rathke's avatar Eike Rathke

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/59699Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst b88da9b4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment