sc/inc/address.hxx                |   10 ++++++++--
 sc/source/filter/inc/namebuff.hxx |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 09a48f45d9a3e72ab761e6808701362c9c0b2e51
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Aug 26 22:00:38 2025 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Aug 27 16:52:19 2025 +0200

    sc: use std::hash templ. specialisation for ScAddress
    
    No need to explicitly set a hash function to the map with this,
    so it simplifies the code.
    
    Change-Id: I4c722689fa8076ed6297f1bc5533192fd7c76358
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190257
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    Tested-by: Jenkins

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 61d895c443c2..62d6fc5ac131 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -463,14 +463,20 @@ inline std::basic_ostream<charT, traits> & operator 
<<(std::basic_ostream<charT,
     return stream;
 }
 
-struct ScAddressHashFunctor
+namespace std
 {
-    size_t operator()( const ScAddress & rAddress ) const
+
+template <>
+struct hash<ScAddress>
+{
+    std::size_t operator()(ScAddress const & rAddress) const
     {
         return rAddress.hash();
     }
 };
 
+} // end namespace std
+
 [[nodiscard]] constexpr bool ValidAddress(const ScAddress& rAddress, SCCOL 
nMaxCol, SCROW nMaxRow)
 {
     return ValidCol(rAddress.Col(), nMaxCol) && ValidRow(rAddress.Row(), 
nMaxRow) && ValidTab(rAddress.Tab());
diff --git a/sc/source/filter/inc/namebuff.hxx 
b/sc/source/filter/inc/namebuff.hxx
index bd98a8ab144d..c56f6174c5d0 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -59,7 +59,7 @@ inline bool StringHashEntry::operator ==( const 
StringHashEntry& r ) const
  */
 class SharedFormulaBuffer : public ExcRoot
 {
-    typedef std::unordered_map<ScAddress, ScTokenArray, ScAddressHashFunctor> 
TokenArraysType;
+    typedef std::unordered_map<ScAddress, ScTokenArray> TokenArraysType;
     TokenArraysType maTokenArrays;
 
 public:

Reply via email to