diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-07-01 16:20:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-03 08:42:15 +0200 |
commit | 1fe0dc7377300ad961438f5a69bd8bc023cc314d (patch) | |
tree | 7a7d740747bd5b87d3c5ead7dd96d79d4a470bd2 /include/tools | |
parent | f5b0cc2a3690ba963b3f150886e1d5ddddee9530 (diff) |
use sal_Int64 in tools::DateTime
instead of long which has platform-dependent bitlength
Change-Id: I888458d7807027e237772940d4b2cc15c2971243
Reviewed-on: https://gerrit.libreoffice.org/39434
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/datetime.hxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx index d8588518bc94..4a7f70c29ea1 100644 --- a/include/tools/datetime.hxx +++ b/include/tools/datetime.hxx @@ -75,14 +75,14 @@ public: bool operator >=( const DateTime& rDateTime ) const; bool operator <=( const DateTime& rDateTime ) const; - long GetSecFromDateTime( const Date& rDate ) const; + sal_Int64 GetSecFromDateTime( const Date& rDate ) const; void ConvertToUTC() { *this -= Time::GetUTCOffset(); } void ConvertToLocalTime() { *this += Time::GetUTCOffset(); } - DateTime& operator +=( long nDays ) + DateTime& operator +=( sal_Int32 nDays ) { Date::operator+=( nDays ); return *this; } - DateTime& operator -=( long nDays ) + DateTime& operator -=( sal_Int32 nDays ) { Date::operator-=( nDays ); return *this; } DateTime& operator +=( double fTimeInDays ); DateTime& operator -=( double fTimeInDays ) @@ -90,15 +90,15 @@ public: 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, sal_Int32 nDays ); + TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, sal_Int32 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 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 ) + TOOLS_DLLPUBLIC friend sal_Int64 operator -( const DateTime& rDateTime, const Date& rDate ) { return static_cast<const Date&>(rDateTime) - rDate; } DateTime& operator =( const DateTime& rDateTime ); |