summaryrefslogtreecommitdiffstats
path: root/include/svl/poolitem.hxx
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-22 16:02:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-22 19:05:09 +0000
commita49748caf2bc3d236862eef5d26383212d35e648 (patch)
tree8f6b2ae02ccc0ee8a72dae8a652493f8e087cadd /include/svl/poolitem.hxx
parenttdf#53698: Cache more than 1 item in NumberFormatCodeMapper (diff)
downloadcore-a49748caf2bc3d236862eef5d26383212d35e648.tar.gz
core-a49748caf2bc3d236862eef5d26383212d35e648.zip
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/poolitem.hxx')
-rw-r--r--include/svl/poolitem.hxx19
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 )