diff options
-rw-r--r-- | include/tools/globname.hxx | 11 | ||||
-rw-r--r-- | tools/source/ref/globname.cxx | 21 |
2 files changed, 6 insertions, 26 deletions
diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx index d72b6bf1ab51..7812a83f5735 100644 --- a/include/tools/globname.hxx +++ b/include/tools/globname.hxx @@ -22,12 +22,16 @@ #include <tools/toolsdllapi.h> #include <com/sun/star/uno/Sequence.hxx> +#include <compare> + struct SAL_WARN_UNUSED SvGUID { sal_uInt32 Data1; sal_uInt16 Data2; sal_uInt16 Data3; sal_uInt8 Data4[8]; + friend constexpr auto operator<=>(const SvGUID&, const SvGUID&) = default; + friend constexpr bool operator==(const SvGUID&, const SvGUID&) = default; }; class SvStream; @@ -52,11 +56,8 @@ public: TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName & ); TOOLS_DLLPUBLIC friend SvStream & WriteSvGlobalName( SvStream &, const SvGlobalName & ); - bool operator < ( const SvGlobalName & rObj ) const; - - bool operator == ( const SvGlobalName & rObj ) const; - bool operator != ( const SvGlobalName & rObj ) const - { return !(*this == rObj); } + friend constexpr auto operator<=>(const SvGlobalName&, const SvGlobalName&) = default; + friend constexpr bool operator==(const SvGlobalName&, const SvGlobalName&) = default; void MakeFromMemory( void const * pData ); bool MakeId( std::u16string_view rId ); diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index e5cee830df22..4ae220659e3c 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -59,27 +59,6 @@ SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj ) return rStr; } - -bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const -{ - if( m_aData.Data3 < rObj.m_aData.Data3 ) - return true; - else if( m_aData.Data3 > rObj.m_aData.Data3 ) - return false; - - if( m_aData.Data2 < rObj.m_aData.Data2 ) - return true; - else if( m_aData.Data2 > rObj.m_aData.Data2 ) - return false; - - return m_aData.Data1 < rObj.m_aData.Data1; -} - -bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const -{ - return memcmp(&m_aData, &rObj.m_aData, sizeof(m_aData)) == 0; -} - void SvGlobalName::MakeFromMemory( void const * pData ) { memcpy( &m_aData, pData, sizeof( m_aData ) ); |