diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-08-02 10:43:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-08-02 15:05:34 +0200 |
commit | 2598f8a127c6ce2ec85a0d1ae1b1c706951e4e9d (patch) | |
tree | a8c3c56aa67e9b94bf00d65f392cd4bb5326bec9 | |
parent | 4cb2fb91d4f70940c1656716e59cdee5e6b6b592 (diff) |
dispose MySQLNativePage
Change-Id: I2506d08b8c2e5b501bccb8b5ef2e6d829a912852
Reviewed-on: https://gerrit.libreoffice.org/76854
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.hxx | 3 |
2 files changed, 13 insertions, 6 deletions
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index b8453c87f6bf..4f23ef8737fb 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -502,7 +502,7 @@ namespace dbaui MySQLNativePage::MySQLNativePage(TabPageParent pParent, const SfxItemSet& rCoreAttrs) : OCommonBehaviourTabPage(pParent, "dbaccess/ui/mysqlnativepage.ui", "MysqlNativePage", rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) , m_xMySQLSettingsContainer(m_xBuilder->weld_widget("MySQLSettingsContainer")) - , m_aMySQLSettings(m_xMySQLSettingsContainer.get(), LINK(this,OGenericAdministrationPage,OnControlModified)) + , m_xMySQLSettings(new MySQLNativeSettings(m_xMySQLSettingsContainer.get(), LINK(this,OGenericAdministrationPage,OnControlModified))) , m_xSeparator1(m_xBuilder->weld_label("connectionheader")) , m_xSeparator2(m_xBuilder->weld_label("userheader")) , m_xUserNameLabel(m_xBuilder->weld_label("usernamelabel")) @@ -512,6 +512,12 @@ namespace dbaui m_xUserName->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl)); } + void MySQLNativePage::dispose() + { + m_xMySQLSettings.reset(); + OCommonBehaviourTabPage::dispose(); + } + MySQLNativePage::~MySQLNativePage() { disposeOnce(); @@ -520,7 +526,7 @@ namespace dbaui void MySQLNativePage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) { OCommonBehaviourTabPage::fillControls( _rControlList ); - m_aMySQLSettings.fillControls( _rControlList ); + m_xMySQLSettings->fillControls( _rControlList ); _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xUserName.get())); _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::ToggleButton>(m_xPasswordRequired.get())); @@ -529,7 +535,7 @@ namespace dbaui void MySQLNativePage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) { OCommonBehaviourTabPage::fillWindows( _rControlList ); - m_aMySQLSettings.fillWindows( _rControlList); + m_xMySQLSettings->fillWindows( _rControlList); _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xSeparator1.get())); _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xSeparator2.get())); @@ -540,7 +546,7 @@ namespace dbaui { bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet ); - bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); + bChangedSomething |= m_xMySQLSettings->FillItemSet( _rSet ); if (m_xUserName->get_value_changed_from_saved()) { @@ -558,7 +564,7 @@ namespace dbaui bool bValid, bReadonly; getFlags(_rSet, bValid, bReadonly); - m_aMySQLSettings.implInitControls( _rSet ); + m_xMySQLSettings->implInitControls( _rSet ); const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER); const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index af535194ee20..ead3a3af6c24 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -194,11 +194,12 @@ namespace dbaui { public: MySQLNativePage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); + virtual void dispose() override; virtual ~MySQLNativePage() override; private: std::unique_ptr<weld::Widget> m_xMySQLSettingsContainer; - MySQLNativeSettings m_aMySQLSettings; + std::unique_ptr<MySQLNativeSettings> m_xMySQLSettings; std::unique_ptr<weld::Label> m_xSeparator1; std::unique_ptr<weld::Label> m_xSeparator2; std::unique_ptr<weld::Label> m_xUserNameLabel; |