diff options
-rw-r--r-- | svl/inc/svl/flagitem.hxx | 7 | ||||
-rw-r--r-- | svl/source/items/flagitem.cxx | 11 | ||||
-rw-r--r-- | svl/source/items/poolitem.cxx | 23 |
3 files changed, 3 insertions, 38 deletions
diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx index cb5d43377235..5e4e025322f2 100644 --- a/svl/inc/svl/flagitem.hxx +++ b/svl/inc/svl/flagitem.hxx @@ -35,8 +35,6 @@ class SvStream; -extern sal_uInt16 nSfxFlagVal[16]; - // ----------------------------------------------------------------------- DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVL_DLLPUBLIC) @@ -72,9 +70,8 @@ public: DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); nVal = nNewVal; } - int GetFlag( sal_uInt8 nFlag ) const { - return ( (nVal & nSfxFlagVal[nFlag]) != 0 ); } - void SetFlag( sal_uInt8 nFlag, int bVal ); + bool GetFlag( sal_uInt8 nFlag ) const { return ( (nVal & ( 1<<nFlag))); } + void SetFlag( sal_uInt8 nFlag, bool bVal ) { if(bVal) { nVal |= (1<<nFlag); } else { nVal &= ~(1<<nFlag);};} }; #endif diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index cc206deb441c..caec09d1cebf 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -91,7 +91,7 @@ SfxItemPresentation SfxFlagItem::GetPresentation DBG_CHKTHIS(SfxFlagItem, 0); rText.Erase(); for ( sal_uInt8 nFlag = 0; nFlag < GetFlagCount(); ++nFlag ) - rText += XubString::CreateFromInt32( GetFlag(nFlag) ); + rText += XubString::CreateFromInt32( (int)GetFlag(nFlag) ); return SFX_ITEM_PRESENTATION_NAMELESS; } @@ -133,15 +133,6 @@ int SfxFlagItem::operator==( const SfxPoolItem& rItem ) const // ----------------------------------------------------------------------- -void SfxFlagItem::SetFlag( sal_uInt8 nFlag, int bVal ) -{ - if ( bVal ) - nVal |= nSfxFlagVal[nFlag]; - else - nVal &= ~nSfxFlagVal[nFlag]; -} - -// ----------------------------------------------------------------------- SfxPoolItem* SfxFlagItem::Clone(SfxItemPool *) const { diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index c0122f6a4f92..7e9e0f022955 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -39,29 +39,6 @@ DBG_NAME(SfxVoidItem) // @@@ DBG_NAME(SfxInvalidItem); DBG_NAME(SfxItemHandle) -sal_uInt8 nSfxFlag8Val[8] = -{ - 1, 2, 4, 8, 16, 32, 64, 128 -}; - -sal_uInt16 nSfxFlag16Val[16] = -{ - 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, - 1024, 2048, 4096, 8192, 16384, 32768 -}; - -sal_uLong nSfxFlag32Val[32] = -{ - 0x1L, 0x2L, 0x4L, 0x8L, - 0x10L, 0x20L, 0x40L, 0x80L, - 0x100L, 0x200L, 0x400L, 0x800L, - 0x1000L, 0x2000L, 0x40000L, 0x8000L, - 0x10000L, 0x20000L, 0x40000L, 0x80000L, - 0x100000L, 0x200000L, 0x400000L, 0x800000L, - 0x1000000L, 0x2000000L, 0x4000000L, 0x8000000L, - 0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L -}; - // RTTI ------------------------------------------------------------------ TYPEINIT0(SfxPoolItem); |