diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-17 13:56:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-18 09:08:10 +0200 |
commit | acc711238df5cf7cdd5b470d1439f6dc439f895a (patch) | |
tree | 8f2117f78e2b50e22251d5e3e8c50283eb184f23 /idl | |
parent | 455ac9fb7a46d3bd8e0a94593388c9c474d1dd75 (diff) |
loplugin:useuniqueptr in SvMetaSlot
no need to store ref-counted object like OString on the heap
Change-Id: Ifd031ae68dfd615e99f54414cb2dc32aac60daa8
Reviewed-on: https://gerrit.libreoffice.org/60623
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/object.hxx | 2 | ||||
-rw-r--r-- | idl/inc/slot.hxx | 2 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 6 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 10 |
4 files changed, 9 insertions, 11 deletions
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx index 5b4bdb1eb6eb..822e562c26e1 100644 --- a/idl/inc/object.hxx +++ b/idl/inc/object.hxx @@ -59,7 +59,7 @@ private: static void WriteSlotStubs( const OString& rShellName, SvSlotElementList & rSlotList, - std::vector<OString*> & rList, + std::vector<OString> & rList, SvStream & rOutStm ); static sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, SvSlotElementList & rSlotList, diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx index deef59ca6373..34709bc86bf2 100644 --- a/idl/inc/slot.hxx +++ b/idl/inc/slot.hxx @@ -119,7 +119,7 @@ public: virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual void Insert( SvSlotElementList& ) override; void WriteSlotStubs( const OString& rShellName, - std::vector<OString*> & rList, + std::vector<OString> & rList, SvStream & rOutStm ) const; sal_uInt16 WriteSlotMap( const OString& rShellName, sal_uInt16 nCount, diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 0ff06ae6562b..4becd0240289 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -251,7 +251,7 @@ void SvMetaClass::FillClasses( SvMetaClassList & rList ) void SvMetaClass::WriteSlotStubs( const OString& rShellName, SvSlotElementList & rSlotList, - std::vector<OString*> & rList, + std::vector<OString> & rList, SvStream & rOutStm ) { // write all attributes @@ -306,10 +306,8 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ) rOutStm << endl; rOutStm.WriteCharPtr( "};" ) << endl << endl; - std::vector<OString*> aStringList; + std::vector<OString> aStringList; WriteSlotStubs( GetName(), aSlotList, aStringList, rOutStm ); - for ( size_t i = 0, n = aStringList.size(); i < n; ++i ) - delete aStringList[ i ]; aStringList.clear(); rOutStm << endl; diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index e04edb927e5b..25de8ecb17d0 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -354,7 +354,7 @@ static OString MakeSlotName( SvStringHashEntry const * pEntry ) }; void SvMetaSlot::WriteSlotStubs( const OString& rShellName, - std::vector<OString*> & rList, + std::vector<OString> & rList, SvStream & rOutStm ) const { if ( !GetExport() && !GetHidden() ) @@ -367,7 +367,7 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, bool bIn = false; for( size_t n = 0; n < rList.size(); n++ ) { - if (*rList[n] == aMethodName) + if (rList[n] == aMethodName) { bIn = true; break; @@ -376,7 +376,7 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, if ( !bIn ) { - rList.push_back( new OString(aMethodName) ); + rList.push_back( aMethodName ); rOutStm.WriteCharPtr( "SFX_EXEC_STUB(" ) .WriteOString( rShellName ) .WriteChar( ',' ) @@ -392,7 +392,7 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, bool bIn = false; for ( size_t n=0; n < rList.size(); n++ ) { - if (*rList[n] == aMethodName) + if (rList[n] == aMethodName) { bIn = true; break; @@ -401,7 +401,7 @@ void SvMetaSlot::WriteSlotStubs( const OString& rShellName, if ( !bIn ) { - rList.push_back( new OString(aMethodName) ); + rList.push_back( aMethodName ); rOutStm.WriteCharPtr( "SFX_STATE_STUB(" ) .WriteOString( rShellName ) .WriteChar( ',' ) |