[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jul 20 07:00:12 UTC 2018
sc/source/ui/inc/tpusrlst.hxx | 2 +-
sc/source/ui/optdlg/tpusrlst.cxx | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit a0f0863dc7d251f6112d59c34e8851ee41ba47d8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 19 12:07:32 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 20 08:59:26 2018 +0200
loplugin:useuniqueptr in ScTpUserLists
Change-Id: I15f30f655d409e3570bb33aa032f809263d3035b
Reviewed-on: https://gerrit.libreoffice.org/57751
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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 );
More information about the Libreoffice-commits
mailing list