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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Sep 8 17:28:20 UTC 2018


 dbaccess/source/ui/dlg/ConnectionHelper.cxx       |   12 +-
 dbaccess/source/ui/dlg/ConnectionHelper.hxx       |    4 
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx |  108 +++++++++++-----------
 dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx |   36 +++----
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx   |   30 +++---
 dbaccess/source/ui/dlg/TextConnectionHelper.hxx   |    4 
 dbaccess/source/ui/dlg/UserAdmin.cxx              |    4 
 dbaccess/source/ui/dlg/UserAdmin.hxx              |    4 
 dbaccess/source/ui/dlg/admincontrols.cxx          |   26 ++---
 dbaccess/source/ui/dlg/admincontrols.hxx          |    4 
 dbaccess/source/ui/dlg/adminpages.cxx             |    8 -
 dbaccess/source/ui/dlg/adminpages.hxx             |    8 -
 dbaccess/source/ui/dlg/advancedsettings.cxx       |   26 ++---
 dbaccess/source/ui/dlg/advancedsettings.hxx       |    8 -
 dbaccess/source/ui/dlg/detailpages.cxx            |   44 ++++----
 dbaccess/source/ui/dlg/detailpages.hxx            |   16 +--
 dbaccess/source/ui/dlg/generalpage.cxx            |    8 -
 dbaccess/source/ui/dlg/generalpage.hxx            |    4 
 dbaccess/source/ui/dlg/tablespage.cxx             |    6 -
 dbaccess/source/ui/dlg/tablespage.hxx             |    4 
 filter/source/graphicfilter/icgm/bundles.hxx      |   13 +-
 filter/source/graphicfilter/icgm/elements.cxx     |   33 +-----
 filter/source/graphicfilter/icgm/elements.hxx     |    3 
 23 files changed, 195 insertions(+), 218 deletions(-)

New commits:
commit 9212fadc4d421148e1a3f8b668d82a93f65cc2c3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 7 14:33:33 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Sep 8 19:28:08 2018 +0200

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

diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 8de2b38f75d5..fe0ba4585089 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -657,16 +657,16 @@ namespace dbaui
         return true;
     }
 
-    void OConnectionHelper::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OConnectionHelper::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFT_Connection));
-        _rControlList.push_back(new ODisableWrapper<PushButton>(m_pPB_Connection));
-        _rControlList.push_back(new ODisableWrapper<PushButton>(m_pPB_CreateDB));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFT_Connection));
+        _rControlList.emplace_back(new ODisableWrapper<PushButton>(m_pPB_Connection));
+        _rControlList.emplace_back(new ODisableWrapper<PushButton>(m_pPB_CreateDB));
     }
 
-    void OConnectionHelper::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OConnectionHelper::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back( new OSaveValueWrapper<Edit>( m_pConnectionURL ) );
+        _rControlList.emplace_back( new OSaveValueWrapper<Edit>( m_pConnectionURL ) );
     }
 
     bool OConnectionHelper::commitURL()
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
index 0f599e4a9a75..e7a1a2f3264b 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
@@ -57,9 +57,9 @@ namespace dbaui
         virtual bool    PreNotify( NotifyEvent& _rNEvt ) override;
 
         // <method>OGenericAdministrationPage::fillControls</method>
-        virtual void    fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void    fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         // <method>OGenericAdministrationPage::fillWindows</method>
-        virtual void    fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void    fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         virtual void    implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
 
         // setting/retrieving the current connection URL
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 3334dac786e4..e1ffd84be35c 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -98,12 +98,12 @@ using namespace ::com::sun::star;
         return bDoEnable;
     }
 
-    void OTextConnectionPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OConnectionTabPageSetup::fillControls(_rControlList);
         m_pTextConnectionHelper->fillControls(_rControlList);
     }
-    void OTextConnectionPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OConnectionTabPageSetup::fillWindows(_rControlList);
         m_pTextConnectionHelper->fillWindows(_rControlList);
@@ -198,20 +198,20 @@ using namespace ::com::sun::star;
         fillBool(*_rSet,m_pCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething);
         return bChangedSomething;
     }
-    void OLDAPConnectionPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OLDAPConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETHostServer));
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETBaseDN));
-        _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBUseSSL));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETHostServer));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETBaseDN));
+        _rControlList.emplace_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pCBUseSSL));
     }
-    void OLDAPConnectionPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OLDAPConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHostServer));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTBaseDN));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTPortNumber));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTDefaultPortNumber));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHostServer));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTBaseDN));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTPortNumber));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTDefaultPortNumber));
     }
     void OLDAPConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
     {
@@ -293,11 +293,11 @@ using namespace ::com::sun::star;
             m_pJDBCDatabase->Check();
     }
 
-    void OMySQLIntroPageSetup::fillControls(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+    void OMySQLIntroPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
     {
     }
 
-    void OMySQLIntroPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+    void OMySQLIntroPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
     {
     }
 
@@ -345,14 +345,14 @@ using namespace ::com::sun::star;
         return VclPtr<MySQLNativeSetupPage>::Create( pParent, _rAttrSet );
     }
 
-    void MySQLNativeSetupPage::fillControls( std::vector< ISaveValueWrapper* >& _rControlList )
+    void MySQLNativeSetupPage::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
         m_aMySQLSettings->fillControls( _rControlList );
     }
 
-    void MySQLNativeSetupPage::fillWindows( std::vector< ISaveValueWrapper* >& _rControlList )
+    void MySQLNativeSetupPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
-        _rControlList.push_back( new ODisableWrapper< FixedText >( m_pHelpText ) );
+        _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pHelpText ) );
         m_aMySQLSettings->fillWindows( _rControlList );
     }
 
@@ -466,21 +466,21 @@ using namespace ::com::sun::star;
                                                           STR_ORACLE_DRIVERCLASSTEXT);
     }
 
-    void OGeneralSpecialJDBCConnectionPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OGeneralSpecialJDBCConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETDatabasename));
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETDriverClass));
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETHostname));
-        _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETDatabasename));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETDriverClass));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETHostname));
+        _rControlList.emplace_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
     }
-    void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTDatabasename));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHostname));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTPortNumber));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTDefaultPortNumber));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTDriverClass));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTDatabasename));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHostname));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTPortNumber));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTDefaultPortNumber));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTDriverClass));
     }
 
     bool OGeneralSpecialJDBCConnectionPageSetup::FillItemSet( SfxItemSet* _rSet )
@@ -597,14 +597,14 @@ using namespace ::com::sun::star;
         OConnectionTabPageSetup::dispose();
     }
 
-    void OJDBCConnectionPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OJDBCConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETDriverClass));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETDriverClass));
     }
 
-    void OJDBCConnectionPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OJDBCConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTDriverClass));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTDriverClass));
     }
 
     bool OJDBCConnectionPageSetup::FillItemSet( SfxItemSet* _rSet )
@@ -711,14 +711,14 @@ using namespace ::com::sun::star;
         OConnectionTabPageSetup::dispose();
     }
 
-    void OSpreadSheetConnectionPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+    void OSpreadSheetConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
     {
     }
 
-    void OSpreadSheetConnectionPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OSpreadSheetConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OConnectionTabPageSetup::fillControls(_rControlList);
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pPasswordrequired));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pPasswordrequired));
 
     }
 
@@ -765,17 +765,17 @@ using namespace ::com::sun::star;
         OGenericAdministrationPage::dispose();
     }
 
-    void OAuthentificationPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OAuthentificationPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTUserName));
-        _rControlList.push_back(new ODisableWrapper<PushButton>(m_pPBTestConnection));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHelpText));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTUserName));
+        _rControlList.emplace_back(new ODisableWrapper<PushButton>(m_pPBTestConnection));
     }
 
-    void OAuthentificationPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OAuthentificationPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETUserName));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBPasswordRequired));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pETUserName));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pCBPasswordRequired));
     }
 
     void OAuthentificationPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
@@ -863,20 +863,20 @@ using namespace ::com::sun::star;
         return m_pCBStartTableWizard->IsChecked() && m_pCBStartTableWizard->IsEnabled();
     }
 
-    void OFinalDBPageSetup::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OFinalDBPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHeader));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHelpText));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTAdditionalSettings));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalText));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTFinalHeader));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTFinalHelpText));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTAdditionalSettings));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTFinalText));
     }
 
-    void OFinalDBPageSetup::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OFinalDBPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBOpenAfterwards));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBStartTableWizard));
-        _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBRegisterDataSource));
-        _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBDontregisterDataSource));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pCBOpenAfterwards));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pCBStartTableWizard));
+        _rControlList.emplace_back(new OSaveValueWrapper<RadioButton>(m_pRBRegisterDataSource));
+        _rControlList.emplace_back(new OSaveValueWrapper<RadioButton>(m_pRBDontregisterDataSource));
     }
 
     void OFinalDBPageSetup::implInitControls(const SfxItemSet& /*_rSet*/, bool /*_bSaveValue*/)
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index 5f2d865f0c13..b769ccc4ac83 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -48,8 +48,8 @@ namespace dbaui
     private:
         VclPtr<CheckBox> m_pPasswordrequired;
 
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     };
 
     // OTextConnectionPage
@@ -66,8 +66,8 @@ namespace dbaui
     protected:
         virtual bool prepareLeave() override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         bool    checkTestConnection() override;
 
     private:
@@ -87,8 +87,8 @@ namespace dbaui
 
     protected:
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
     private:
         VclPtr<FixedText>          m_pFTHelpText;
@@ -117,8 +117,8 @@ namespace dbaui
         static VclPtr<OGenericAdministrationPage> Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
 
     protected:
-        virtual void fillControls( std::vector< ISaveValueWrapper* >& _rControlList ) override;
-        virtual void fillWindows( std::vector< ISaveValueWrapper* >& _rControlList ) override;
+        virtual void fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList ) override;
+        virtual void fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList ) override;
 
         virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
@@ -145,8 +145,8 @@ namespace dbaui
     private:
         virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         virtual void callModifiedHdl(void* pControl = nullptr) override;
 
         DECL_LINK(OnTestJavaClickHdl, Button*, void);
@@ -182,8 +182,8 @@ namespace dbaui
 
         virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         DECL_LINK(OnTestJavaClickHdl, Button*, void);
         DECL_LINK(OnEditModified, Edit&, void);
@@ -214,8 +214,8 @@ namespace dbaui
     protected:
         virtual bool FillItemSet(SfxItemSet* _rSet) override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
     private:
         VclPtr<RadioButton>         m_pODBCDatabase;
@@ -245,8 +245,8 @@ namespace dbaui
         VclPtr<PushButton> m_pPBTestConnection;
 
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     };
 
     // OFinalDBPageSetup
@@ -276,8 +276,8 @@ namespace dbaui
         DECL_LINK(OnOpenSelected, Button*, void);
     protected:
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     };
 
 }   // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index a26ae5b69b2f..d5520af0aaf8 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -181,25 +181,25 @@ namespace dbaui
         m_aGetExtensionHandler.Call(this);
     }
 
-    void OTextConnectionHelper::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextConnectionHelper::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new OSaveValueWrapper<ComboBox>(m_pFieldSeparator));
-        _rControlList.push_back(new OSaveValueWrapper<ComboBox>(m_pTextSeparator));
-        _rControlList.push_back(new OSaveValueWrapper<ComboBox>(m_pDecimalSeparator));
-        _rControlList.push_back(new OSaveValueWrapper<ComboBox>(m_pThousandsSeparator));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pRowHeader));
-        _rControlList.push_back(new OSaveValueWrapper<ListBox>(m_pCharSet));
+        _rControlList.emplace_back(new OSaveValueWrapper<ComboBox>(m_pFieldSeparator));
+        _rControlList.emplace_back(new OSaveValueWrapper<ComboBox>(m_pTextSeparator));
+        _rControlList.emplace_back(new OSaveValueWrapper<ComboBox>(m_pDecimalSeparator));
+        _rControlList.emplace_back(new OSaveValueWrapper<ComboBox>(m_pThousandsSeparator));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pRowHeader));
+        _rControlList.emplace_back(new OSaveValueWrapper<ListBox>(m_pCharSet));
     }
 
-    void OTextConnectionHelper::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextConnectionHelper::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFieldSeparatorLabel));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pTextSeparatorLabel));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pDecimalSeparatorLabel));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pThousandsSeparatorLabel));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pCharSetHeader));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pCharSetLabel));
-        _rControlList.push_back(new ODisableWrapper<ListBox>(m_pCharSet));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFieldSeparatorLabel));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pTextSeparatorLabel));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pDecimalSeparatorLabel));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pThousandsSeparatorLabel));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pCharSetHeader));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pCharSetLabel));
+        _rControlList.emplace_back(new ODisableWrapper<ListBox>(m_pCharSet));
     }
 
     void OTextConnectionHelper::implInitControls(const SfxItemSet& _rSet, bool _bValid)
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
index a05b95107716..7807a0e2de29 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
@@ -84,8 +84,8 @@ namespace dbaui
 
     public:
         void        implInitControls(const SfxItemSet& _rSet, bool _bValid);
-        void        fillControls(std::vector< ISaveValueWrapper* >& _rControlList);
-        void        fillWindows(std::vector< ISaveValueWrapper* >& _rControlList);
+        void        fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList);
+        void        fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList);
         void        SetClickHandler(const Link<OTextConnectionHelper*, void>& _rHandler) { m_aGetExtensionHandler = _rHandler; }
         OUString    GetExtension();
         bool        FillItemSet( SfxItemSet& rSet, const bool bChangedSomething );
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index e3cf3e7f28e6..77c3ac836a93 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -290,11 +290,11 @@ OUString OUserAdmin::GetUser()
     return m_pUSER->GetSelectedEntry();
 }
 
-void OUserAdmin::fillControls(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+void OUserAdmin::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
 {
 }
 
-void OUserAdmin::fillWindows(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+void OUserAdmin::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
 {
 }
 
diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx
index c7a1cbb96913..088454a2cf5d 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.hxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.hxx
@@ -70,10 +70,10 @@ public:
     virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
 
     // <method>OGenericAdministrationPage::fillControls</method>
-    virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+    virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
     // <method>OGenericAdministrationPage::fillWindows</method>
-    virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+    virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 };
 }
 #endif // INCLUDED_DBACCESS_SOURCE_UI_DLG_USERADMIN_HXX
diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx
index de55cbfbbe09..452fbed5791a 100644
--- a/dbaccess/source/ui/dlg/admincontrols.cxx
+++ b/dbaccess/source/ui/dlg/admincontrols.cxx
@@ -200,23 +200,23 @@ namespace dbaui
         TabPage::dispose();
     }
 
-    void MySQLNativeSettings::fillControls( std::vector< ISaveValueWrapper* >& _rControlList )
+    void MySQLNativeSettings::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pDatabaseName ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pHostName ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pPort ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pSocket ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pNamedPipe ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pDatabaseName ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pHostName ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pPort ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pSocket ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pNamedPipe ) );
     }
 
-    void MySQLNativeSettings::fillWindows( std::vector< ISaveValueWrapper* >& _rControlList )
+    void MySQLNativeSettings::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
-        _rControlList.push_back( new ODisableWrapper< FixedText >( m_pDatabaseNameLabel ) );
-        _rControlList.push_back( new ODisableWrapper< FixedText >( m_pHostNameLabel ) );
-        _rControlList.push_back( new ODisableWrapper< FixedText >( m_pPortLabel ) );
-        _rControlList.push_back( new ODisableWrapper< FixedText >( m_pDefaultPort ) );
-        _rControlList.push_back( new ODisableWrapper< RadioButton >( m_pSocketRadio ) );
-        _rControlList.push_back( new ODisableWrapper< RadioButton >( m_pNamedPipeRadio ) );
+        _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pDatabaseNameLabel ) );
+        _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pHostNameLabel ) );
+        _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pPortLabel ) );
+        _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pDefaultPort ) );
+        _rControlList.emplace_back( new ODisableWrapper< RadioButton >( m_pSocketRadio ) );
+        _rControlList.emplace_back( new ODisableWrapper< RadioButton >( m_pNamedPipeRadio ) );
     }
 
     bool MySQLNativeSettings::FillItemSet( SfxItemSet* _rSet )
diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx
index 4e7618cfa84c..6a5f6e48d325 100644
--- a/dbaccess/source/ui/dlg/admincontrols.hxx
+++ b/dbaccess/source/ui/dlg/admincontrols.hxx
@@ -57,8 +57,8 @@ namespace dbaui
         MySQLNativeSettings( vcl::Window& _rParent, const Link<void*,void>& _rControlModificationLink );
         virtual ~MySQLNativeSettings() override;
         virtual void dispose() override;
-        void fillControls( std::vector< ISaveValueWrapper* >& _rControlList );
-        void fillWindows( std::vector< ISaveValueWrapper* >& _rControlList );
+        void fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList );
+        void fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList );
 
         bool FillItemSet( SfxItemSet* _rCoreAttrs );
         void implInitControls( const SfxItemSet& _rSet );
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 31275fd1aa9d..e4912e9b21e7 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -155,7 +155,7 @@ namespace dbaui
         bool bValid, bReadonly;
         getFlags(_rSet, bValid, bReadonly);
 
-        std::vector< ISaveValueWrapper* > aControlList;
+        std::vector< std::unique_ptr<ISaveValueWrapper> > aControlList;
         if ( _bSaveValue )
         {
             fillControls(aControlList);
@@ -173,12 +173,6 @@ namespace dbaui
                 pValueWrapper->Disable();
             }
         }
-
-        for( const auto& pValueWrapper : aControlList )
-        {
-            delete pValueWrapper;
-        }
-        aControlList.clear();
     }
 
     void OGenericAdministrationPage::initializePage()
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index 65025ba24ef1..6d8fac3c44f9 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -152,16 +152,16 @@ namespace dbaui
         /** will be called inside <method>implInitControls</method> to save the value if necessary
             @param  _rControlList
                 The list must be filled with the controls.
-                It is not allowed to clear the list before pusching data into it.
+                It is not allowed to clear the list before pushing data into it.
         */
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) = 0;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) = 0;
 
         /** will be called inside <method>implInitControls</method> to disable if necessary
             @param  _rControlList
                 The list must be filled with the controls.
-                It is not allowed to clear the list before pusching data into it.
+                It is not allowed to clear the list before pushing data into it.
         */
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) = 0;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) = 0;
 
     public:
         /** fills the Boolean value into the item set when the value changed.
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 853bc86568e0..50a5bbd97b93 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -194,32 +194,32 @@ namespace dbaui
         }
     }
 
-    void SpecialSettingsPage::fillWindows( std::vector< ISaveValueWrapper* >& _rControlList )
+    void SpecialSettingsPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
         if ( m_bHasBooleanComparisonMode )
         {
-            _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) );
+            _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) );
         }
         if ( m_bHasMaxRowScan )
         {
-            _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) );
+            _rControlList.emplace_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) );
         }
     }
 
-    void SpecialSettingsPage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void SpecialSettingsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         for (auto const& booleanSetting : m_aBooleanSettings)
         {
             if ( *booleanSetting.ppControl )
             {
-                _rControlList.push_back( new OSaveValueWrapper< CheckBox >( *booleanSetting.ppControl ) );
+                _rControlList.emplace_back( new OSaveValueWrapper< CheckBox >( *booleanSetting.ppControl ) );
             }
         }
 
         if ( m_bHasBooleanComparisonMode )
-            _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) );
+            _rControlList.emplace_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) );
         if ( m_bHasMaxRowScan )
-            _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan));
+            _rControlList.emplace_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan));
     }
 
     void SpecialSettingsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -349,16 +349,16 @@ namespace dbaui
         OGenericAdministrationPage::dispose();
     }
 
-    void GeneratedValuesPage::fillWindows( std::vector< ISaveValueWrapper* >& _rControlList )
+    void GeneratedValuesPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
-        _rControlList.push_back( new ODisableWrapper< VclFrame >( m_pAutoFrame ) );
+        _rControlList.emplace_back( new ODisableWrapper< VclFrame >( m_pAutoFrame ) );
     }
 
-    void GeneratedValuesPage::fillControls( std::vector< ISaveValueWrapper* >& _rControlList )
+    void GeneratedValuesPage::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
     {
-        _rControlList.push_back( new OSaveValueWrapper< CheckBox >( m_pAutoRetrievingEnabled ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pAutoIncrement ) );
-        _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pAutoRetrieving ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< CheckBox >( m_pAutoRetrievingEnabled ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pAutoIncrement ) );
+        _rControlList.emplace_back( new OSaveValueWrapper< Edit >( m_pAutoRetrieving ) );
     }
 
     void GeneratedValuesPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue )
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 233502b18635..915f42e265a9 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -83,10 +83,10 @@ namespace dbaui
         virtual void implInitControls (const SfxItemSet& _rSet, bool _bSaveValue ) override;
 
         // <method>OGenericAdministrationPage::fillControls</method>
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         // <method>OGenericAdministrationPage::fillWindows</method>
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         void    impl_initBooleanSettings();
         DECL_LINK(BooleanComparisonSelectHdl, ListBox&, void);
@@ -119,10 +119,10 @@ namespace dbaui
         virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
 
         // <method>OGenericAdministrationPage::fillControls</method>
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         // <method>OGenericAdministrationPage::fillWindows</method>
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     };
 
 }
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index e5300105392a..9beed456ef11 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -116,25 +116,25 @@ namespace dbaui
         OGenericAdministrationPage::dispose();
     }
 
-    void OCommonBehaviourTabPage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OCommonBehaviourTabPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions)
         {
-            _rControlList.push_back(new ODisableWrapper<FixedText>(m_pOptionsLabel));
+            _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pOptionsLabel));
         }
 
         if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset)
         {
-            _rControlList.push_back(new ODisableWrapper<FixedText>(m_pCharsetLabel));
+            _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pCharsetLabel));
         }
     }
-    void OCommonBehaviourTabPage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OCommonBehaviourTabPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions)
-            _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pOptions));
+            _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pOptions));
 
         if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset)
-            _rControlList.push_back(new OSaveValueWrapper<ListBox>(m_pCharset));
+            _rControlList.emplace_back(new OSaveValueWrapper<ListBox>(m_pCharset));
     }
 
     void OCommonBehaviourTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -360,18 +360,18 @@ namespace dbaui
 
         return bChangedSomething;
     }
-    void OUserDriverDetailsPage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OUserDriverDetailsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillControls(_rControlList);
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pEDHostname));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pUseCatalog));
-        _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pEDHostname));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pUseCatalog));
+        _rControlList.emplace_back(new OSaveValueWrapper<NumericField>(m_pNFPortNumber));
     }
-    void OUserDriverDetailsPage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OUserDriverDetailsPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillWindows(_rControlList);
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHostname));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pPortNumber));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pFTHostname));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pPortNumber));
     }
     void OUserDriverDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
     {
@@ -585,22 +585,22 @@ namespace dbaui
         OCommonBehaviourTabPage::dispose();
     }
 
-    void MySQLNativePage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void MySQLNativePage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillControls( _rControlList );
         m_aMySQLSettings->fillControls( _rControlList );
 
-        _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pUserName));
-        _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pPasswordRequired));
+        _rControlList.emplace_back(new OSaveValueWrapper<Edit>(m_pUserName));
+        _rControlList.emplace_back(new OSaveValueWrapper<CheckBox>(m_pPasswordRequired));
     }
-    void MySQLNativePage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void MySQLNativePage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillWindows( _rControlList );
         m_aMySQLSettings->fillWindows( _rControlList);
 
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator1));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator2));
-        _rControlList.push_back(new ODisableWrapper<FixedText>(m_pUserNameLabel));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pSeparator1));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pSeparator2));
+        _rControlList.emplace_back(new ODisableWrapper<FixedText>(m_pUserNameLabel));
     }
 
     bool MySQLNativePage::FillItemSet( SfxItemSet* _rSet )
@@ -769,13 +769,13 @@ namespace dbaui
         return VclPtr<OTextDetailsPage>::Create( pParent.pParent, *_rAttrSet );
     }
 
-    void OTextDetailsPage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextDetailsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillControls(_rControlList);
         m_pTextConnectionHelper->fillControls(_rControlList);
 
     }
-    void OTextDetailsPage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTextDetailsPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
         OCommonBehaviourTabPage::fillWindows(_rControlList);
         m_pTextConnectionHelper->fillWindows(_rControlList);
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index eb76ce72fb8f..4d008efbede1 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -82,10 +82,10 @@ namespace dbaui
         virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
 
         // <method>OGenericAdministrationPage::fillControls</method>
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         // <method>OGenericAdministrationPage::fillWindows</method>
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     private:
         DECL_LINK(CharsetSelectHdl, ListBox&, void);
     };
@@ -146,8 +146,8 @@ namespace dbaui
         virtual void dispose() override;
     protected:
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     private:
         VclPtr<FixedText>          m_pFTHostname;
         VclPtr<Edit>               m_pEDHostname;
@@ -218,8 +218,8 @@ namespace dbaui
     protected:
         virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
     };
 
     // OOdbcDetailsPage
@@ -259,8 +259,8 @@ namespace dbaui
         virtual bool prepareLeave() override;
 
         virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
     private:
     };
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 770ef2af7e3b..129583a7f8e3 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -351,14 +351,14 @@ namespace dbaui
         m_aEmbeddedURLPrefixes[nPos] = _sType;
     }
 
-    void OGeneralPage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OGeneralPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back( new ODisableWrapper<FixedText>( m_pSpecialMessage ) );
+        _rControlList.emplace_back( new ODisableWrapper<FixedText>( m_pSpecialMessage ) );
     }
 
-    void OGeneralPage::fillControls(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OGeneralPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back( new OSaveValueWrapper<ListBox>( m_pDatasourceType ) );
+        _rControlList.emplace_back( new OSaveValueWrapper<ListBox>( m_pDatasourceType ) );
     }
 
     void OGeneralPage::implSetCurrentType( const OUString& _eType )
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index e8a3f444806a..b5b22ec38b89 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -80,9 +80,9 @@ namespace dbaui
         virtual bool approveDatasourceType( ::dbaccess::DATASOURCE_TYPE eType, OUString& _inout_rDisplayName );
 
         // <method>OGenericAdministrationPage::fillControls</method>
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         // <method>OGenericAdministrationPage::fillWindows</method>
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         void onTypeSelected(const OUString& _sURLPrefix);
         void initializeTypeList();
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index ac348069c0e5..ae2586762f24 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -558,13 +558,13 @@ namespace dbaui
         return true;
     }
 
-    void OTableSubscriptionPage::fillControls(std::vector< ISaveValueWrapper* >& /*_rControlList*/)
+    void OTableSubscriptionPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
     {
     }
 
-    void OTableSubscriptionPage::fillWindows(std::vector< ISaveValueWrapper* >& _rControlList)
+    void OTableSubscriptionPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
     {
-        _rControlList.push_back(new ODisableWrapper<VclContainer>(m_pTables));
+        _rControlList.emplace_back(new ODisableWrapper<VclContainer>(m_pTables));
     }
 }   // namespace dbaui
 
diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx
index 46c098d6e2f1..aaaebdb01acb 100644
--- a/dbaccess/source/ui/dlg/tablespage.hxx
+++ b/dbaccess/source/ui/dlg/tablespage.hxx
@@ -60,8 +60,8 @@ namespace dbaui
         virtual void dispose() override;
 
     private:
-        virtual void fillControls(std::vector< ISaveValueWrapper* >& _rControlList) override;
-        virtual void fillWindows(std::vector< ISaveValueWrapper* >& _rControlList) override;
+        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
+        virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
 
         DECL_LINK( OnTreeEntryCompare, const SvSortData&, sal_Int32 );
         DECL_LINK( OnTreeEntryChecked, void*, void );
commit d34098cdb98966e537d9c500e34c8719c21094a8
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 7 09:59:09 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Sep 8 19:27:59 2018 +0200

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

diff --git a/filter/source/graphicfilter/icgm/bundles.hxx b/filter/source/graphicfilter/icgm/bundles.hxx
index ba0740afdb45..36f45393ea3d 100644
--- a/filter/source/graphicfilter/icgm/bundles.hxx
+++ b/filter/source/graphicfilter/icgm/bundles.hxx
@@ -23,6 +23,7 @@
 #include <sal/types.h>
 #include "cgmtypes.hxx"
 #include <vcl/salbtype.hxx>
+#include <o3tl/make_unique.hxx>
 #include <vector>
 #include <memory>
 
@@ -44,7 +45,7 @@ public:
         , mnColor( 0 )
         {};
 
-    virtual Bundle*     Clone() { return new Bundle( *this ); };
+    virtual std::unique_ptr<Bundle> Clone() { return o3tl::make_unique<Bundle>( *this ); };
 
     virtual            ~Bundle() {} ;
 
@@ -67,7 +68,7 @@ public:
         , nLineWidth(0)
     {}
 
-    virtual Bundle* Clone() override { return new LineBundle( *this ); }
+    virtual std::unique_ptr<Bundle> Clone() override { return o3tl::make_unique<LineBundle>( *this ); }
 };
 
 
@@ -83,7 +84,7 @@ public:
         , nMarkerSize( 0.0 )
         {};
 
-    virtual Bundle*     Clone() override { return new MarkerBundle( *this ); } ;
+    virtual std::unique_ptr<Bundle> Clone() override { return o3tl::make_unique<MarkerBundle>( *this ); } ;
 };
 
 
@@ -98,7 +99,7 @@ public:
         : eEdgeType(ET_NONE)
         , nEdgeWidth(0)
     {}
-    virtual Bundle*     Clone() override { return new EdgeBundle( *this ); }
+    virtual std::unique_ptr<Bundle> Clone() override { return o3tl::make_unique<EdgeBundle>( *this ); }
 };
 
 
@@ -118,7 +119,7 @@ public:
         , nCharacterSpacing( 0.0 )
         {};
 
-    virtual Bundle*     Clone() override { return new TextBundle( *this ); } ;
+    virtual std::unique_ptr<Bundle> Clone() override { return o3tl::make_unique<TextBundle>( *this ); } ;
 };
 
 
@@ -135,7 +136,7 @@ public:
         , nFillPatternIndex(0)
         , nFillHatchIndex(0)
     {}
-    virtual Bundle*     Clone() override { return new FillBundle( *this ); }
+    virtual std::unique_ptr<Bundle> Clone() override { return o3tl::make_unique<FillBundle>( *this ); }
 };
 
 
diff --git a/filter/source/graphicfilter/icgm/elements.cxx b/filter/source/graphicfilter/icgm/elements.cxx
index 609128e11585..4449785988e4 100644
--- a/filter/source/graphicfilter/icgm/elements.cxx
+++ b/filter/source/graphicfilter/icgm/elements.cxx
@@ -29,11 +29,6 @@ CGMElements::CGMElements()
 
 CGMElements::~CGMElements()
 {
-    DeleteAllBundles( aLineList );
-    DeleteAllBundles( aMarkerList );
-    DeleteAllBundles( aEdgeList );
-    DeleteAllBundles( aTextList );
-    DeleteAllBundles( aFillList );
 }
 
 
@@ -290,23 +285,13 @@ void CGMElements::ImplInsertHatch( sal_Int32 nKey, int nStyle, long nDistance, l
 }
 
 
-void CGMElements::DeleteAllBundles( BundleList& rList )
-{
-    for (Bundle* i : rList) {
-        delete i;
-    }
-    rList.clear();
-};
-
-
 void CGMElements::CopyAllBundles( const BundleList& rSource, BundleList& rDest )
 {
-    DeleteAllBundles( rDest );
+    rDest.clear();
 
-    for (Bundle* pPtr : rSource)
+    for (auto & pPtr : rSource)
     {
-        Bundle* pTempBundle = pPtr->Clone();
-        rDest.push_back( pTempBundle );
+        rDest.push_back( pPtr->Clone() );
     }
 };
 
@@ -323,9 +308,9 @@ Bundle* CGMElements::GetBundleIndex( long nIndex, BundleList& rList, Bundle& rBu
 
 Bundle* CGMElements::GetBundle( BundleList& rList, long nIndex )
 {
-    for (Bundle* i : rList) {
+    for (auto const & i : rList) {
         if ( i->GetIndex() == nIndex ) {
-            return i;
+            return i.get();
         }
     }
     return nullptr;
@@ -338,16 +323,14 @@ Bundle* CGMElements::InsertBundle( BundleList& rList, Bundle& rBundle )
     if ( pBundle )
     {
         for ( BundleList::iterator it = rList.begin(); it != rList.end(); ++it ) {
-            if ( *it == pBundle ) {
+            if ( it->get() == pBundle ) {
                 rList.erase( it );
-                delete pBundle;
                 break;
             }
         }
     }
-    pBundle = rBundle.Clone();
-    rList.push_back( pBundle );
-    return pBundle;
+    rList.push_back( rBundle.Clone() );
+    return rList.back().get();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/icgm/elements.hxx b/filter/source/graphicfilter/icgm/elements.hxx
index 8356e0d6deb5..bfcba6156416 100644
--- a/filter/source/graphicfilter/icgm/elements.hxx
+++ b/filter/source/graphicfilter/icgm/elements.hxx
@@ -26,7 +26,7 @@
 
 #define nBackGroundColor    aColorTable[ 0 ]
 
-typedef ::std::vector< Bundle* > BundleList;
+typedef ::std::vector< std::unique_ptr<Bundle> > BundleList;
 
 class CGMElements
 {
@@ -132,7 +132,6 @@ class CGMElements
         static Bundle*      GetBundleIndex( long nIndex, BundleList&, Bundle& );
         static Bundle*      GetBundle( BundleList& rList, long nIndex );
         static Bundle*      InsertBundle( BundleList&, Bundle& );
-        static void         DeleteAllBundles( BundleList& );
         static void         CopyAllBundles( const BundleList& Source, BundleList& Dest );
 };
 


More information about the Libreoffice-commits mailing list