Kaydet (Commit) 9a238644 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TokenPool

Change-Id: I25ff554e1dae45ff62bb3f036590a57a79d54b28
Reviewed-on: https://gerrit.libreoffice.org/57296
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f37f83e9
...@@ -61,7 +61,7 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) : ...@@ -61,7 +61,7 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
ppP_Matrix.reset( new ScMatrix*[ nP_Matrix ] ); ppP_Matrix.reset( new ScMatrix*[ nP_Matrix ] );
memset( ppP_Matrix.get(), 0, sizeof( ScMatrix* ) * nP_Matrix ); memset( ppP_Matrix.get(), 0, sizeof( ScMatrix* ) * nP_Matrix );
pScToken = new ScTokenArray; pScToken.reset(new ScTokenArray);
Reset(); Reset();
} }
...@@ -69,8 +69,6 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) : ...@@ -69,8 +69,6 @@ TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
TokenPool::~TokenPool() TokenPool::~TokenPool()
{ {
ClearMatrix(); ClearMatrix();
delete pScToken;
} }
/** Returns the new number of elements, or 0 if overflow. */ /** Returns the new number of elements, or 0 if overflow. */
......
...@@ -211,7 +211,7 @@ private: ...@@ -211,7 +211,7 @@ private:
#ifdef DBG_UTIL #ifdef DBG_UTIL
sal_uInt16 m_nRek; // recursion counter sal_uInt16 m_nRek; // recursion counter
#endif #endif
ScTokenArray* pScToken; // Token array std::unique_ptr<ScTokenArray> pScToken; // Token array
bool GrowTripel( sal_uInt16 nByMin ); bool GrowTripel( sal_uInt16 nByMin );
bool GrowId(); bool GrowId();
...@@ -426,7 +426,7 @@ const inline ScTokenArray* TokenPool::operator []( const TokenId& rId ) ...@@ -426,7 +426,7 @@ const inline ScTokenArray* TokenPool::operator []( const TokenId& rId )
GetElement( static_cast<sal_uInt16>(rId) - 1 ); GetElement( static_cast<sal_uInt16>(rId) - 1 );
} }
return pScToken; return pScToken.get();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment