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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 25 07:57:45 UTC 2018


 dbaccess/source/ui/dlg/ConnectionPageSetup.cxx |  139 +------------------------
 dbaccess/source/ui/dlg/ConnectionPageSetup.hxx |   41 -------
 dbaccess/source/ui/dlg/dbwizsetup.cxx          |   12 +-
 3 files changed, 21 insertions(+), 171 deletions(-)

New commits:
commit a8c1835911450211493f3cddc10c3ccc1455c43a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 24 16:17:44 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 25 09:57:16 2018 +0200

    drop unused stuff
    
    Change-Id: Icd92801dc88c603c369bfb6c85bf4278ea609ea9
    Reviewed-on: https://gerrit.libreoffice.org/62324
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index c98b80289240..fa11988bca04 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -61,148 +61,29 @@ namespace dbaui
     using namespace ::dbtools;
     using namespace ::svt;
 
-    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
     {
-        return VclPtr<OConnectionTabPageSetup>::Create ( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
+        return VclPtr<DBOConnectionTabPageSetup>::Create ( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
     }
 
-    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
     {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
+        return VclPtr<DBOConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
     }
 
-    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
     {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
+        return VclPtr<DBOConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
     }
 
-    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
     {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
+        return VclPtr<DBOConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
     }
 
-    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
     {
-        return VclPtr<OConnectionTabPageSetup>::Create(pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
-    }
-
-    OConnectionTabPageSetup::OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId)
-        :OConnectionHelper(pParent, _rId, _rUIXMLDescription, _rCoreAttrs)
-    {
-        get(m_pHelpText, "helptext");
-        get(m_pHeaderText, "header");
-
-        if (pHelpTextResId != nullptr)
-        {
-            OUString sHelpText = DBA_RES(pHelpTextResId);
-            m_pHelpText->SetText(sHelpText);
-        }
-        else
-            m_pHelpText->Hide();
-
-        if (pHeaderResId != nullptr)
-            m_pHeaderText->SetText(DBA_RES(pHeaderResId));
-
-        if (pUrlResId != nullptr)
-        {
-            OUString sLabelText = DBA_RES(pUrlResId);
-            m_pFT_Connection->SetText(sLabelText);
-        }
-        else
-            m_pFT_Connection->Hide();
-
-        m_pConnectionURL->SetModifyHdl(LINK(this, OConnectionTabPageSetup, OnEditModified));
-
-        SetRoadmapStateValue(false);
-    }
-
-    OConnectionTabPageSetup::~OConnectionTabPageSetup()
-    {
-        disposeOnce();
-    }
-
-    void OConnectionTabPageSetup::dispose()
-    {
-        m_pHelpText.clear();
-        m_pHeaderText.clear();
-        OConnectionHelper::dispose();
-    }
-
-    void OConnectionTabPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
-    {
-        m_eType = m_pAdminDialog->getDatasourceType(_rSet);
-        // special handling for oracle, this can only happen
-        // if the user enters the same url as used for Oracle and we are on the JDBC path
-        //! TODO
-        //if (  ::dbaccess::DST_ORACLE_JDBC == m_eType )
-        //    m_eType =  ::dbaccess::DST_JDBC;
-        if(m_pCollection->determineType(m_eType) == ::dbaccess::DST_POSTGRES){
-            SetRoadmapStateValue(true);
-        }
-
-        OConnectionHelper::implInitControls(_rSet, _bSaveValue);
-
-        //! TODO
-        //if ( m_eType >=  ::dbaccess::DST_USERDEFINE1 )
-        //{
-        //  OUString sDisplayName = m_pCollection->getTypeDisplayName(m_eType);
-        //  FixedText* ppTextControls[] ={&m_aFT_Connection};
-        //  for (size_t i = 0; i < sizeof(ppTextControls)/sizeof(ppTextControls[0]); ++i)
-        //  {
-        //      ppTextControls[i]->SetText(sDisplayName);
-        //  }
-        //}
-
-        callModifiedHdl();
-    }
-
-    bool OConnectionTabPageSetup::commitPage( ::svt::WizardTypes::CommitPageReason /*_eReason*/ )
-    {
-        return commitURL();
-    }
-
-    bool OConnectionTabPageSetup::FillItemSet(SfxItemSet* _rSet)
-    {
-        bool bChangedSomething = false;
-        fillString(*_rSet,m_pConnectionURL, DSID_CONNECTURL, bChangedSomething);
-        return bChangedSomething;
-    }
-    bool OConnectionTabPageSetup::checkTestConnection()
-    {
-        if ( m_pCollection->determineType(m_eType) ==  ::dbaccess::DST_POSTGRES )
-            return true;
-        return !m_pConnectionURL->IsVisible() || !m_pConnectionURL->GetTextNoPrefix().isEmpty();
-    }
-
-    IMPL_LINK_NOARG(OConnectionTabPageSetup, OnEditModified, Edit&, void)
-    {
-        SetRoadmapStateValue(checkTestConnection());
-        callModifiedHdl();
-    }
-
-    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
-    {
-        return VclPtr<OConnectionTabPageSetup>::Create ( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
-    }
-
-    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
-    {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
-    }
-
-    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
-    {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
-    }
-
-    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
-    {
-        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
-    }
-
-    VclPtr<OGenericAdministrationPage> DBOConnectionTabPageSetup::CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
-    {
-        return VclPtr<OConnectionTabPageSetup>::Create(pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
+        return VclPtr<DBOConnectionTabPageSetup>::Create(pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
     }
 
     DBOConnectionTabPageSetup::DBOConnectionTabPageSetup(TabPageParent pParent, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId)
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
index 8a5c5fdeb4ca..79b7f053537f 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
@@ -34,37 +34,6 @@ namespace dbaui
 
     /** implements the connection page of the data source properties dialog.
     */
-    class OConnectionTabPageSetup : public OConnectionHelper
-    {
-        friend class VclPtr<OConnectionTabPageSetup>;
-    protected:
-
-        VclPtr<FixedText>           m_pHelpText;
-        VclPtr<FixedText>           m_pHeaderText;
-
-        // called when the test connection button was clicked
-        DECL_LINK(OnEditModified, Edit&, void);
-
-    public:
-        virtual ~OConnectionTabPageSetup() override;
-        virtual void dispose() override;
-        static  VclPtr<OGenericAdministrationPage> CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-
-        virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;
-
-        virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
-        virtual bool        commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;
-
-    protected:
-        OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId);
-        virtual bool checkTestConnection() override;
-            // nControlFlags is a combination of the CBTP_xxx-constants
-    };
-
     class DBOConnectionTabPageSetup : public DBOConnectionHelper
     {
         friend class VclPtr<DBOConnectionTabPageSetup>;
@@ -78,11 +47,11 @@ namespace dbaui
 
     public:
         virtual ~DBOConnectionTabPageSetup() override;
-        static  VclPtr<OGenericAdministrationPage> CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
-        static  VclPtr<OGenericAdministrationPage> CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+        static  VclPtr<OGenericAdministrationPage> CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
+        static  VclPtr<OGenericAdministrationPage> CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
+        static  VclPtr<OGenericAdministrationPage> CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
+        static  VclPtr<OGenericAdministrationPage> CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
+        static  VclPtr<OGenericAdministrationPage> CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
 
         virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;
 
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 17565955523b..2d75c52962b2 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -471,11 +471,11 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
             break;
 
         case PAGE_DBSETUPWIZARD_DBASE:
-            pPage = OConnectionTabPageSetup::CreateDbaseTabPage(this,*m_pOutSet);
+            pPage = DBOConnectionTabPageSetup::CreateDbaseTabPage(this,*m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_ADO:
-            pPage = OConnectionTabPageSetup::CreateADOTabPage( this, *m_pOutSet);
+            pPage = DBOConnectionTabPageSetup::CreateADOTabPage( this, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_TEXT:
@@ -483,7 +483,7 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
             break;
 
         case PAGE_DBSETUPWIZARD_ODBC:
-            pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
+            pPage = DBOConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_JDBC:
@@ -492,7 +492,7 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
 
         case PAGE_DBSETUPWIZARD_MYSQL_ODBC:
             m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:odbc:")));
-            pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
+            pPage = DBOConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_MYSQL_JDBC:
@@ -517,7 +517,7 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
             break;
 
         case PAGE_DBSETUPWIZARD_MSACCESS:
-            pPage  = OConnectionTabPageSetup::CreateMSAccessTabPage(this,*m_pOutSet);
+            pPage  = DBOConnectionTabPageSetup::CreateMSAccessTabPage(this,*m_pOutSet);
             break;
         case PAGE_DBSETUPWIZARD_MYSQL_INTRO:
             m_pMySQLIntroPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(this,*m_pOutSet);
@@ -530,7 +530,7 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
             break;
 
         case PAGE_DBSETUPWIZARD_USERDEFINED:
-            pPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(this,*m_pOutSet);
+            pPage = DBOConnectionTabPageSetup::CreateUserDefinedTabPage(this,*m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_FINAL:


More information about the Libreoffice-commits mailing list