diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 08:57:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 11:30:12 +0200 |
commit | b0e05f9ade9e93c569c6a62c59ac1819e615f27b (patch) | |
tree | 61cbf40294b73e5dbc92213c23f1d89dd8998092 /chart2/source/view | |
parent | 1a637473b5aa6a43acb4d1f820044fba962cc6a4 (diff) |
loplugin:useuniqueptr in basic..cppcanvas
Change-Id: Ib40241eb794607154ae52f8aa68fbf5ea5e944af
Reviewed-on: https://gerrit.libreoffice.org/39551
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/axes/Tickmarks_Equidistant.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/axes/Tickmarks_Equidistant.hxx | 11 | ||||
-rw-r--r-- | chart2/source/view/main/ChartItemPool.cxx | 4 | ||||
-rw-r--r-- | chart2/source/view/main/ChartItemPool.hxx | 3 |
4 files changed, 13 insertions, 14 deletions
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.cxx b/chart2/source/view/axes/Tickmarks_Equidistant.cxx index ebbeb4cb304b..df37b2ef07fd 100644 --- a/chart2/source/view/axes/Tickmarks_Equidistant.cxx +++ b/chart2/source/view/axes/Tickmarks_Equidistant.cxx @@ -450,10 +450,10 @@ void EquidistantTickIter::initIter( sal_Int32 nMaxDepth ) if(!m_nTickCount) return; - m_pnPositions = new sal_Int32[m_nMaxDepth+1]; + m_pnPositions.reset( new sal_Int32[m_nMaxDepth+1] ); - m_pnPreParentCount = new sal_Int32[m_nMaxDepth+1]; - m_pbIntervalFinished = new bool[m_nMaxDepth+1]; + m_pnPreParentCount.reset( new sal_Int32[m_nMaxDepth+1] ); + m_pbIntervalFinished.reset( new bool[m_nMaxDepth+1] ); m_pnPreParentCount[0] = 0; m_pbIntervalFinished[0] = false; double fParentValue = getTickValue(0,0); @@ -482,9 +482,6 @@ void EquidistantTickIter::initIter( sal_Int32 nMaxDepth ) EquidistantTickIter::~EquidistantTickIter() { - delete[] m_pnPositions; - delete[] m_pnPreParentCount; - delete[] m_pbIntervalFinished; } sal_Int32 EquidistantTickIter::getStartDepth() const diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.hxx b/chart2/source/view/axes/Tickmarks_Equidistant.hxx index 2f60c694622c..72897c048311 100644 --- a/chart2/source/view/axes/Tickmarks_Equidistant.hxx +++ b/chart2/source/view/axes/Tickmarks_Equidistant.hxx @@ -19,8 +19,8 @@ #ifndef INCLUDED_CHART2_SOURCE_VIEW_AXES_TICKMARKS_EQUIDISTANT_HXX #define INCLUDED_CHART2_SOURCE_VIEW_AXES_TICKMARKS_EQUIDISTANT_HXX -#include <memory> #include "Tickmarks.hxx" +#include <memory> namespace chart { @@ -80,10 +80,13 @@ private: //member const ExplicitIncrementData& m_rIncrement; sal_Int32 m_nMaxDepth; sal_Int32 m_nTickCount; - sal_Int32* m_pnPositions; //current positions in the different sequences - sal_Int32* m_pnPreParentCount; //the tickmarks do not start with a major tick always, + std::unique_ptr<sal_Int32[]> + m_pnPositions; //current positions in the different sequences + std::unique_ptr<sal_Int32[]> + m_pnPreParentCount; //the tickmarks do not start with a major tick always, //the PreParentCount states for each depth how many subtickmarks are available in front of the first parent tickmark - bool* m_pbIntervalFinished; + std::unique_ptr<bool[]> + m_pbIntervalFinished; sal_Int32 m_nCurrentDepth; sal_Int32 m_nCurrentPos; double m_fCurrentValue; diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx index 22a99d8b8f87..1743ae0741fd 100644 --- a/chart2/source/view/main/ChartItemPool.cxx +++ b/chart2/source/view/main/ChartItemPool.cxx @@ -177,7 +177,7 @@ ChartItemPool::ChartItemPool(): pItemInfos[SCHATTR_SYMBOL_SIZE - SCHATTR_START]._nSID = SID_ATTR_SYMBOLSIZE; SetDefaults(ppPoolDefaults); - SetItemInfos(pItemInfos); + SetItemInfos(pItemInfos.get()); } ChartItemPool::ChartItemPool(const ChartItemPool& rPool): @@ -190,8 +190,6 @@ ChartItemPool::~ChartItemPool() Delete(); // release and delete static pool default items ReleaseDefaults(true); - - delete[] pItemInfos; } SfxItemPool* ChartItemPool::Clone() const diff --git a/chart2/source/view/main/ChartItemPool.hxx b/chart2/source/view/main/ChartItemPool.hxx index ad183e87aa41..82ebb0cc73e6 100644 --- a/chart2/source/view/main/ChartItemPool.hxx +++ b/chart2/source/view/main/ChartItemPool.hxx @@ -21,13 +21,14 @@ #include <svl/poolitem.hxx> #include <svl/itempool.hxx> +#include <memory> namespace chart { class ChartItemPool : public SfxItemPool { private: - SfxItemInfo* pItemInfos; + std::unique_ptr<SfxItemInfo[]> pItemInfos; public: ChartItemPool(); |