diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-03 16:17:41 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-04 09:06:36 +0000 |
commit | 4d0b71be75804dd2b008d3da932d620893fbd780 (patch) | |
tree | adf646679aa898d43363731eb5e9ec5daf0305a2 /svx | |
parent | 0c3a9aa403c209e522dc5c32258c33381677c91e (diff) |
remove reimplementations of SfxItemPool::ReleaseDefaults()
use method from base class SfxItemPool to release and remove the
static pool of default items.
SdrItemPool is child of XOutdevItemPool using the same static pool,
no need for own code in dtor.
~SfxItemPool has a Delete() call too but with conditions.
leave child's unconditional Delete() for now.
Change-Id: Ife4e6398b7b0fa69483bc3c795719778c5efcc51
Reviewed-on: https://gerrit.libreoffice.org/28632
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 17 | ||||
-rw-r--r-- | svx/source/xoutdev/xpool.cxx | 18 |
2 files changed, 2 insertions, 33 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 4b3eba91870f..492d84a94054 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -352,23 +352,6 @@ SfxItemPool* SdrItemPool::Clone() const SdrItemPool::~SdrItemPool() { - // dtor of SfxItemPool - Delete(); - - // clear own static Defaults - if(mppLocalPoolDefaults) - { - const sal_uInt16 nBeg(SDRATTR_SHADOW_FIRST - SDRATTR_START); - const sal_uInt16 nEnd2(SDRATTR_END - SDRATTR_START); - - for(sal_uInt16 i(nBeg); i <= nEnd2; i++) - { - SetRefCount(*mppLocalPoolDefaults[i],0); - delete mppLocalPoolDefaults[i]; - mppLocalPoolDefaults[i] = nullptr; - } - } - // split pools before destroying SetSecondaryPool(nullptr); } diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx index fc6a3ff8064d..476e2ab8832b 100644 --- a/svx/source/xoutdev/xpool.cxx +++ b/svx/source/xoutdev/xpool.cxx @@ -180,22 +180,8 @@ SfxItemPool* XOutdevItemPool::Clone() const XOutdevItemPool::~XOutdevItemPool() { Delete(); - - // remove own static defaults - if(mppLocalPoolDefaults) - { - SfxPoolItem** ppDefaultItem = mppLocalPoolDefaults; - for(sal_uInt16 i(GetLastWhich() - GetFirstWhich() + 1); i; --i, ++ppDefaultItem) - { - if ( *ppDefaultItem ) // these parts might be already cleaned up from a derived class - { - SetRefCount( **ppDefaultItem, 0 ); - delete *ppDefaultItem; - } - } - - delete[] mppLocalPoolDefaults; - } + // release and delete static pool default items + ReleaseDefaults(true); if(mpLocalItemInfos) { |