diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-28 15:49:26 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-01 07:34:23 +0000 |
commit | fc04f76336fdf8c96e35382cdeb497e2f939705c (patch) | |
tree | 70c9bbd054a34a9bca9d22bb7afbb9c4349beff0 /include/tools/datetime.hxx | |
parent | eb4811590c85895ce531674596bdd6afb3397725 (diff) |
fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.
Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/tools/datetime.hxx')
-rw-r--r-- | include/tools/datetime.hxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx index c5e45ec72734..256bb7258622 100644 --- a/include/tools/datetime.hxx +++ b/include/tools/datetime.hxx @@ -23,7 +23,7 @@ #include <tools/date.hxx> #include <tools/time.hxx> -class TOOLS_DLLPUBLIC SAL_WARN_UNUSED DateTime : public Date, public Time +class TOOLS_DLLPUBLIC SAL_WARN_UNUSED DateTime : public Date, public tools::Time { public: enum DateTimeInitSystem @@ -42,8 +42,8 @@ public: DateTime( const DateTime& rDateTime ) : Date( rDateTime ), Time( rDateTime ) {} DateTime( const Date& rDate ) : Date( rDate ), Time(0) {} - DateTime( const Time& rTime ) : Date(0), Time( rTime ) {} - DateTime( const Date& rDate, const Time& rTime ) : + DateTime( const tools::Time& rTime ) : Date(0), Time( rTime ) {} + DateTime( const Date& rDate, const tools::Time& rTime ) : Date( rDate ), Time( rTime ) {} bool IsBetween( const DateTime& rFrom, @@ -79,16 +79,16 @@ public: DateTime& operator +=( double fTimeInDays ); DateTime& operator -=( double fTimeInDays ) { return operator+=( -fTimeInDays ); } - DateTime& operator +=( const Time& rTime ); - DateTime& operator -=( const Time& rTime ); + DateTime& operator +=( const tools::Time& rTime ); + DateTime& operator -=( const tools::Time& rTime ); TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, long nDays ); TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, long nDays ); TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, double fTimeInDays ); TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, double fTimeInDays ) { return operator+( rDateTime, -fTimeInDays ); } - TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, const Time& rTime ); - TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, const Time& rTime ); + TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, const tools::Time& rTime ); + TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, const tools::Time& rTime ); TOOLS_DLLPUBLIC friend double operator -( const DateTime& rDateTime1, const DateTime& rDateTime2 ); TOOLS_DLLPUBLIC friend long operator -( const DateTime& rDateTime, const Date& rDate ) { return (const Date&) rDateTime - rDate; } |