Kaydet (Commit) 0d8c345b authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

kill TF_POOLABLE, step 1: error if unset

üst 2d299c98
...@@ -982,7 +982,7 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool ) ...@@ -982,7 +982,7 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool )
// remove double Id's // remove double Id's
#ifndef TF_POOLABLE #ifndef TF_POOLABLE
if ( rPool.HasMap() ) #error "TF_POOLABLE should always be set."
#endif #endif
{ {
nCount = aUS.Count(); nCount = aUS.Count();
......
...@@ -86,6 +86,8 @@ static SfxItemInfo const aItemInfos[] = ...@@ -86,6 +86,8 @@ static SfxItemInfo const aItemInfos[] =
{ {
{ 0, 0 } { 0, 0 }
}; };
#else
#error "TF_POOLABLE should always be set."
#endif #endif
//=================================================================== //===================================================================
......
...@@ -1003,7 +1003,7 @@ void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem ) ...@@ -1003,7 +1003,7 @@ void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem )
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
if ( pPool->IsSlot(nWhich) ) if ( pPool->IsSlot(nWhich) )
#else #else
if ( pPool->HasMap() && pPool->IsSlot(nWhich) ) #error "TF_POOLABLE should always be set."
#endif #endif
nWhich = pPool->GetWhich(nWhich); nWhich = pPool->GetWhich(nWhich);
rSet.Put( rItem, nWhich ); rSet.Put( rItem, nWhich );
......
...@@ -1642,7 +1642,7 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool ) ...@@ -1642,7 +1642,7 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
//! Remove duplicated Ids? //! Remove duplicated Ids?
#ifndef TF_POOLABLE #ifndef TF_POOLABLE
if ( rPool.HasMap() ) #error "TF_POOLABLE should always be set."
#endif #endif
{ {
nCount = aUS.Count(); nCount = aUS.Count();
......
...@@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPool ...@@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPool
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
const SfxItemInfo* pItemInfos; const SfxItemInfo* pItemInfos;
#else #else
sal_uInt16* pSlotIds; #error "TF_POOLABLE should always be set."
#endif #endif
SfxItemPool_Impl* pImp; SfxItemPool_Impl* pImp;
SfxPoolItem** ppStaticDefaults; SfxPoolItem** ppStaticDefaults;
...@@ -164,10 +164,12 @@ public: ...@@ -164,10 +164,12 @@ public:
sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nStart, sal_uInt16 nEnd,
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
const SfxItemInfo *pItemInfos, const SfxItemInfo *pItemInfos,
#else
#error "TF_POOLABLE should always be set."
#endif #endif
SfxPoolItem **pDefaults = 0, SfxPoolItem **pDefaults = 0,
#ifndef TF_POOLABLE #ifndef TF_POOLABLE
sal_uInt16 *pSlotIds = 0, #error "TF_POOLABLE should always be set."
#endif #endif
bool bLoadRefCounts = true ); bool bLoadRefCounts = true );
protected: protected:
...@@ -246,9 +248,7 @@ public: ...@@ -246,9 +248,7 @@ public:
void SetItemInfos( const SfxItemInfo *pInfos ) void SetItemInfos( const SfxItemInfo *pInfos )
{ pItemInfos = pInfos; } { pItemInfos = pInfos; }
#else #else
int HasMap() const { return 0 != pSlotIds; } #error "TF_POOLABLE should always be set."
void SetMap( sal_uInt16 *pNewSlotIds )
{ pSlotIds = pNewSlotIds; }
#endif #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;
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
const std::vector<String>& GetList() const; const std::vector<String>& GetList() const;
#ifndef TF_POOLABLE #ifndef TF_POOLABLE
virtual int IsPoolable() const; #error "TF_POOLABLE should always be set."
#endif #endif
// String-Separator: \n // String-Separator: \n
......
...@@ -110,12 +110,14 @@ SfxItemPool::SfxItemPool ...@@ -110,12 +110,14 @@ SfxItemPool::SfxItemPool
sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */
#ifdef TF_POOLABLE #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 #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 #ifndef TF_POOLABLE
sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */ #error "TF_POOLABLE should always be set."
#endif #endif
bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
) )
...@@ -157,7 +159,7 @@ SfxItemPool::SfxItemPool ...@@ -157,7 +159,7 @@ SfxItemPool::SfxItemPool
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
pItemInfos(pInfos), pItemInfos(pInfos),
#else #else
pSlotIds(pSlotIdArray), #error "TF_POOLABLE should always be set."
#endif #endif
pImp( new SfxItemPool_Impl( nStart, nEnd ) ), pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
ppStaticDefaults(0), ppStaticDefaults(0),
...@@ -218,7 +220,7 @@ SfxItemPool::SfxItemPool ...@@ -218,7 +220,7 @@ SfxItemPool::SfxItemPool
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
pItemInfos(rPool.pItemInfos), pItemInfos(rPool.pItemInfos),
#else #else
pSlotIds(rPool.pSlotIds), #error "TF_POOLABLE should always be set."
#endif #endif
pImp( new SfxItemPool_Impl( nStart, nEnd ) ), pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
ppStaticDefaults(0), ppStaticDefaults(0),
...@@ -793,6 +795,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ...@@ -793,6 +795,8 @@ 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 #endif
AddRef( *pNewItem, pImp->nInitRefCount ); AddRef( *pNewItem, pImp->nInitRefCount );
...@@ -1008,13 +1012,7 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const ...@@ -1008,13 +1012,7 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( pItemInfos[nOfs]._nSID == nSlotId ) if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart; return nOfs + nStart;
#else #else
if ( pSlotIds ) #error "TF_POOLABLE should always be set."
{
sal_uInt16 nCount = nEnd - nStart + 1;
for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pSlotIds[nOfs] == nSlotId )
return nOfs + nStart;
}
#endif #endif
if ( pSecondary && bDeep ) if ( pSecondary && bDeep )
return pSecondary->GetWhich(nSlotId); return pSecondary->GetWhich(nSlotId);
...@@ -1040,9 +1038,7 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const ...@@ -1040,9 +1038,7 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID; sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID;
return nSID ? nSID : nWhich; return nSID ? nSID : nWhich;
#else #else
else if ( pSlotIds ) #error "TF_POOLABLE should always be set."
return pSlotIds[nWhich - nStart];
return nWhich;
#endif #endif
} }
...@@ -1059,13 +1055,7 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const ...@@ -1059,13 +1055,7 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( pItemInfos[nOfs]._nSID == nSlotId ) if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart; return nOfs + nStart;
#else #else
if ( pSlotIds ) #error "TF_POOLABLE should always be set."
{
sal_uInt16 nCount = nEnd - nStart + 1;
for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pSlotIds[nOfs] == nSlotId )
return nOfs + nStart;
}
#endif #endif
if ( pSecondary && bDeep ) if ( pSecondary && bDeep )
return pSecondary->GetTrueWhich(nSlotId); return pSecondary->GetTrueWhich(nSlotId);
...@@ -1089,10 +1079,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const ...@@ -1089,10 +1079,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
return pItemInfos[nWhich - nStart]._nSID; return pItemInfos[nWhich - nStart]._nSID;
#else #else
else if ( pSlotIds ) #error "TF_POOLABLE should always be set."
return pSlotIds[nWhich - nStart];
else
return 0;
#endif #endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
...@@ -199,7 +199,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const ...@@ -199,7 +199,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
#ifdef TF_POOLABLE #ifdef TF_POOLABLE
if ( *pArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) && if ( *pArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) &&
#else #else
if ( *pArr && (*ppDefItem)->IsPoolable() && #error "TF_POOLABLE should always be set."
#endif #endif
pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) ) pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
{ {
......
...@@ -189,12 +189,7 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const ...@@ -189,12 +189,7 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#ifndef TF_POOLABLE #ifndef TF_POOLABLE
#error "TF_POOLABLE should always be set."
int SfxPoolItem::IsPoolable() const
{
DBG_CHKTHIS(SfxPoolItem, 0);
return sal_True;
}
#endif #endif
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
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