diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2018-04-29 05:20:47 +0900 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-05-04 21:30:43 +0200 |
commit | 5103c6a405e93bb05018ab7c89e7e9446c740aaa (patch) | |
tree | 98b3b1705cfcd0eeb867cff94e8766f1978c287f /include | |
parent | 7b0ff01d1bf718c5b439b5cddfcdfe051271b28c (diff) |
tools: Avoid looking up system clock twice to get DateTime
DateTime::DateTime(DateTimeInitSystem) had initialized Date and
Time separately, which causes a slight possibility that it could
get a wrong datetime with almost 24 hours delay when it went beyond
midnight. E.g., the date part was of the previous day while the
time part was 00:00:00.xxx of the next day.
This also reduces duplicate code by sharing GetSystemDateTime().
Change-Id: I352d90f468f5cbc70e7936a337bed97365baa06c
Reviewed-on: https://gerrit.libreoffice.org/53612
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/tools/datetime.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx index 02729e6a0e1a..7b78b29bdfc5 100644 --- a/include/tools/datetime.hxx +++ b/include/tools/datetime.hxx @@ -40,7 +40,7 @@ public: }; explicit DateTime( DateTimeInitEmpty ) : Date( Date::EMPTY ), Time( Time::EMPTY ) {} - explicit DateTime( DateTimeInitSystem ) : Date( Date::SYSTEM ), Time( Time::SYSTEM ) {} + explicit DateTime( DateTimeInitSystem ); DateTime( const DateTime& rDateTime ) : Date( rDateTime ), Time( rDateTime ) {} DateTime( const Date& rDate ) : Date( rDate ), Time(0) {} |