summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-02-02 16:53:45 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2015-02-02 20:18:17 +0100
commit96ab5f4994321c75f0fac05c5100dd09d7394a86 (patch)
tree25e00b7dd8296eebae5d7e3c90e5b3624d07cb5b
parentfd2fb1b5478d6c636434cfa4e1af347244561d49 (diff)
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@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
-rw-r--r--sw/source/core/fields/docufld.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index ec0f4e2bcad6..8d78e928f270 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1035,7 +1035,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>