diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-13 16:01:31 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-04-15 11:35:35 +0000 |
commit | fe73ed7c79b96eaa5aa84314a07ae11f188575a1 (patch) | |
tree | c31e19b767338e15afd51606753b822bdd5b700d /include/svl | |
parent | d208cf834f4f191558ae27ea7a8c7a31b8e440a6 (diff) |
convert SFX_ITEM constants to scoped enum
Change-Id: Ief8c30c356ba947727c5ab70092042816a0db99e
Reviewed-on: https://gerrit.libreoffice.org/15302
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/itempool.hxx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx index b6944dbae57e..39f0b797fa4a 100644 --- a/include/svl/itempool.hxx +++ b/include/svl/itempool.hxx @@ -24,6 +24,7 @@ #include <svl/poolitem.hxx> #include <svl/svldllapi.h> #include <tools/solar.h> +#include <o3tl/typed_flags_set.hxx> class SvStream; class SfxBroadcaster; @@ -31,13 +32,21 @@ struct SfxItemPool_Impl; #define SFX_WHICH_MAX 4999 -#define SFX_ITEM_POOLABLE 0x0001 -#define SFX_ITEM_NOT_POOLABLE 0x0002 +enum class SfxItemPoolFlags +{ + NONE = 0x00, + POOLABLE = 0x01, + NOT_POOLABLE = 0x02, +}; +namespace o3tl +{ + template<> struct typed_flags<SfxItemPoolFlags> : is_typed_flags<SfxItemPoolFlags, 0x03> {}; +} struct SfxItemInfo { - sal_uInt16 _nSID; - sal_uInt16 _nFlags; + sal_uInt16 _nSID; + SfxItemPoolFlags _nFlags; }; class SfxStyleSheetIterator; @@ -75,7 +84,7 @@ private: sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const; sal_uInt16 GetSize_Impl() const; - SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, SfxItemPoolFlags nFlag ) const; public: // for default SfxItemSet::CTOR, set default WhichRanges @@ -188,8 +197,8 @@ public: void Delete(); - bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; - bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const + bool IsItemFlag( sal_uInt16 nWhich, SfxItemPoolFlags nFlag ) const; + bool IsItemFlag( const SfxPoolItem &rItem, SfxItemPoolFlags nFlag ) const { return IsItemFlag( rItem.Which(), nFlag ); } void SetItemInfos( const SfxItemInfo *pInfos ); sal_uInt16 GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const; |