diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-04 15:06:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 08:26:32 +0200 |
commit | f2f9d431589d7a5d7636fee2a021bfed497cb861 (patch) | |
tree | f8650cc1a996a8d8e5d0c359d8784350b7b7edae /filter | |
parent | 8a6722f6453900424b21809bafb649a0592e7626 (diff) |
loplugin:useuniqueptr in XMLFilterTabDialog
Change-Id: Ic4bc1441802df3b62c1e8da69379f2677f243508
Reviewed-on: https://gerrit.libreoffice.org/55521
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xsltdialog/xmlfiltertabdialog.cxx | 11 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltertabdialog.hxx | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 2f8f5e306506..3d05f25f15e3 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -46,7 +46,7 @@ XMLFilterTabDialog::XMLFilterTabDialog(weld::Window *pParent, , mpXSLTPage(new XMLFilterTabPageXSLT(m_xTabCtrl->get_page("transformation"), m_xDialog.get())) { mpOldInfo = pInfo; - mpNewInfo = new filter_info_impl( *mpOldInfo ); + mpNewInfo.reset( new filter_info_impl( *mpOldInfo ) ); OUString aTitle(m_xDialog->get_title()); aTitle = aTitle.replaceAll("%s", mpNewInfo->maFilterName); @@ -54,19 +54,18 @@ XMLFilterTabDialog::XMLFilterTabDialog(weld::Window *pParent, m_xOKBtn->connect_clicked( LINK( this, XMLFilterTabDialog, OkHdl ) ); - mpBasicPage->SetInfo( mpNewInfo ); - mpXSLTPage->SetInfo( mpNewInfo ); + mpBasicPage->SetInfo( mpNewInfo.get() ); + mpXSLTPage->SetInfo( mpNewInfo.get() ); } XMLFilterTabDialog::~XMLFilterTabDialog() { - delete mpNewInfo; } bool XMLFilterTabDialog::onOk() { - mpXSLTPage->FillInfo( mpNewInfo ); - mpBasicPage->FillInfo( mpNewInfo ); + mpXSLTPage->FillInfo( mpNewInfo.get() ); + mpBasicPage->FillInfo( mpNewInfo.get() ); OString sErrorPage; const char* pErrorId = nullptr; diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.hxx b/filter/source/xsltdialog/xmlfiltertabdialog.hxx index 475a8c34225a..f6b6784eea8d 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.hxx @@ -34,7 +34,7 @@ public: bool onOk(); - filter_info_impl* getNewFilterInfo() const { return mpNewInfo;} + filter_info_impl* getNewFilterInfo() const { return mpNewInfo.get(); } private: css::uno::Reference< css::uno::XComponentContext > mxContext; @@ -42,7 +42,7 @@ private: DECL_LINK(OkHdl, weld::Button&, void); const filter_info_impl* mpOldInfo; - filter_info_impl* mpNewInfo; + std::unique_ptr<filter_info_impl> mpNewInfo; std::unique_ptr<weld::Notebook> m_xTabCtrl; std::unique_ptr<weld::Button> m_xOKBtn; |