basic/source/runtime/methods.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
New commits: commit f122faeede515093cf9dc450c9b62fdaae603bef Author: Takeshi Abe <t...@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 <c...@libreoffice.org> Reviewed-by: Takeshi Abe <t...@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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits