diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-02 12:48:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-03 09:08:04 +0200 |
commit | 02caaef29d60370e703bdcdfda09e10e5055d788 (patch) | |
tree | fd95d57d1c2d7dfd4608bae894ba0418b96c1ed0 | |
parent | cd6486b118c8453f1e494ddeb97021f0ef9181c4 (diff) |
loplugin:useuniqueptr in SbiProcDef
Change-Id: I31c43f8fe40d90094d550b02c5d6213e59149bad
Reviewed-on: https://gerrit.libreoffice.org/58486
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basic/source/comp/dim.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 3 | ||||
-rw-r--r-- | basic/source/inc/symtbl.hxx | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index a8e08cf6157d..5a3c27dd0577 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -1032,7 +1032,7 @@ void SbiParser::DefDeclare( bool bPrivate ) } else { - pDef->Match( p ); + pDef->Match( std::unique_ptr<SbiProcDef>(p) ); } } else @@ -1214,7 +1214,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate ) } } - pDef->Match( pProc ); + pDef->Match( std::unique_ptr<SbiProcDef>(pProc) ); pProc = pDef; } else diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index bef0fdb577d9..5963153e23d0 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -409,7 +409,7 @@ void SbiProcDef::SetType( SbxDataType t ) // if the match is OK, pOld is replaced by this in the pool // pOld is deleted in any case! -void SbiProcDef::Match( SbiProcDef* pOld ) +void SbiProcDef::Match( std::unique_ptr<SbiProcDef> pOld ) { SbiSymDef *pn=nullptr; // parameter 0 is the function name @@ -443,7 +443,6 @@ void SbiProcDef::Match( SbiProcDef* pOld ) std::swap(pIn->m_Data[nPos], tmp); tmp.release(); } - delete pOld; } void SbiProcDef::setPropertyMode( PropertyMode ePropMode ) diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index 64a11ea814f3..3c0f9bf0128e 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -194,7 +194,7 @@ public: // Match with a forward-declaration. The parameter names are // compared and the forward declaration is replaced by this - void Match( SbiProcDef* pForward ); + void Match( std::unique_ptr<SbiProcDef> pForward ); private: SbiProcDef( const SbiProcDef& ) = delete; |