tdf#158556 make SvxGrfCrop hashable

Change-Id: I30c8f44156a05519dc2f6db59734013e217c91b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172261
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-08-22 19:23:59 +02:00
parent ceec55249e
commit 0b49ac534a
2 changed files with 11 additions and 0 deletions
+2
View File
@@ -44,6 +44,8 @@ public:
// "pure virtual methods" from SfxPoolItem
virtual bool operator==( const SfxPoolItem& ) const override;
virtual bool supportsHashCode() const override { return true; }
virtual size_t hashCode() const override;
virtual bool GetPresentation( SfxItemPresentation ePres,
MapUnit eCoreMetric,
MapUnit ePresMetric,
+9
View File
@@ -53,6 +53,15 @@ bool SvxGrfCrop::operator==( const SfxPoolItem& rAttr ) const
m_nBottom == rCrop.GetBottom();
}
size_t SvxGrfCrop::hashCode() const
{
std::size_t seed(0);
o3tl::hash_combine(seed, m_nLeft);
o3tl::hash_combine(seed, m_nRight);
o3tl::hash_combine(seed, m_nTop);
o3tl::hash_combine(seed, m_nBottom);
return seed;
}
bool SvxGrfCrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{