summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-03 16:17:41 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-04 09:06:36 +0000
commit4d0b71be75804dd2b008d3da932d620893fbd780 (patch)
treeadf646679aa898d43363731eb5e9ec5daf0305a2 /chart2
parent0c3a9aa403c209e522dc5c32258c33381677c91e (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 'chart2')
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx15
-rw-r--r--chart2/source/view/main/ChartItemPool.hxx1
2 files changed, 4 insertions, 12 deletions
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 1c55877206dd..7ec565c406f0 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -42,7 +42,7 @@ ChartItemPool::ChartItemPool():
/**************************************************************************
* PoolDefaults
**************************************************************************/
- ppPoolDefaults = new SfxPoolItem*[SCHATTR_END - SCHATTR_START + 1];
+ SfxPoolItem** ppPoolDefaults = new SfxPoolItem*[SCHATTR_END - SCHATTR_START + 1];
ppPoolDefaults[SCHATTR_DATADESCR_SHOW_NUMBER - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_NUMBER);
ppPoolDefaults[SCHATTR_DATADESCR_SHOW_PERCENTAGE- SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_SHOW_PERCENTAGE);
@@ -183,24 +183,17 @@ ChartItemPool::ChartItemPool():
}
ChartItemPool::ChartItemPool(const ChartItemPool& rPool):
- SfxItemPool(rPool), ppPoolDefaults(nullptr), pItemInfos(nullptr)
+ SfxItemPool(rPool), pItemInfos(nullptr)
{
}
ChartItemPool::~ChartItemPool()
{
Delete();
+ // release and delete static pool default items
+ ReleaseDefaults(true);
delete[] pItemInfos;
-
- const sal_uInt16 nMax = SCHATTR_END - SCHATTR_START + 1;
- for( sal_uInt16 i=0; i<nMax; ++i )
- {
- SetRefCount(*ppPoolDefaults[i], 0);
- delete ppPoolDefaults[i];
- }
-
- delete[] ppPoolDefaults;
}
SfxItemPool* ChartItemPool::Clone() const
diff --git a/chart2/source/view/main/ChartItemPool.hxx b/chart2/source/view/main/ChartItemPool.hxx
index 5740fcdf9d38..dded9d96b5e9 100644
--- a/chart2/source/view/main/ChartItemPool.hxx
+++ b/chart2/source/view/main/ChartItemPool.hxx
@@ -27,7 +27,6 @@ namespace chart
class ChartItemPool : public SfxItemPool
{
private:
- SfxPoolItem** ppPoolDefaults;
SfxItemInfo* pItemInfos;
public: