summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-12 16:40:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-13 08:40:36 +0200
commit77a015f160d544827d298fd42b16418ace6a43c0 (patch)
treee333f5511e1af42654b9df7191da6111c6b0147b
parent281f1281edbd0063b1d1d9151bcbfc1299a0082e (diff)
loplugin:useuniqueptr in ScInsertTableDlg
Change-Id: I239d3b1b585219125841dcc02104390f4a1ac3b7 Reviewed-on: https://gerrit.libreoffice.org/57362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/inc/instbdlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 7e8e2b29eee9..8a80e7183035 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -53,7 +53,7 @@ private:
ScViewData& rViewData;
ScDocument& rDoc;
ScDocShell* pDocShTables;
- sfx2::DocumentInserter* pDocInserter;
+ std::unique_ptr<sfx2::DocumentInserter> pDocInserter;
SfxObjectShellRef aDocShTablesRef;
bool bMustClose;
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 3b6269622599..1c27d79e9398 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -66,7 +66,7 @@ ScInsertTableDlg::~ScInsertTableDlg()
{
if (pDocShTables)
pDocShTables->DoClose();
- delete pDocInserter;
+ pDocInserter.reset();
}
void ScInsertTableDlg::Init_Impl( bool bFromFile )
@@ -262,8 +262,8 @@ IMPL_LINK_NOARG(ScInsertTableDlg, ChoiceHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(ScInsertTableDlg, BrowseHdl_Impl, weld::Button&, void)
{
- delete pDocInserter;
- pDocInserter = new ::sfx2::DocumentInserter(m_xDialog.get(), ScDocShell::Factory().GetFactoryName());
+ pDocInserter.reset();
+ pDocInserter.reset( new ::sfx2::DocumentInserter(m_xDialog.get(), ScDocShell::Factory().GetFactoryName()) );
pDocInserter->StartExecuteModal( LINK( this, ScInsertTableDlg, DialogClosedHdl ) );
}