[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 30 06:20:32 UTC 2018


 sw/source/ui/fldui/javaedit.cxx   |   10 +++++-----
 sw/source/uibase/inc/javaedit.hxx |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit dbaad8f46631e0e294d487bd215c5fb89ec1b962
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 26 15:21:58 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:20:10 2018 +0200

    loplugin:useuniqueptr in SwJavaEditDialog
    
    Change-Id: Iccd0cafdc6ac454f125da0f5a1df214d2463a2c5
    Reviewed-on: https://gerrit.libreoffice.org/58234
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx
index 1088cb693d17..02c649984936 100644
--- a/sw/source/ui/fldui/javaedit.cxx
+++ b/sw/source/ui/fldui/javaedit.cxx
@@ -63,7 +63,7 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh)
     m_xEditRB->connect_clicked(aLk);
     m_xUrlPB->connect_clicked(LINK(this, SwJavaEditDialog, InsertFileHdl));
 
-    m_pMgr = new SwFieldMgr(m_pSh);
+    m_pMgr.reset(new SwFieldMgr(m_pSh));
     m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField());
 
     m_bNew = !(m_pField && m_pField->GetTyp()->Which() == SwFieldIds::Script);
@@ -79,8 +79,8 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh)
 SwJavaEditDialog::~SwJavaEditDialog()
 {
     m_pSh->EnterStdMode();
-    delete m_pMgr;
-    delete m_pFileDlg;
+    m_pMgr.reset();
+    m_pFileDlg.reset();
 }
 
 IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button&, void)
@@ -225,9 +225,9 @@ IMPL_LINK_NOARG( SwJavaEditDialog, InsertFileHdl, weld::Button&, void )
 {
     if (!m_pFileDlg)
     {
-        m_pFileDlg = new ::sfx2::FileDialogHelper(
+        m_pFileDlg.reset(new ::sfx2::FileDialogHelper(
             ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
-            FileDialogFlags::Insert, "swriter", SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get());
+            FileDialogFlags::Insert, "swriter", SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get()));
     }
 
     m_pFileDlg->StartExecuteModal( LINK( this, SwJavaEditDialog, DlgClosedHdl ) );
diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx
index ccd83e3ecb9f..2a801ee1f770 100644
--- a/sw/source/uibase/inc/javaedit.hxx
+++ b/sw/source/uibase/inc/javaedit.hxx
@@ -37,9 +37,9 @@ private:
     bool           m_bIsUrl;
 
     SwScriptField*          m_pField;
-    SwFieldMgr*             m_pMgr;
+    std::unique_ptr<SwFieldMgr>             m_pMgr;
     SwWrtShell*             m_pSh;
-    sfx2::FileDialogHelper* m_pFileDlg;
+    std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg;
 
     std::unique_ptr<weld::Entry>        m_xTypeED;
     std::unique_ptr<weld::RadioButton>  m_xUrlRB;


More information about the Libreoffice-commits mailing list