sc/source/ui/inc/instbdlg.hxx | 2 +- sc/source/ui/miscdlgs/instbdlg.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit 77a015f160d544827d298fd42b16418ace6a43c0 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Thu Jul 12 16:40:47 2018 +0200 loplugin:useuniqueptr in ScInsertTableDlg Change-Id: I239d3b1b585219125841dcc02104390f4a1ac3b7 Reviewed-on: https://gerrit.libreoffice.org/57362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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 ) ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits