summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2023-06-20 16:05:58 +0200
committerEike Rathke <erack@redhat.com>2023-06-21 02:17:19 +0200
commit66da786bdd4588b31755058acf46034c2056215c (patch)
treeb77ec814404a56dafe572d08b00d7b7ed030921a /include/tools
parent098e8d6f111ca9d7680ed1eec00522fed6487e95 (diff)
Introduce double DateTime::Sub() as a substitute for friend double operator-()
Change-Id: Idb93b3e9b4dcbd09ad7f4253a523fe5be24d0776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153354 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/datetime.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 2194711dc208..21cb65921d27 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -102,6 +102,9 @@ public:
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 );
+ /** Same as friend operator-() to be able to disable operator-() to find
+ places where tools::Duration could be used instead. */
+ static double Sub( const DateTime& rDateTime1, const DateTime& rDateTime2 );
TOOLS_DLLPUBLIC friend sal_Int64 operator -( const DateTime& rDateTime, const Date& rDate )
{ return static_cast<const Date&>(rDateTime) - rDate; }
/** Duration can be negative, so adding it will subtract its value. */