diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 09:35:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 08:22:16 +0200 |
commit | 15e7509e6781957bc82bc7ce7d0619179b126256 (patch) | |
tree | 79e4ad22fbd15595778385aeda17833d4392f3c0 /sw/source/ui | |
parent | 951cf8e6cf2d5e5fc2c3c760ef5df2cadb04aea4 (diff) |
loplugin:useuniqueptr in SwCreateAddressListDialog
Change-Id: I4d118e6f4db66beb3553eeead2a36cbb8bec45be
Reviewed-on: https://gerrit.libreoffice.org/58246
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/customizeaddresslistdialog.hxx | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index a43be61db108..0e3d04664e5a 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -497,7 +497,7 @@ SwCreateAddressListDialog::~SwCreateAddressListDialog() void SwCreateAddressListDialog::dispose() { - delete m_pCSVData; + m_pCSVData.reset(); m_pAddressControl.clear(); m_pNewPB.clear(); m_pDeletePB.clear(); @@ -570,8 +570,7 @@ IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, Button*, pButton, void) VclPtrInstance< SwCustomizeAddressListDialog > pDlg(pButton, *m_pCSVData); if(RET_OK == pDlg->Execute()) { - delete m_pCSVData; - m_pCSVData = pDlg->GetNewData(); + m_pCSVData = pDlg->ReleaseNewData(); m_pAddressControl->SetData(*m_pCSVData); m_pAddressControl->SetCurrentDataSet(m_pAddressControl->GetCurrentDataSet()); } diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index 81ecad7cb8ec..8961898dcb0d 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -59,7 +59,7 @@ class SwCreateAddressListDialog : public SfxModalDialog OUString m_sAddressListFilterName; OUString m_sURL; - SwCSVData* m_pCSVData; + std::unique_ptr<SwCSVData> m_pCSVData; VclPtr<SwFindEntryDialog> m_pFindDlg; DECL_LINK(NewHdl_Impl, Button*, void); diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index aaf120f71c4f..a138d83ddf94 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -37,7 +37,7 @@ class SwCustomizeAddressListDialog : public SfxModalDialog VclPtr<PushButton> m_pUpPB; VclPtr<PushButton> m_pDownPB; - SwCSVData* m_pNewData; + std::unique_ptr<SwCSVData> m_pNewData; DECL_LINK(AddRenameHdl_Impl, Button*, void); DECL_LINK(DeleteHdl_Impl, Button*, void); @@ -50,7 +50,7 @@ public: virtual ~SwCustomizeAddressListDialog() override; virtual void dispose() override; - SwCSVData* GetNewData() { return m_pNewData;} + std::unique_ptr<SwCSVData> ReleaseNewData() { return std::move(m_pNewData);} }; class SwAddRenameEntryDialog : public SfxModalDialog |