diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-19 12:07:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-20 08:59:26 +0200 |
commit | a0f0863dc7d251f6112d59c34e8851ee41ba47d8 (patch) | |
tree | a31f21038f7202ddd24f764f5141b0bcc905f334 /sc | |
parent | 8caf5129d46d1ebfdd66ebe4dd3d8463ad1aa035 (diff) |
loplugin:useuniqueptr in ScTpUserLists
Change-Id: I15f30f655d409e3570bb33aa032f809263d3035b
Reviewed-on: https://gerrit.libreoffice.org/57751
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/tpusrlst.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx index 6e84d2e442f8..bd1c690b1019 100644 --- a/sc/source/ui/inc/tpusrlst.hxx +++ b/sc/source/ui/inc/tpusrlst.hxx @@ -71,7 +71,7 @@ private: const OUString aStrCopyErr; const sal_uInt16 nWhichUserLists; - ScUserList* pUserLists; + std::unique_ptr<ScUserList> pUserLists; ScDocument* pDoc; ScViewData* pViewData; diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 5f7734c483f6..6b13e971cc1b 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -53,7 +53,6 @@ ScTpUserLists::ScTpUserLists( vcl::Window* pParent, aStrCopyFrom ( ScResId( STR_COPYFROM ) ), aStrCopyErr ( ScResId( STR_COPYERR ) ), nWhichUserLists ( GetWhich( SID_SCUSERLISTS ) ), - pUserLists ( nullptr ), pDoc ( nullptr ), pViewData ( nullptr ), bModifyMode ( false ), @@ -86,7 +85,7 @@ ScTpUserLists::~ScTpUserLists() void ScTpUserLists::dispose() { - delete pUserLists; + pUserLists.reset(); mpFtLists.clear(); mpLbLists.clear(); mpFtEntries.clear(); @@ -165,7 +164,7 @@ void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs ) if ( pCoreList ) { if ( !pUserLists ) - pUserLists = new ScUserList( *pCoreList ); + pUserLists.reset( new ScUserList( *pCoreList ) ); else *pUserLists = *pCoreList; @@ -176,7 +175,7 @@ void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs ) } } else if ( !pUserLists ) - pUserLists = new ScUserList; + pUserLists.reset( new ScUserList ); mpEdCopyFrom->SetText( aStrSelectedArea ); @@ -336,7 +335,7 @@ void ScTpUserLists::AddNewList( const OUString& rEntriesStr ) OUString theEntriesStr( rEntriesStr ); if ( !pUserLists ) - pUserLists = new ScUserList; + pUserLists.reset( new ScUserList ); MakeListStr( theEntriesStr ); |