summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-01-13 08:26:27 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-01-13 08:26:27 +0100
commitdc85ef3aeb28edc51a61115d15ebe6dba8bd1ef8 (patch)
treeec2e455afb7deca6a463ef44352a4898b992d86e /svl
parent14c42d4b3c60cb2a95cb73c9b20e51a29e5f9810 (diff)
tdf#97077: So ppStaticDefaults can be null after all
...at least in Base, and the assumption in 43de9a5b0f68a77a10595b3f69c6145cd9be05b6 "What these SAL_INFO probably want to tell us..." was wrong Change-Id: Ic9377b72f35c130ecd34dbf76c1f6a0f4b235c69
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itempool.cxx53
1 files changed, 27 insertions, 26 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index f58dbad19985..1ecf9b8b3c58 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -402,12 +402,12 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
if ( pImp->mpSecondary )
{
#ifdef DBG_UTIL
- // Delete() did not yet run?
- if ( !pImp->maPoolItems.empty() && !pImp->mpSecondary->pImp->maPoolItems.empty() )
+ if (pImp->ppStaticDefaults != nullptr && !pImp->maPoolItems.empty()
+ && !pImp->mpSecondary->pImp->maPoolItems.empty())
+ // Delete() did not yet run?
{
// Does the Master have SetItems?
bool bHasSetItems = false;
- assert(pImp->ppStaticDefaults);
for ( sal_uInt16 i = 0; !bHasSetItems && i < pImp->mnEnd - pImp->mnStart; ++i )
bHasSetItems = dynamic_cast<const SfxSetItem *>(pImp->ppStaticDefaults[i]) != nullptr;
@@ -517,35 +517,36 @@ void SfxItemPool::Delete()
sal_uInt16 nArrCnt;
// Collect the SetItems first
- assert(pImp->ppStaticDefaults);
- for ( nArrCnt = GetSize_Impl();
- nArrCnt;
- --nArrCnt, ++itrItemArr, ++ppDefaultItem, ++ppStaticDefaultItem )
- {
- // *ppStaticDefaultItem could've already been deleted in a class derived
- // from SfxItemPool
- // This causes chaos in Itempool!
- if ( *ppStaticDefaultItem && dynamic_cast< const SfxSetItem* >(*ppStaticDefaultItem) != nullptr )
+ if (pImp->ppStaticDefaults != nullptr) {
+ for ( nArrCnt = GetSize_Impl();
+ nArrCnt;
+ --nArrCnt, ++itrItemArr, ++ppDefaultItem, ++ppStaticDefaultItem )
{
- if ( *itrItemArr )
+ // *ppStaticDefaultItem could've already been deleted in a class derived
+ // from SfxItemPool
+ // This causes chaos in Itempool!
+ if ( *ppStaticDefaultItem && dynamic_cast< const SfxSetItem* >(*ppStaticDefaultItem) != nullptr )
{
- SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*itrItemArr)->begin();
- for ( size_t n = (*itrItemArr)->size(); n; --n, ++ppHtArr )
- if (*ppHtArr)
- {
+ if ( *itrItemArr )
+ {
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*itrItemArr)->begin();
+ for ( size_t n = (*itrItemArr)->size(); n; --n, ++ppHtArr )
+ if (*ppHtArr)
+ {
#ifdef DBG_UTIL
- ReleaseRef( **ppHtArr, (*ppHtArr)->GetRefCount() );
+ ReleaseRef( **ppHtArr, (*ppHtArr)->GetRefCount() );
#endif
- delete *ppHtArr;
- }
- DELETEZ( *itrItemArr );
- }
- if ( *ppDefaultItem )
- {
+ delete *ppHtArr;
+ }
+ DELETEZ( *itrItemArr );
+ }
+ if ( *ppDefaultItem )
+ {
#ifdef DBG_UTIL
- SetRefCount( **ppDefaultItem, 0 );
+ SetRefCount( **ppDefaultItem, 0 );
#endif
- DELETEZ( *ppDefaultItem );
+ DELETEZ( *ppDefaultItem );
+ }
}
}
}