summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/lnkbase2.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 10:13:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 10:48:27 +0000
commit49bfc59272f8482ca37abc631d2c3777518fd1d5 (patch)
treee01cb4a3fa03b6dbd7107e409de83de19813d804 /sfx2/source/appl/lnkbase2.cxx
parent88c755e37cd36ddfe6d0d651540d9f2bd8a029a6 (diff)
new loplugin: useuniqueptr: sfx2
Change-Id: I544c615105d14fa258fed7f30790d305e987f523 Reviewed-on: https://gerrit.libreoffice.org/33206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/appl/lnkbase2.cxx')
-rw-r--r--sfx2/source/appl/lnkbase2.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index fd0d8fb21e30..44f7e5e28472 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -46,7 +46,8 @@ struct BaseLink_Impl
Link<SvBaseLink&,void> m_aEndEditLink;
LinkManager* m_pLinkMgr;
VclPtr<vcl::Window> m_pParentWin;
- FileDialogHelper* m_pFileDlg;
+ std::unique_ptr<FileDialogHelper>
+ m_pFileDlg;
bool m_bIsConnect;
BaseLink_Impl() :
@@ -57,7 +58,7 @@ struct BaseLink_Impl
{}
~BaseLink_Impl()
- { delete m_pFileDlg; }
+ {}
};
// only for internal management
@@ -535,11 +536,9 @@ void SvBaseLink::Closed()
FileDialogHelper & SvBaseLink::GetInsertFileDialog(const OUString& rFactory) const
{
- if ( pImpl->m_pFileDlg )
- delete pImpl->m_pFileDlg;
- pImpl->m_pFileDlg = new FileDialogHelper(
+ pImpl->m_pFileDlg.reset( new FileDialogHelper(
ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- FileDialogFlags::Insert, rFactory);
+ FileDialogFlags::Insert, rFactory) );
return *pImpl->m_pFileDlg;
}