diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-04 18:58:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-05 14:06:33 +0200 |
commit | 4f7c0393d5dab5c0451d16a694fab963bdc98966 (patch) | |
tree | 8409534f55d0b69307d68f69ab88c76acf7d651f /include/svl | |
parent | d2c49bfde8e4e5f17cc80f5f5cc99ebb0aec1946 (diff) |
simplify SfxAllEnumItem
It is just a data carrier for an array of values for
SID_ATTR_PATHNAME, it does not need associated enum logic.
Change-Id: I547cd5580d02eb9c261feeb3545e31910a4ed644
Reviewed-on: https://gerrit.libreoffice.org/80253
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/aeitem.hxx | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/include/svl/aeitem.hxx b/include/svl/aeitem.hxx index 4c25643cf59d..a15d3a5e2332 100644 --- a/include/svl/aeitem.hxx +++ b/include/svl/aeitem.hxx @@ -26,37 +26,20 @@ #include <memory> #include <vector> -struct SfxAllEnumValue_Impl; -typedef std::vector<SfxAllEnumValue_Impl> SfxAllEnumValueArr; - -// MSVC hack: -class SAL_DLLPUBLIC_RTTI SfxAllEnumItem_Base: public SfxEnumItem<sal_uInt16> { -protected: - explicit SfxAllEnumItem_Base(sal_uInt16 nWhich, sal_uInt16 nValue): - SfxEnumItem(nWhich, nValue) - {} -}; - -class SVL_DLLPUBLIC SfxAllEnumItem: public SfxAllEnumItem_Base +class SVL_DLLPUBLIC SfxAllEnumItem: public SfxPoolItem { - std::unique_ptr<SfxAllEnumValueArr> pValues; - - sal_uInt16 GetPosByValue( sal_uInt16 nValue ) const; - std::size_t GetPosByValue_( sal_uInt16 nValue ) const; - sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const; + std::vector<OUString> m_Values; public: explicit SfxAllEnumItem( sal_uInt16 nWhich); - SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal ); SfxAllEnumItem( const SfxAllEnumItem & ); virtual ~SfxAllEnumItem() override; - void InsertValue( sal_uInt16 nValue ); - void InsertValue( sal_uInt16 nValue, const OUString &rText ); - - virtual sal_uInt16 GetValueCount() const override; - OUString const & GetValueTextByPos( sal_uInt16 nPos ) const; + void SetTextByPos( sal_uInt16 nPos, const OUString &rText ); + OUString const & GetTextByPos( sal_uInt16 nPos ) const; + sal_Int32 GetTextCount() const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool operator==( SfxPoolItem const & ) const override; }; #endif |