sw/inc/grfatr.hxx | 2 ++ sw/source/core/graphic/grfatr.cxx | 1 + 2 files changed, 3 insertions(+)
New commits: commit e9594ac00a65c0a55286900265eadaa997e3f6ec Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 23 08:50:37 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 23 16:45:52 2024 +0200 tdf#158556 make SwGammaGrf hashable Change-Id: Ia65013ffee3ef72b61331fd3b4f7ab0b913bf01e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx index f6fe5bb8b05f..39bdad0c1d1d 100644 --- a/sw/inc/grfatr.hxx +++ b/sw/inc/grfatr.hxx @@ -197,6 +197,8 @@ public: // pure virtual methods from SfxEnumItem virtual SwGammaGrf* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool supportsHashCode() const override { return true; } + virtual size_t hashCode() const override { return static_cast<size_t>(m_nValue); } virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx index 549d2d67da3b..e6b8b57847f1 100644 --- a/sw/source/core/graphic/grfatr.cxx +++ b/sw/source/core/graphic/grfatr.cxx @@ -255,6 +255,7 @@ bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const bool SwGammaGrf::PutValue( const uno::Any& rVal, sal_uInt8 ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; return rVal >>= m_nValue; }