diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-01 14:35:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-02 07:46:43 +0100 |
commit | 13d6bfa5bb017ad2b107c9db982369ea050ccbdf (patch) | |
tree | 4eed6571e68c79f5b49426bfd9f6569de4fe4e3c /include | |
parent | a3c78bbee81a82bb50ed2b92944d9946348f73ad (diff) |
convert OfaRefItem to a normal class
only instantiated with one type, so just turn it into a normal class
Change-Id: If3ae908f3e226ae9f4d3b81a7a7d9ba492ccda4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129283
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/ofaitem.hxx | 23 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 3 |
2 files changed, 10 insertions, 16 deletions
diff --git a/include/svx/ofaitem.hxx b/include/svx/ofaitem.hxx index ce86b0653a87..5e9e52b92e38 100644 --- a/include/svx/ofaitem.hxx +++ b/include/svx/ofaitem.hxx @@ -37,24 +37,17 @@ public: void* GetValue() const { return pPtr; } }; -template <class reference_type> -class OfaRefItem final : public SfxPoolItem +class XColorList; +class SVX_DLLPUBLIC OfaXColorListItem final : public SfxPoolItem { private: - rtl::Reference<reference_type> mxRef; + rtl::Reference<XColorList> mxRef; public: - OfaRefItem( sal_uInt16 _nWhich, const rtl::Reference<reference_type> &xRef ) - : SfxPoolItem( _nWhich ), mxRef( xRef ) - {} - virtual bool operator==( const SfxPoolItem& rItem ) const override - { - return SfxPoolItem::operator==(rItem) - && mxRef == static_cast<OfaRefItem<reference_type> const &>(rItem).mxRef; - } - virtual OfaRefItem<reference_type>* Clone( SfxItemPool* /*pPool = 0*/ ) const override - { - return new OfaRefItem( *this ); - } + OfaXColorListItem( sal_uInt16 _nWhich, const rtl::Reference<XColorList> &xRef ); + + virtual bool operator==( const SfxPoolItem& rItem ) const override; + + virtual OfaXColorListItem* Clone( SfxItemPool *pPool = nullptr ) const override; }; #endif diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index a88beea11421..fb974d2af8b4 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -25,6 +25,7 @@ #include <svl/typedwhich.hxx> class OfaPtrItem; +class OfaXColorListItem; class SdrAngleItem; class SfxBoolItem; class SfxInt32Item; @@ -517,7 +518,7 @@ class XFillGradientItem; #define SID_SM_EDITOPTIONS ( SID_SVX_START + 436 ) #define SID_SCH_EDITOPTIONS TypedWhichId<SvxChartColorTableItem>( SID_SVX_START + 437 ) #define SID_SW_ONLINEOPTIONS ( SID_SVX_START + 439 ) -#define SID_GET_COLORLIST ( SID_SVX_START + 441 ) +#define SID_GET_COLORLIST TypedWhichId<OfaXColorListItem>( SID_SVX_START + 441 ) #define SID_OUTLINE_TO_IMPRESS ( SID_SVX_START + 443 ) #define SID_SPELLCHECKER_CHANGED ( SID_SVX_START + 446 ) #define SID_SD_GRAPHIC_OPTIONS ( SID_SVX_START + 447 ) |