summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-07-03 19:15:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-07-04 09:19:01 +0200
commit2fcad7783d055c6222227bd1672124320eb77a2e (patch)
tree4f0fe0b070057759472e36a1778f8c734164b766 /editeng
parent6e1a55dfbdd7651b22be542f3ce048fb769e8aec (diff)
make SvxAdjustItem hashable
Change-Id: Ic5c78a0de4e7edafc0ba97bf69d43c377f7b5503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/paraitem.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 5cfedf113620..ce547ff38d63 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -347,6 +347,17 @@ SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
SetAdjust( eAdjst );
}
+bool SvxAdjustItem::isHashable() const { return true; }
+
+size_t SvxAdjustItem::hashCode() const
+{
+ std::size_t seed(0);
+ o3tl::hash_combine(seed, GetAdjust());
+ o3tl::hash_combine(seed, bOneBlock);
+ o3tl::hash_combine(seed, bLastCenter);
+ o3tl::hash_combine(seed, bLastBlock);
+ return seed;
+}
bool SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const
{
@@ -378,6 +389,7 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
bool SvxAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
{