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>
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index 1296f31..18fb99a 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 b985d5f..397de91 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();
}