summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-04-29 05:20:47 +0900
committerEike Rathke <erack@redhat.com>2018-05-04 21:30:43 +0200
commit5103c6a405e93bb05018ab7c89e7e9446c740aaa (patch)
tree98b3b1705cfcd0eeb867cff94e8766f1978c287f /include
parent7b0ff01d1bf718c5b439b5cddfcdfe051271b28c (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.hxx2
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) {}