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
This commit is contained in:
parent
1c4b613cda
commit
01d183d229
2 changed files with 20 additions and 0 deletions
|
@ -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 );
|
||||
|
|
|
@ -85,6 +85,8 @@ public:
|
|||
OUString &rText, const IntlWrapper& ) const override;
|
||||
|
||||
virtual bool operator==( const SfxPoolItem& ) const override;
|
||||
virtual bool supportsHashCode() const override { return true; }
|
||||
virtual size_t hashCode() const override;
|
||||
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
|
||||
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue