diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-08 11:33:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-08 15:32:33 +0200 |
commit | d05a451fcd8c985e860813183de0ec4dfdea0e02 (patch) | |
tree | 8022deaaf7d8cd55f67bf1fcc0a23d1056121c0c /svx/source | |
parent | 6d3dd30b535f7283b8f1d8a577986b47ef5528ce (diff) |
make SvxDoubleItem hashable
Change-Id: Ia52a4ce4bd9390872a89bdea0182de697e209180
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170148
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/items/chrtitem.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx index 7001c37c30a9..253d4f259aec 100644 --- a/svx/source/items/chrtitem.cxx +++ b/svx/source/items/chrtitem.cxx @@ -21,7 +21,7 @@ #include <unotools/intlwrapper.hxx> #include <unotools/localedatawrapper.hxx> #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> - +#include <o3tl/hash_combine.hxx> #include <svx/chrtitem.hxx> using namespace ::com::sun::star; @@ -120,6 +120,18 @@ bool SvxDoubleItem::GetPresentation return true; } +bool SvxDoubleItem::isHashable() const +{ + return true; +} + +size_t SvxDoubleItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, fVal); + return seed; +} + bool SvxDoubleItem::operator == (const SfxPoolItem& rItem) const { assert(SfxPoolItem::operator==(rItem)); @@ -139,6 +151,7 @@ bool SvxDoubleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const bool SvxDoubleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; return rVal >>= fVal; } |