diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-22 16:02:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-22 19:05:09 +0000 |
commit | a49748caf2bc3d236862eef5d26383212d35e648 (patch) | |
tree | 8f6b2ae02ccc0ee8a72dae8a652493f8e087cadd /include/svl | |
parent | 450a2fd5e2dafd1a0c08e73ef85db978f6b1a927 (diff) |
convert SfxItemKind to scoped enum
reduced size because it is stored in widely used SfxPoolItem.
converted 'if' chains to 'switch case'
Change-Id: Id9b5e375b681c88e8c91c561abd1a50610aa4815
Reviewed-on: https://gerrit.libreoffice.org/29186
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/poolitem.hxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index b7588495a37f..cf7c96ec65ba 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -34,11 +34,12 @@ class IntlWrapper; class SvStream; -enum SfxItemKind { - SFX_ITEMS_NONE, - SFX_ITEMS_DELETEONIDLE, - SFX_ITEMS_STATICDEFAULT, - SFX_ITEMS_POOLDEFAULT +enum class SfxItemKind : sal_Int8 +{ + NONE, + DeleteOnIdle, + StaticDefault, + PoolDefault }; #define SFX_ITEMS_OLD_MAXREF 0xffef @@ -180,7 +181,7 @@ private: inline void SfxPoolItem::SetRefCount( sal_uLong n ) { m_nRefCount = n; - m_nKind = SFX_ITEMS_NONE; + m_nKind = SfxItemKind::NONE; } inline void SfxPoolItem::SetKind( SfxItemKind n ) @@ -206,17 +207,17 @@ inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const inline bool IsPoolDefaultItem(const SfxPoolItem *pItem ) { - return pItem && pItem->GetKind() == SFX_ITEMS_POOLDEFAULT; + return pItem && pItem->GetKind() == SfxItemKind::PoolDefault; } inline bool IsStaticDefaultItem(const SfxPoolItem *pItem ) { - return pItem && pItem->GetKind() == SFX_ITEMS_STATICDEFAULT; + return pItem && pItem->GetKind() == SfxItemKind::StaticDefault; } inline bool IsDefaultItem( const SfxPoolItem *pItem ) { - return pItem && (pItem->GetKind() == SFX_ITEMS_STATICDEFAULT || pItem->GetKind() == SFX_ITEMS_POOLDEFAULT); + return pItem && (pItem->GetKind() == SfxItemKind::StaticDefault || pItem->GetKind() == SfxItemKind::PoolDefault); } inline bool IsPooledItem( const SfxPoolItem *pItem ) |