summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-09-07 00:57:49 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-09-07 02:40:28 +0200
commit0d8c345bf916ef7c1148bda84968c57189e14f5c (patch)
treeea8076841d635bad8eb8f34426b7c88e0e30bd0d /svl
parent2d299c9867a8653fd52a23567a8ddc51ea1ffaf4 (diff)
kill TF_POOLABLE, step 1: error if unset
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/itempool.hxx10
-rw-r--r--svl/inc/svl/slstitm.hxx2
-rw-r--r--svl/source/items/itempool.cxx35
-rw-r--r--svl/source/items/poolio.cxx2
-rw-r--r--svl/source/items/poolitem.cxx7
5 files changed, 19 insertions, 37 deletions
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx
index a3a543e5bf2e..03f17afd0a45 100644
--- a/svl/inc/svl/itempool.hxx
+++ b/svl/inc/svl/itempool.hxx
@@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPool
#ifdef TF_POOLABLE
const SfxItemInfo* pItemInfos;
#else
- sal_uInt16* pSlotIds;
+#error "TF_POOLABLE should always be set."
#endif
SfxItemPool_Impl* pImp;
SfxPoolItem** ppStaticDefaults;
@@ -164,10 +164,12 @@ public:
sal_uInt16 nStart, sal_uInt16 nEnd,
#ifdef TF_POOLABLE
const SfxItemInfo *pItemInfos,
+#else
+#error "TF_POOLABLE should always be set."
#endif
SfxPoolItem **pDefaults = 0,
#ifndef TF_POOLABLE
- sal_uInt16 *pSlotIds = 0,
+#error "TF_POOLABLE should always be set."
#endif
bool bLoadRefCounts = true );
protected:
@@ -246,9 +248,7 @@ public:
void SetItemInfos( const SfxItemInfo *pInfos )
{ pItemInfos = pInfos; }
#else
- int HasMap() const { return 0 != pSlotIds; }
- void SetMap( sal_uInt16 *pNewSlotIds )
- { pSlotIds = pNewSlotIds; }
+#error "TF_POOLABLE should always be set."
#endif
sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx
index 18dff4091205..ed0a1151eaa5 100644
--- a/svl/inc/svl/slstitm.hxx
+++ b/svl/inc/svl/slstitm.hxx
@@ -56,7 +56,7 @@ public:
const std::vector<String>& GetList() const;
#ifndef TF_POOLABLE
- virtual int IsPoolable() const;
+#error "TF_POOLABLE should always be set."
#endif
// String-Separator: \n
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 3b4ff12d2b09..920a4eb1e626 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -110,12 +110,14 @@ SfxItemPool::SfxItemPool
sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */
#ifdef TF_POOLABLE
const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */
+#else
+#error "TF_POOLABLE should always be set."
#endif
SfxPoolItem** pDefaults, /* Pointer auf statische Defaults,
wird direkt vom Pool referenziert,
jedoch kein Eigent"umer"ubergang */
#ifndef TF_POOLABLE
- sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */
+#error "TF_POOLABLE should always be set."
#endif
bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
)
@@ -157,7 +159,7 @@ SfxItemPool::SfxItemPool
#ifdef TF_POOLABLE
pItemInfos(pInfos),
#else
- pSlotIds(pSlotIdArray),
+#error "TF_POOLABLE should always be set."
#endif
pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
ppStaticDefaults(0),
@@ -218,7 +220,7 @@ SfxItemPool::SfxItemPool
#ifdef TF_POOLABLE
pItemInfos(rPool.pItemInfos),
#else
- pSlotIds(rPool.pSlotIds),
+#error "TF_POOLABLE should always be set."
#endif
pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
ppStaticDefaults(0),
@@ -793,6 +795,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
*pNewItem == rItem,
nWhich, "unequal items in Put(): no operator==?" );
}
+#else
+#error "TF_POOLABLE should always be set."
#endif
#endif
AddRef( *pNewItem, pImp->nInitRefCount );
@@ -1008,13 +1012,7 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart;
#else
- if ( pSlotIds )
- {
- sal_uInt16 nCount = nEnd - nStart + 1;
- for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
- if ( pSlotIds[nOfs] == nSlotId )
- return nOfs + nStart;
- }
+#error "TF_POOLABLE should always be set."
#endif
if ( pSecondary && bDeep )
return pSecondary->GetWhich(nSlotId);
@@ -1040,9 +1038,7 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID;
return nSID ? nSID : nWhich;
#else
- else if ( pSlotIds )
- return pSlotIds[nWhich - nStart];
- return nWhich;
+#error "TF_POOLABLE should always be set."
#endif
}
@@ -1059,13 +1055,7 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart;
#else
- if ( pSlotIds )
- {
- sal_uInt16 nCount = nEnd - nStart + 1;
- for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
- if ( pSlotIds[nOfs] == nSlotId )
- return nOfs + nStart;
- }
+#error "TF_POOLABLE should always be set."
#endif
if ( pSecondary && bDeep )
return pSecondary->GetTrueWhich(nSlotId);
@@ -1089,10 +1079,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
#ifdef TF_POOLABLE
return pItemInfos[nWhich - nStart]._nSID;
#else
- else if ( pSlotIds )
- return pSlotIds[nWhich - nStart];
- else
- return 0;
+#error "TF_POOLABLE should always be set."
#endif
}
// -----------------------------------------------------------------------
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 27404859f05b..7e54d65b9f34 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -199,7 +199,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
#ifdef TF_POOLABLE
if ( *pArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) &&
#else
- if ( *pArr && (*ppDefItem)->IsPoolable() &&
+#error "TF_POOLABLE should always be set."
#endif
pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
{
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index ec2909fbd9ad..8fecea15bfa3 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -189,12 +189,7 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
// -----------------------------------------------------------------------
#ifndef TF_POOLABLE
-
-int SfxPoolItem::IsPoolable() const
-{
- DBG_CHKTHIS(SfxPoolItem, 0);
- return sal_True;
-}
+#error "TF_POOLABLE should always be set."
#endif
// -----------------------------------------------------------------------