Refactor comparison operators for DateTime and Time classes

Change-Id: Ia59373da6717c8705c96eecb0f1dc0016cd2dcd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181068
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mohamed Ali
2025-02-23 09:22:18 +01:00
committed by Mike Kaganski
parent ddc09464d3
commit f4bd60261e
2 changed files with 2 additions and 5 deletions
+2 -3
View File
@@ -71,9 +71,8 @@ public:
auto operator <=>( const DateTime& rDateTime ) const
{
if (auto cmp = Date::operator<=>(rDateTime); cmp != 0)
return cmp;
return tools::Time::operator<=>(rDateTime);
return std::make_pair(GetDate(), GetTime()) <=>
std::make_pair(rDateTime.GetDate(), rDateTime.GetTime());
}
bool operator==(const DateTime& rDateTime) const
{
-2
View File
@@ -133,8 +133,6 @@ public:
bool IsEqualIgnoreNanoSec( const tools::Time& rTime ) const;
bool operator==(const Time& rTime) const = default;
auto operator <=> ( const Time& rTime ) const = default;
static Time GetUTCOffset();