diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-21 15:46:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-29 08:21:33 +0200 |
commit | c9f120a424072808c0ed09fc2487541cc212c45e (patch) | |
tree | 2221acbd49dc5c04791bb726d1c78761c79eed20 /dbaccess/source | |
parent | 1ebeb51e8bfa7b139e2661e8fe460a102dfb5659 (diff) |
loplugin:useuniqueptr in ODbTypeWizDialogSetup
Change-Id: I5d1e737510d423f9caa44ad5b498ef5e781c24d0
Reviewed-on: https://gerrit.libreoffice.org/54856
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbwizsetup.hxx | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 3403203c2e33..03b520739f25 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -141,7 +141,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB,this,this)); m_pImpl->setDataSourceOrName(_aDataSourceName); Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource(); - m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() ); + m_pOutSet.reset( new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() ) ); m_pImpl->translateProperties(xDatasource, *m_pOutSet); @@ -264,8 +264,7 @@ ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup() void ODbTypeWizDialogSetup::dispose() { - delete m_pOutSet; - m_pOutSet = nullptr; + m_pOutSet.reset(); m_pGeneralPage.clear(); m_pMySQLIntroPage.clear(); m_pFinalPage.clear(); @@ -388,12 +387,12 @@ void ODbTypeWizDialogSetup::resetPages(const Reference< XPropertySet >& _rxDatas const SfxItemSet* ODbTypeWizDialogSetup::getOutputSet() const { - return m_pOutSet; + return m_pOutSet.get(); } SfxItemSet* ODbTypeWizDialogSetup::getWriteOutputSet() { - return m_pOutSet; + return m_pOutSet.get(); } std::pair< Reference<XConnection>,bool> ODbTypeWizDialogSetup::createConnection() @@ -628,7 +627,7 @@ void ODbTypeWizDialogSetup::saveDatasource() { SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(getCurrentState())); if ( pPage ) - pPage->FillItemSet(m_pOutSet); + pPage->FillItemSet(m_pOutSet.get()); } bool ODbTypeWizDialogSetup::leaveState(WizardState _nState) @@ -640,7 +639,7 @@ bool ODbTypeWizDialogSetup::leaveState(WizardState _nState) resetPages(m_pImpl->getCurrentDataSource()); } SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(_nState)); - return pPage && pPage->DeactivatePage(m_pOutSet) != DeactivateRC::KeepPage; + return pPage && pPage->DeactivatePage(m_pOutSet.get()) != DeactivateRC::KeepPage; } void ODbTypeWizDialogSetup::setTitle(const OUString& /*_sTitle*/) diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 0f0588f9bf68..c84b730fab94 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -58,7 +58,7 @@ class ODbTypeWizDialogSetup final : public svt::RoadmapWizard , public IItemSetH { private: std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl; - SfxItemSet* m_pOutSet; + std::unique_ptr<SfxItemSet> m_pOutSet; OUString m_sURL; OUString m_sOldURL; bool m_bIsConnectable : 1; |