[Libreoffice-commits] core.git: basic/source
Takeshi Abe
tabe at fixedpoint.jp
Mon May 28 09:32:35 UTC 2018
basic/source/runtime/methods.cxx | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit f122faeede515093cf9dc450c9b62fdaae603bef
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Mon May 7 17:31:39 2018 +0900
basic: Avoid looking up system clock twice to get current datetime
Change-Id: I3de322a420bdbbd7906160b97dca531dfe3092a4
Reviewed-on: https://gerrit.libreoffice.org/53929
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 589105ff3935..960219ca81c0 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2224,13 +2224,12 @@ void SbRtl_Second(StarBASIC *, SbxArray & rPar, bool)
double Now_Impl()
{
- Date aDate( Date::SYSTEM );
- tools::Time aTime( tools::Time::SYSTEM );
- double aSerial = static_cast<double>(GetDayDiff( aDate ));
- long nSeconds = aTime.GetHour();
+ DateTime aDateTime( DateTime::SYSTEM );
+ double aSerial = static_cast<double>(GetDayDiff( aDateTime ));
+ long nSeconds = aDateTime.GetHour();
nSeconds *= 3600;
- nSeconds += aTime.GetMin() * 60;
- nSeconds += aTime.GetSec();
+ nSeconds += aDateTime.GetMin() * 60;
+ nSeconds += aDateTime.GetSec();
double nDays = static_cast<double>(nSeconds) / (24.0*3600.0);
aSerial += nDays;
return aSerial;
More information about the Libreoffice-commits
mailing list