sc/inc/address.hxx |   32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

New commits:
commit 85bf7b034f3c83f1a20fab9ac558daaf7426b9b8
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Aug 27 17:26:58 2025 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Aug 27 19:42:51 2025 +0200

    Simplify lessThanByRow using tuple
    
    Change-Id: Id97cfcc75e42401866fd54f4196c41b60b36d278
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190296
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 88a45be09f16..6907c30cbf4f 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -397,17 +397,9 @@ public:
     }
 
     /** Less than ordered by tab,row,col as needed by row-wise import/export */
-    bool lessThanByRow(const ScAddress& rAddress) const
-    {
-        if (nTab == rAddress.nTab)
-        {
-            if (nRow == rAddress.nRow)
-                return nCol < rAddress.nCol;
-            else
-                return nRow < rAddress.nRow;
-        }
-        else
-            return nTab < rAddress.nTab;
+    bool lessThanByRow(const ScAddress& rh) const
+    {
+        return std::make_tuple(nTab, nRow, nCol) < std::make_tuple(rh.nTab, 
rh.nRow, rh.nCol);
     }
 
     size_t hash() const
commit c41853a8abcc36942d3dbb3a6f28f20350c388c0
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Aug 27 17:25:48 2025 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Aug 27 19:42:45 2025 +0200

    operator == can be default
    
    Change-Id: I771de0ab98e2fa4f85fc64640ed477e96c804eac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190295
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index a5c874a09481..88a45be09f16 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -389,10 +389,7 @@ public:
     [[nodiscard]] SC_DLLPUBLIC bool Move( SCCOL nDeltaX, SCROW nDeltaY, SCTAB 
nDeltaZ,
             ScAddress& rErrorPos, const ScDocument& rDoc );
 
-    constexpr bool operator==( const ScAddress& rAddress ) const
-    {
-        return nRow == rAddress.nRow && nCol == rAddress.nCol && nTab == 
rAddress.nTab;
-    }
+    constexpr bool operator==(const ScAddress& rAddress) const = default;
 
     constexpr auto operator<=>(const ScAddress& rh) const
     {
commit 31b36c5bda4c1df519f3d0684e3e90a8d584238c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Aug 27 17:20:56 2025 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Aug 27 19:42:40 2025 +0200

    Simplify operator <=> a bit more, using tuple
    
    Change-Id: I04437a520b1dda3c8325d318d22c229686e4fc7a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190294
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 62d6fc5ac131..a5c874a09481 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -25,6 +25,7 @@
 #include <array>
 #include <limits>
 #include <ostream>
+#include <tuple>
 
 #include "scdllapi.h"
 #include "types.hxx"
@@ -393,17 +394,9 @@ public:
         return nRow == rAddress.nRow && nCol == rAddress.nCol && nTab == 
rAddress.nTab;
     }
 
-    constexpr auto operator<=>(const ScAddress& rAddress) const
+    constexpr auto operator<=>(const ScAddress& rh) const
     {
-        if (auto bTabResult = nTab <=> rAddress.nTab; bTabResult == 0)
-        {
-            if (auto bColResult = nCol <=> rAddress.nCol; bColResult == 0)
-                return nRow <=> rAddress.nRow;
-            else
-                return bColResult;
-        }
-        else
-            return bTabResult;
+        return std::make_tuple(nTab, nCol, nRow) <=> std::make_tuple(rh.nTab, 
rh.nCol, rh.nRow);
     }
 
     /** Less than ordered by tab,row,col as needed by row-wise import/export */

Reply via email to