From 7e274df5d149fc272277f234bf14d558a77d4bc1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 12:57:33 +0200 Subject: make some of the SfxStringItem subclasses hashable Change-Id: I7ad748b67266926f1e4e67e843a90b5ac3fe58b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170152 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svl/custritm.hxx | 2 ++ include/svx/postattr.hxx | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/svl/custritm.hxx b/include/svl/custritm.hxx index 118fd0963f15..309c0ebfe48a 100644 --- a/include/svl/custritm.hxx +++ b/include/svl/custritm.hxx @@ -39,6 +39,8 @@ public: SfxPoolItem(which, eItemType), m_aValue(std::move(aTheValue)) {} + // not all of the subclasses of this are hashable, so we only define the shared hashCode function here + virtual size_t hashCode() const override; virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, diff --git a/include/svx/postattr.hxx b/include/svx/postattr.hxx index af980a3e5b9e..22ede7dffc92 100644 --- a/include/svx/postattr.hxx +++ b/include/svx/postattr.hxx @@ -39,6 +39,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItAuthorItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; @@ -59,6 +61,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItDateItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; /** The text of a note @@ -79,6 +83,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItTextItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; @@ -93,6 +99,8 @@ public: SvxPostItIdItem( TypedWhichId nWhich ); virtual SvxPostItIdItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; #endif -- cgit v1.2.3