summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-11 11:20:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-12 08:28:06 +0200
commit9a238644f21014cef085b7124ebc3d1397e85870 (patch)
tree34a4a43981269a9a40b638825012aace166a2d47 /sc
parentf37f83e9e879926568bf1f508ad554a20076100d (diff)
loplugin:useuniqueptr in TokenPool
Change-Id: I25ff554e1dae45ff62bb3f036590a57a79d54b28 Reviewed-on: https://gerrit.libreoffice.org/57296 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/tokstack.cxx4
-rw-r--r--sc/source/filter/inc/tokstack.hxx4
2 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index 1296f319bd6a..18fb99aae1e1 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -61,7 +61,7 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
ppP_Matrix.reset( new ScMatrix*[ nP_Matrix ] );
memset( ppP_Matrix.get(), 0, sizeof( ScMatrix* ) * nP_Matrix );
- pScToken = new ScTokenArray;
+ pScToken.reset(new ScTokenArray);
Reset();
}
@@ -69,8 +69,6 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
TokenPool::~TokenPool()
{
ClearMatrix();
-
- delete pScToken;
}
/** Returns the new number of elements, or 0 if overflow. */
diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx
index b985d5f45d9d..397de91536ea 100644
--- a/sc/source/filter/inc/tokstack.hxx
+++ b/sc/source/filter/inc/tokstack.hxx
@@ -211,7 +211,7 @@ private:
#ifdef DBG_UTIL
sal_uInt16 m_nRek; // recursion counter
#endif
- ScTokenArray* pScToken; // Token array
+ std::unique_ptr<ScTokenArray> pScToken; // Token array
bool GrowTripel( sal_uInt16 nByMin );
bool GrowId();
@@ -426,7 +426,7 @@ const inline ScTokenArray* TokenPool::operator []( const TokenId& rId )
GetElement( static_cast<sal_uInt16>(rId) - 1 );
}
- return pScToken;
+ return pScToken.get();
}