[Libreoffice-commits] core.git: 2 commits - dbaccess/source

Noel Grandin noel.grandin at collabora.co.uk
Tue May 29 06:21:46 UTC 2018


 dbaccess/source/ui/dlg/dbwizsetup.cxx  |   13 ++++++-------
 dbaccess/source/ui/dlg/indexdialog.cxx |    4 ++--
 dbaccess/source/ui/inc/dbwizsetup.hxx  |    2 +-
 dbaccess/source/ui/inc/indexdialog.hxx |    2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit c9f120a424072808c0ed09fc2487541cc212c45e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon May 21 15:46:07 2018 +0200

    loplugin:useuniqueptr in ODbTypeWizDialogSetup
    
    Change-Id: I5d1e737510d423f9caa44ad5b498ef5e781c24d0
    Reviewed-on: https://gerrit.libreoffice.org/54856
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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;
commit 1ebeb51e8bfa7b139e2661e8fe460a102dfb5659
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri May 18 15:27:18 2018 +0200

    loplugin:useuniqueptr in DbaIndexDialog
    
    Change-Id: Ife795db29256a50a93b668890c85473872d350a9
    Reviewed-on: https://gerrit.libreoffice.org/54853
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index e2e7adc0986f..c12b89e5f5c1 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -215,7 +215,7 @@ namespace dbaui
 
         setToolBox(m_pActions);
 
-        m_pIndexes = new OIndexCollection();
+        m_pIndexes.reset(new OIndexCollection());
         try
         {
             m_pIndexes->attach(_rxIndexes);
@@ -307,7 +307,7 @@ namespace dbaui
     void DbaIndexDialog::dispose()
     {
         setToolBox(nullptr);
-        delete m_pIndexes;
+        m_pIndexes.reset();
         m_pActions.clear();
         m_pIndexList.clear();
         m_pIndexDetails.clear();
diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx
index 766177035374..e7b458559fbb 100644
--- a/dbaccess/source/ui/inc/indexdialog.hxx
+++ b/dbaccess/source/ui/inc/indexdialog.hxx
@@ -89,7 +89,7 @@ namespace dbaui
         VclPtr<IndexFieldsControl>      m_pFields;
         VclPtr<PushButton>              m_pClose;
 
-        OIndexCollection*               m_pIndexes;
+        std::unique_ptr<OIndexCollection> m_pIndexes;
         SvTreeListEntry*                m_pPreviousSelection;
         bool                            m_bEditAgain;
 


More information about the Libreoffice-commits mailing list