summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-07-03 19:22:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-07-04 13:59:15 +0200
commit59ec1c43222bfb6188f932f6ff458bafb657b21d (patch)
tree678d251d3e0be3b4e137fde3d0c323ddadc44d09 /editeng
parent3da1d8a791cff6cf2dad29b64c9ad15b1a65d5b3 (diff)
make SvxColorItem hashable
Change-Id: Ic96d53c113cd6ae5b805df5a8e80d4da7adfec59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169966 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/textitem.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index ab2090c74e64..664c5db802ad 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1468,6 +1468,16 @@ SvxColorItem::~SvxColorItem()
{
}
+bool SvxColorItem::isHashable() const { return true; }
+
+size_t SvxColorItem::hashCode() const
+{
+ std::size_t seed(0);
+ o3tl::hash_combine(seed, static_cast<sal_Int32>(mColor));
+ o3tl::hash_combine(seed, maComplexColor);
+ return seed;
+}
+
bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
@@ -1556,6 +1566,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
{