include/tools/datetime.hxx | 5 ++--- include/tools/time.hxx | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-)
New commits: commit f4bd60261e6b8c1f7aa273bf985fa597c4e6e6dd Author: Mohamed Ali <mohmedali1462...@gmail.com> AuthorDate: Mon Feb 3 18:32:35 2025 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Feb 23 09:22:18 2025 +0100 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.kagan...@collabora.com> Tested-by: Jenkins diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx index c7ae0c640a52..2480ca937f3d 100644 --- a/include/tools/datetime.hxx +++ b/include/tools/datetime.hxx @@ -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 { diff --git a/include/tools/time.hxx b/include/tools/time.hxx index b67407f2ebe7..e73e4921ac9e 100644 --- a/include/tools/time.hxx +++ b/include/tools/time.hxx @@ -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();