Kaydet (Commit) 10011d00 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

kill TF_POOLABLE, step 2: remove dead code

üst c8d7cb6b
...@@ -981,9 +981,6 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool ) ...@@ -981,9 +981,6 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool )
} }
// remove double Id's // remove double Id's
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
{ {
nCount = aUS.Count(); nCount = aUS.Count();
for ( size_t i = 0; i < nCount; ++i ) for ( size_t i = 0; i < nCount; ++i )
......
...@@ -81,14 +81,10 @@ DBG_NAME(SfxAppMainCHAOSReg) ...@@ -81,14 +81,10 @@ DBG_NAME(SfxAppMainCHAOSReg)
//=================================================================== //===================================================================
#ifdef TF_POOLABLE
static SfxItemInfo const aItemInfos[] = static SfxItemInfo const aItemInfos[] =
{ {
{ 0, 0 } { 0, 0 }
}; };
#else
#error "TF_POOLABLE should always be set."
#endif
//=================================================================== //===================================================================
......
...@@ -1000,11 +1000,7 @@ void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem ) ...@@ -1000,11 +1000,7 @@ void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem )
// Put with mapped Which-Id if possible // Put with mapped Which-Id if possible
const SfxItemPool *pPool = rSet.GetPool(); const SfxItemPool *pPool = rSet.GetPool();
sal_uInt16 nWhich = rItem.Which(); sal_uInt16 nWhich = rItem.Which();
#ifdef TF_POOLABLE
if ( pPool->IsSlot(nWhich) ) if ( pPool->IsSlot(nWhich) )
#else
#error "TF_POOLABLE should always be set."
#endif
nWhich = pPool->GetWhich(nWhich); nWhich = pPool->GetWhich(nWhich);
rSet.Put( rItem, nWhich ); rSet.Put( rItem, nWhich );
} }
......
...@@ -1641,9 +1641,6 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool ) ...@@ -1641,9 +1641,6 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
} }
//! Remove duplicated Ids? //! Remove duplicated Ids?
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
{ {
nCount = aUS.Count(); nCount = aUS.Count();
......
...@@ -105,11 +105,7 @@ class SVL_DLLPUBLIC SfxItemPool ...@@ -105,11 +105,7 @@ class SVL_DLLPUBLIC SfxItemPool
{ {
friend struct SfxItemPool_Impl; friend struct SfxItemPool_Impl;
#ifdef TF_POOLABLE
const SfxItemInfo* pItemInfos; const SfxItemInfo* pItemInfos;
#else
#error "TF_POOLABLE should always be set."
#endif
SfxItemPool_Impl* pImp; SfxItemPool_Impl* pImp;
public: public:
...@@ -147,15 +143,8 @@ public: ...@@ -147,15 +143,8 @@ public:
sal_Bool bCloneStaticDefaults = sal_False ); sal_Bool bCloneStaticDefaults = sal_False );
SfxItemPool( const UniString &rName, SfxItemPool( const UniString &rName,
sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nStart, sal_uInt16 nEnd,
#ifdef TF_POOLABLE
const SfxItemInfo *pItemInfos, const SfxItemInfo *pItemInfos,
#else
#error "TF_POOLABLE should always be set."
#endif
SfxPoolItem **pDefaults = 0, SfxPoolItem **pDefaults = 0,
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
bool bLoadRefCounts = true ); bool bLoadRefCounts = true );
protected: protected:
virtual ~SfxItemPool(); virtual ~SfxItemPool();
...@@ -221,15 +210,11 @@ public: ...@@ -221,15 +210,11 @@ public:
void Delete(); void Delete();
#ifdef TF_POOLABLE
bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const
{ return IsItemFlag( rItem.Which(), nFlag ); } { return IsItemFlag( rItem.Which(), nFlag ); }
void SetItemInfos( const SfxItemInfo *pInfos ) void SetItemInfos( const SfxItemInfo *pInfos )
{ pItemInfos = pInfos; } { pItemInfos = pInfos; }
#else
#error "TF_POOLABLE should always be set."
#endif
sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const; sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "svl/svldllapi.h" #include "svl/svldllapi.h"
#include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Any.hxx>
#define TF_POOLABLE
#include <sal/config.h> #include <sal/config.h>
#include <tools/rtti.hxx> #include <tools/rtti.hxx>
#include <limits.h> #include <limits.h>
......
...@@ -55,10 +55,6 @@ public: ...@@ -55,10 +55,6 @@ public:
const std::vector<String>& GetList() const; const std::vector<String>& GetList() const;
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
// String-Separator: \n // String-Separator: \n
virtual void SetString( const XubString& ); virtual void SetString( const XubString& );
virtual XubString GetString(); virtual XubString GetString();
......
...@@ -109,17 +109,10 @@ SfxItemPool::SfxItemPool ...@@ -109,17 +109,10 @@ SfxItemPool::SfxItemPool
im File-Format */ im File-Format */
sal_uInt16 nStartWhich, /* erste Which-Id des Pools */ sal_uInt16 nStartWhich, /* erste Which-Id des Pools */
sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */
#ifdef TF_POOLABLE
const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */ const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */
#else
#error "TF_POOLABLE should always be set."
#endif
SfxPoolItem** pDefaults, /* Pointer auf statische Defaults, SfxPoolItem** pDefaults, /* Pointer auf statische Defaults,
wird direkt vom Pool referenziert, wird direkt vom Pool referenziert,
jedoch kein Eigent"umer"ubergang */ jedoch kein Eigent"umer"ubergang */
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
) : ) :
...@@ -154,11 +147,7 @@ SfxItemPool::SfxItemPool ...@@ -154,11 +147,7 @@ SfxItemPool::SfxItemPool
<SfxItemPool::ReldaseDefaults(sal_Bool)> <SfxItemPool::ReldaseDefaults(sal_Bool)>
*/ */
#ifdef TF_POOLABLE
pItemInfos(pInfos), pItemInfos(pInfos),
#else
#error "TF_POOLABLE should always be set."
#endif
pImp( new SfxItemPool_Impl( this, rName, nStartWhich, nEndWhich ) ) pImp( new SfxItemPool_Impl( this, rName, nStartWhich, nEndWhich ) )
{ {
DBG_CTOR(SfxItemPool, 0); DBG_CTOR(SfxItemPool, 0);
...@@ -203,11 +192,7 @@ SfxItemPool::SfxItemPool ...@@ -203,11 +192,7 @@ SfxItemPool::SfxItemPool
<SfxItemPool::Clone()const> <SfxItemPool::Clone()const>
*/ */
#ifdef TF_POOLABLE
pItemInfos(rPool.pItemInfos), pItemInfos(rPool.pItemInfos),
#else
#error "TF_POOLABLE should always be set."
#endif
pImp( new SfxItemPool_Impl( this, rPool.pImp->aName, rPool.pImp->mnStart, rPool.pImp->mnEnd ) ) pImp( new SfxItemPool_Impl( this, rPool.pImp->aName, rPool.pImp->mnStart, rPool.pImp->mnEnd ) )
{ {
DBG_CTOR(SfxItemPool, 0); DBG_CTOR(SfxItemPool, 0);
...@@ -767,7 +752,6 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ...@@ -767,7 +752,6 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
pNewItem->SetWhich(nWhich); pNewItem->SetWhich(nWhich);
#ifdef DBG_UTIL #ifdef DBG_UTIL
SFX_ASSERT( rItem.Type() == pNewItem->Type(), nWhich, "unequal types in Put(): no Clone()?" ) SFX_ASSERT( rItem.Type() == pNewItem->Type(), nWhich, "unequal types in Put(): no Clone()?" )
#ifdef TF_POOLABLE
if ( !rItem.ISA(SfxSetItem) ) if ( !rItem.ISA(SfxSetItem) )
{ {
SFX_ASSERT( !IsItemFlag(nWhich, SFX_ITEM_POOLABLE) || SFX_ASSERT( !IsItemFlag(nWhich, SFX_ITEM_POOLABLE) ||
...@@ -777,9 +761,6 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ...@@ -777,9 +761,6 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
*pNewItem == rItem, *pNewItem == rItem,
nWhich, "unequal items in Put(): no operator==?" ); nWhich, "unequal items in Put(): no operator==?" );
} }
#else
#error "TF_POOLABLE should always be set."
#endif
#endif #endif
AddRef( *pNewItem, pImp->nInitRefCount ); AddRef( *pNewItem, pImp->nInitRefCount );
...@@ -1001,14 +982,10 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const ...@@ -1001,14 +982,10 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( !IsSlot(nSlotId) ) if ( !IsSlot(nSlotId) )
return nSlotId; return nSlotId;
#ifdef TF_POOLABLE
sal_uInt16 nCount = pImp->mnEnd - pImp->mnStart + 1; sal_uInt16 nCount = pImp->mnEnd - pImp->mnStart + 1;
for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pItemInfos[nOfs]._nSID == nSlotId ) if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + pImp->mnStart; return nOfs + pImp->mnStart;
#else
#error "TF_POOLABLE should always be set."
#endif
if ( pImp->mpSecondary && bDeep ) if ( pImp->mpSecondary && bDeep )
return pImp->mpSecondary->GetWhich(nSlotId); return pImp->mpSecondary->GetWhich(nSlotId);
return nSlotId; return nSlotId;
...@@ -1028,13 +1005,9 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const ...@@ -1028,13 +1005,9 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" );
return 0; return 0;
} }
#ifdef TF_POOLABLE
sal_uInt16 nSID = pItemInfos[nWhich - pImp->mnStart]._nSID; sal_uInt16 nSID = pItemInfos[nWhich - pImp->mnStart]._nSID;
return nSID ? nSID : nWhich; return nSID ? nSID : nWhich;
#else
#error "TF_POOLABLE should always be set."
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1044,14 +1017,10 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const ...@@ -1044,14 +1017,10 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( !IsSlot(nSlotId) ) if ( !IsSlot(nSlotId) )
return 0; return 0;
#ifdef TF_POOLABLE
sal_uInt16 nCount = pImp->mnEnd - pImp->mnStart + 1; sal_uInt16 nCount = pImp->mnEnd - pImp->mnStart + 1;
for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pItemInfos[nOfs]._nSID == nSlotId ) if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + pImp->mnStart; return nOfs + pImp->mnStart;
#else
#error "TF_POOLABLE should always be set."
#endif
if ( pImp->mpSecondary && bDeep ) if ( pImp->mpSecondary && bDeep )
return pImp->mpSecondary->GetTrueWhich(nSlotId); return pImp->mpSecondary->GetTrueWhich(nSlotId);
return 0; return 0;
...@@ -1071,11 +1040,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const ...@@ -1071,11 +1040,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" );
return 0; return 0;
} }
#ifdef TF_POOLABLE
return pItemInfos[nWhich - pImp->mnStart]._nSID; return pItemInfos[nWhich - pImp->mnStart]._nSID;
#else
#error "TF_POOLABLE should always be set."
#endif
} }
sal_uInt16 SfxItemPool::GetFileFormatVersion() const sal_uInt16 SfxItemPool::GetFileFormatVersion() const
......
...@@ -196,11 +196,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const ...@@ -196,11 +196,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// !poolable wird gar nicht im Pool gespeichert // !poolable wird gar nicht im Pool gespeichert
// und itemsets/plain-items je nach Runde // und itemsets/plain-items je nach Runde
#ifdef TF_POOLABLE
if ( *itrArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) && if ( *itrArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) &&
#else
#error "TF_POOLABLE should always be set."
#endif
pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) ) pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
{ {
// eigene Kennung, globale Which-Id und Item-Version // eigene Kennung, globale Which-Id und Item-Version
......
...@@ -187,11 +187,6 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const ...@@ -187,11 +187,6 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
return rCmp.Type() == Type(); return rCmp.Type() == Type();
} }
// -----------------------------------------------------------------------
#ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
#endif
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
SfxPoolItem* SfxPoolItem::Create(SvStream &, sal_uInt16) const SfxPoolItem* SfxPoolItem::Create(SvStream &, sal_uInt16) const
{ {
......
...@@ -283,16 +283,6 @@ XubString SfxStringListItem::GetString() ...@@ -283,16 +283,6 @@ XubString SfxStringListItem::GetString()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
#ifndef TF_POOLABLE
int SfxStringListItem::IsPoolable() const
{
return sal_False;
}
#endif
//----------------------------------------------------------------------------
void SfxStringListItem::SetStringList( const com::sun::star::uno::Sequence< rtl::OUString >& rList ) void SfxStringListItem::SetStringList( const com::sun::star::uno::Sequence< rtl::OUString >& rList )
{ {
DBG_ASSERT(GetRefCount()==0,"SetString:RefCount!=0"); DBG_ASSERT(GetRefCount()==0,"SetString:RefCount!=0");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment