diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2016-08-07 12:24:28 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-13 11:47:50 +0000 |
commit | cb3a00514a6baa9fe7c0660a743b95e1baed7bb8 (patch) | |
tree | 9240dcb129cc7c82d41eb780f7ed1cc637c15931 /basic/source/comp/symtbl.cxx | |
parent | f8b734a4e2b235c12e86d84c7691e39d05786032 (diff) |
BASIC: Use more often std::unique_ptr
Change-Id: I37f3b35afcf3b4dba30a6ba841a59e0d851f1ebb
Reviewed-on: https://gerrit.libreoffice.org/27930
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic/source/comp/symtbl.cxx')
-rw-r--r-- | basic/source/comp/symtbl.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 578d035042fd..be8ac764768f 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -26,6 +26,7 @@ #include <string.h> #include <ctype.h> #include <rtl/character.hxx> +#include <o3tl/make_unique.hxx> // All symbol names are laid down int the symbol-pool's stringpool, so that // all symbols are handled in the same case. On saving the code-image, the @@ -281,15 +282,13 @@ SbiSymDef::SbiSymDef( const OUString& rName ) : aName( rName ) bByVal = bChained = bGlobal = false; - pIn = - pPool = nullptr; + pIn = nullptr; nDefaultId = 0; nFixedStringLength = -1; } SbiSymDef::~SbiSymDef() { - delete pPool; } SbiProcDef* SbiSymDef::GetProcDef() @@ -371,7 +370,7 @@ SbiSymPool& SbiSymDef::GetPool() { if( !pPool ) { - pPool = new SbiSymPool( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser ); // is dumped + pPool = o3tl::make_unique<SbiSymPool>( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser );// is dumped } return *pPool; } @@ -397,7 +396,7 @@ SbiProcDef::SbiProcDef( SbiParser* pParser, const OUString& rName, , mbProcDecl( bProcDecl ) { aParams.SetParent( &pParser->aPublics ); - pPool = new SbiSymPool( pParser->aGblStrings, SbLOCAL, pParser ); + pPool = o3tl::make_unique<SbiSymPool>( pParser->aGblStrings, SbLOCAL, pParser ); pPool->SetParent( &aParams ); nLine1 = nLine2 = 0; |