summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-23 14:17:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-23 16:45:31 +0200
commit01d183d2290668c310d592bf2e4c298ddcfb10b4 (patch)
tree12f0f2aac04c1ca23c9b4b77e124ea8a01c3d48a /editeng
parent1c4b613cda515e678a914a9bde4af3cc557532a6 (diff)
tdf#158556 make SvxBrushItem hashable
Change-Id: I82794dbf004781a86c8443b72263528167fe0359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172316 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/frmitems.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 25ac10818176..f457781e39bd 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -4255,6 +4255,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
+ ASSERT_CHANGE_REFCOUNTED_ITEM;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId)
{
@@ -4462,6 +4463,23 @@ bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
return bEqual;
}
+size_t SvxBrushItem::hashCode() const
+{
+ std::size_t seed(0);
+ o3tl::hash_combine(seed, static_cast<sal_Int32>(aColor));
+ o3tl::hash_combine(seed, maComplexColor);
+ o3tl::hash_combine(seed, static_cast<sal_Int32>(aFilterColor));
+ o3tl::hash_combine(seed, eGraphicPos);
+ o3tl::hash_combine(seed, nGraphicTransparency);
+ if ( GPOS_NONE != eGraphicPos )
+ {
+ o3tl::hash_combine(seed, maStrLink);
+ o3tl::hash_combine(seed, maStrFilter);
+ }
+ o3tl::hash_combine(seed, nShadingValue);
+ return seed;
+}
+
SvxBrushItem* SvxBrushItem::Clone( SfxItemPool* ) const
{
return new SvxBrushItem( *this );