From 8014f3722a854b505e536fb13ec4e86e1f5fba7b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 11 Jun 2018 15:03:31 +0200 Subject: loplugin:useuniqueptr in SfxAcceleratorConfigPage Change-Id: I12c6ca5542729d4af77a7d4253ea1bbaae81781c Reviewed-on: https://gerrit.libreoffice.org/56096 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/customize/acccfg.cxx | 7 ++----- cui/source/inc/acccfg.hxx | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'cui') diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index f752506c4fe1..00717a1a7547 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -999,9 +999,7 @@ void SfxAcceleratorConfigPage::dispose() m_pEntriesBox->Clear(); m_pKeyBox->Clear(); - delete m_pFileDlg; - m_pFileDlg = nullptr; - + m_pFileDlg.reset(); m_pEntriesBox.clear(); m_pOfficeButton.clear(); m_pModuleButton.clear(); @@ -1557,8 +1555,7 @@ void SfxAcceleratorConfigPage::StartFileDialog( StartFileDialogType nType, const bool bSave = nType == StartFileDialogType::SaveAs; short nDialogType = bSave ? ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; - delete m_pFileDlg; - m_pFileDlg = new sfx2::FileDialogHelper(nDialogType, FileDialogFlags::NONE, GetFrameWeld()); + m_pFileDlg.reset(new sfx2::FileDialogHelper(nDialogType, FileDialogFlags::NONE, GetFrameWeld())); m_pFileDlg->SetTitle( rTitle ); m_pFileDlg->AddFilter( aFilterAllStr, FILEDIALOG_FILTER_ALL ); diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx index 20e37f0ce1bb..0e96110ea7de 100644 --- a/cui/source/inc/acccfg.hxx +++ b/cui/source/inc/acccfg.hxx @@ -110,7 +110,7 @@ class SfxAcceleratorConfigPage : public SfxTabPage friend class SfxAccCfgTabListBox_Impl; private: const SfxMacroInfoItem* m_pMacroInfoItem; - sfx2::FileDialogHelper* m_pFileDlg; + std::unique_ptr m_pFileDlg; VclPtr m_pEntriesBox; VclPtr m_pOfficeButton; -- cgit