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:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user