summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-07-21 13:32:10 +0200
committerEike Rathke <erack@redhat.com>2017-07-21 19:26:43 +0200
commit252aab1b9dc1dbeace3087929a52e1248f043839 (patch)
tree2890b163a00aaed11c53bfb68c8dbd16325812a7 /include
parentec340697d682bd7d0a361c8c701e513329c032bd (diff)
Eliminate DateTime::operator+=() and -=() with POD types
And make some tools::Time conversion ctors explicit to catch more oddities like automatic conversion from sal_Int64 that might be unintentional. Change-Id: If275297d86d6657544c056a712b862523e310e44 Reviewed-on: https://gerrit.libreoffice.org/40275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/datetime.hxx8
-rw-r--r--include/tools/time.hxx8
2 files changed, 5 insertions, 11 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 8d224dd73633..fd48e2314c27 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -80,13 +80,7 @@ public:
void ConvertToUTC() { *this -= Time::GetUTCOffset(); }
void ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
- DateTime& operator +=( sal_Int32 nDays )
- { AddDays( nDays ); return *this; }
- DateTime& operator -=( sal_Int32 nDays )
- { AddDays( -nDays ); return *this; }
- DateTime& operator +=( double fTimeInDays );
- DateTime& operator -=( double fTimeInDays )
- { return operator+=( -fTimeInDays ); }
+ void AddTime( double fTimeInDays );
DateTime& operator +=( const tools::Time& rTime );
DateTime& operator -=( const tools::Time& rTime );
diff --git a/include/tools/time.hxx b/include/tools/time.hxx
index 12f1e909c8ec..d8b4e6d06fc6 100644
--- a/include/tools/time.hxx
+++ b/include/tools/time.hxx
@@ -64,13 +64,13 @@ public:
static const sal_Int64 nanoPerMilli = 1000000;
static const sal_Int64 nanoPerCenti = 10000000;
- Time( TimeInitEmpty )
+ explicit Time( TimeInitEmpty )
{ nTime = 0; }
- Time( TimeInitSystem );
- Time( sal_Int64 _nTime ) { Time::nTime = _nTime; }
+ explicit Time( TimeInitSystem );
+ explicit Time( sal_Int64 _nTime ) { Time::nTime = _nTime; }
Time( const tools::Time& rTime );
Time( const css::util::Time& rTime );
- Time( const css::util::DateTime& rDateTime );
+ explicit Time( const css::util::DateTime& rDateTime );
Time( sal_uInt32 nHour, sal_uInt32 nMin,
sal_uInt32 nSec = 0, sal_uInt64 nNanoSec = 0 );