[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/source
Michael Stahl
mstahl at redhat.com
Mon Feb 2 11:20:24 PST 2015
sw/source/core/fields/docufld.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit c361a3a9b89cd24693823b86efdde81dab1f10be
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 2 16:53:45 2015 +0100
tdf#88899: sw: fix expanding of SwDocInfoField with DateTime
The lcl_TimeToDouble function produced very small numbers that round to
zero.
(regression from 9830fd36dbdb72c79703b0c61efc027fba793c5a)
Change-Id: I091da9c2a913fae0c2bbf229942db3c1bd3598f4
Reviewed-on: https://gerrit.libreoffice.org/14282
Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
Tested-by: Lionel Elie Mamane <lionel at mamane.lu>
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 2ba6e71..5c2c6b4 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1046,7 +1046,11 @@ template<class T>
static double lcl_TimeToDouble( const T& rTime )
{
const double fNanoSecondsPerDay = 86400000000000.0;
- return ((rTime.Hours*3600000)+(rTime.Minutes*60000)+(rTime.Seconds*1000)+(rTime.NanoSeconds)) / fNanoSecondsPerDay;
+ return ( (rTime.Hours * SAL_CONST_INT64(3600000000000))
+ + (rTime.Minutes * SAL_CONST_INT64( 60000000000))
+ + (rTime.Seconds * SAL_CONST_INT64( 1000000000))
+ + (rTime.NanoSeconds))
+ / fNanoSecondsPerDay;
}
template<class D>
More information about the Libreoffice-commits
mailing list