diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-16 15:29:28 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 21:34:32 +0100 |
commit | 97eacd1d5581395de8801e5ba962044132575218 (patch) | |
tree | 05d4996a45cfd479e16f8bfacf33d7b40b5d368b /dbaccess/source/ui/dlg | |
parent | 7f7617765cf1f4a16022f47fedb018bf49802a08 (diff) |
vcl: VclPtr conversion in dbaccess
Change-Id: I85fce0403121ffe55204d78445e4809960ec404a
Diffstat (limited to 'dbaccess/source/ui/dlg')
43 files changed, 228 insertions, 169 deletions
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index f437d31d9f58..02410b96681f 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -91,11 +91,6 @@ OCollectionView::OCollectionView( vcl::Window * pParent m_pPB_OK->SetClickHdl( LINK( this, OCollectionView, Save_Click ) ); } -OCollectionView::~OCollectionView( ) -{ -} - - IMPL_LINK_NOARG(OCollectionView, Save_Click) { OUString sName = m_pName->GetText(); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index a02b5d68b80b..96e158fde04f 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -110,6 +110,11 @@ namespace dbaui OConnectionHelper::~OConnectionHelper() { + dispose(); + } + + void OConnectionHelper::dispose() + { if(m_bDelete) { delete m_pFT_Connection; @@ -117,6 +122,7 @@ namespace dbaui delete m_pPB_Connection; delete m_pPB_CreateDB; } + OGenericAdministrationPage::dispose(); } void OConnectionHelper::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 117295bea89d..5d9ae8beb4e3 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -42,6 +42,7 @@ namespace dbaui public: OConnectionHelper( vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs); virtual ~OConnectionHelper(); + virtual void dispose() SAL_OVERRIDE; FixedText *m_pFT_Connection; OConnectionURLEdit *m_pConnectionURL; PushButton *m_pPB_Connection; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 4e7b8cc39987..f33b1e44b4fe 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -109,10 +109,6 @@ namespace dbaui m_pTestJavaDriver->SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); } - OConnectionTabPage::~OConnectionTabPage() - { - } - void OConnectionTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index 5e1c84fb88a1..9713621dfd25 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -70,7 +70,6 @@ namespace dbaui private: OConnectionTabPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); // nControlFlags is a combination of the CBTP_xxx-constants - virtual ~OConnectionTabPage(); private: /** enables the test connection button, if allowed diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index db19ebb9d21b..ce72b8d20405 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -119,10 +119,6 @@ namespace dbaui SetRoadmapStateValue(false); } - OConnectionTabPageSetup::~OConnectionTabPageSetup() - { - } - void OConnectionTabPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { m_eType = m_pAdminDialog->getDatasourceType(_rSet); diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index 5705c1530cc2..b417c7882125 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -71,7 +71,6 @@ namespace dbaui OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId); virtual bool checkTestConnection() SAL_OVERRIDE; // nControlFlags is a combination of the CBTP_xxx-constants - virtual ~OConnectionTabPageSetup(); }; } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 523b1aa9278d..394073e7472f 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -76,8 +76,13 @@ using namespace ::com::sun::star; OTextConnectionPageSetup::~OTextConnectionPageSetup() { - DELETEZ(m_pTextConnectionHelper); + dispose(); + } + void OTextConnectionPageSetup::dispose() + { + DELETEZ(m_pTextConnectionHelper); + OConnectionTabPageSetup::dispose(); } IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/) @@ -241,11 +246,6 @@ using namespace ::com::sun::star; return long(true); } - OMySQLIntroPageSetup::~OMySQLIntroPageSetup() - { - - } - void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/) { // show the "Connect directly" option only if the driver is installed @@ -292,14 +292,25 @@ using namespace ::com::sun::star; // MySQLNativeSetupPage MySQLNativeSetupPage::MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs ) :OGenericAdministrationPage( _pParent, "DBWizMysqlNativePage", "dbaccess/ui/dbwizmysqlnativepage.ui", _rCoreAttrs ) - ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() ) + ,m_aMySQLSettings ( new MySQLNativeSettings(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) ) { get(m_pHelpText, "helptext"); - m_aMySQLSettings.Show(); + m_aMySQLSettings->Show(); SetRoadmapStateValue(false); } + MySQLNativeSetupPage::~MySQLNativeSetupPage() + { + dispose(); + } + + void MySQLNativeSetupPage::dispose() + { + m_aMySQLSettings.disposeAndClear(); + OGenericAdministrationPage::dispose(); + } + OGenericAdministrationPage* MySQLNativeSetupPage::Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet ) { return new MySQLNativeSetupPage( pParent, _rAttrSet ); @@ -307,23 +318,23 @@ using namespace ::com::sun::star; void MySQLNativeSetupPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ) { - m_aMySQLSettings.fillControls( _rControlList ); + m_aMySQLSettings->fillControls( _rControlList ); } void MySQLNativeSetupPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ) { _rControlList.push_back( new ODisableWrapper< FixedText >( m_pHelpText ) ); - m_aMySQLSettings.fillWindows( _rControlList ); + m_aMySQLSettings->fillWindows( _rControlList ); } bool MySQLNativeSetupPage::FillItemSet( SfxItemSet* _rSet ) { - return m_aMySQLSettings.FillItemSet( _rSet ); + return m_aMySQLSettings->FillItemSet( _rSet ); } void MySQLNativeSetupPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue ) { - m_aMySQLSettings.implInitControls( _rSet ); + m_aMySQLSettings->implInitControls( _rSet ); OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue ); @@ -337,7 +348,7 @@ using namespace ::com::sun::star; IMPL_LINK( MySQLNativeSetupPage, OnModified, Edit*, _pEdit ) { - SetRoadmapStateValue( m_aMySQLSettings.canAdvance() ); + SetRoadmapStateValue( m_aMySQLSettings->canAdvance() ); return OGenericAdministrationPage::getControlModifiedLink().Call( _pEdit ); } @@ -634,11 +645,6 @@ using namespace ::com::sun::star; m_pPasswordrequired->SetToggleHdl(getControlModifiedLink()); } - OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup() - { - - } - void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) { } @@ -683,11 +689,6 @@ using namespace ::com::sun::star; LayoutHelper::fitSizeRightAligned( *m_pPBTestConnection ); } - OAuthentificationPageSetup::~OAuthentificationPageSetup() - { - - } - void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTHelpText)); @@ -753,11 +754,6 @@ using namespace ::com::sun::star; m_pRBRegisterDataSource->SetState(true); } - OFinalDBPageSetup::~OFinalDBPageSetup() - { - - } - bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered() { return m_pRBRegisterDataSource->IsChecked() && m_pRBRegisterDataSource->IsEnabled(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 4756b6c75b57..3b3ed06b8bd5 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -45,7 +45,6 @@ namespace dbaui protected: CheckBox *m_pPasswordrequired; - virtual ~OSpreadSheetConnectionPageSetup(); protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -66,6 +65,7 @@ namespace dbaui protected: virtual ~OTextConnectionPageSetup(); + virtual void dispose() SAL_OVERRIDE; virtual bool prepareLeave() SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; @@ -108,10 +108,12 @@ namespace dbaui { private: FixedText *m_pHelpText; - MySQLNativeSettings m_aMySQLSettings; + VclPtr<MySQLNativeSettings> m_aMySQLSettings; public: MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~MySQLNativeSetupPage(); + virtual void dispose() SAL_OVERRIDE; static OGenericAdministrationPage* Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet ); @@ -216,7 +218,6 @@ namespace dbaui virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; - virtual ~OMySQLIntroPageSetup(); private: RadioButton *m_pODBCDatabase; @@ -241,7 +242,6 @@ namespace dbaui Edit* m_pETUserName; CheckBox* m_pCBPasswordRequired; PushButton* m_pPBTestConnection; - virtual ~OAuthentificationPageSetup(); protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -276,9 +276,6 @@ namespace dbaui DECL_LINK(OnOpenSelected, CheckBox*); protected: - virtual ~OFinalDBPageSetup(); - - protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx index 2c8b9b68ab48..cfdab7758b35 100644 --- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx +++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx @@ -28,10 +28,6 @@ QueryPropertiesDialog::QueryPropertiesDialog( m_pLB_Limit->SetValue( nLimit ); } -QueryPropertiesDialog::~QueryPropertiesDialog() -{ -} - } ///dbaui namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index 28d33723dae6..f0626ae3f698 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -132,10 +132,6 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD } } -ORelationDialog::~ORelationDialog() -{ -} - IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) { // RadioButtons auslesen diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index a4a51e3d2623..149486427a74 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -61,7 +61,13 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent OTableSubscriptionDialog::~OTableSubscriptionDialog() { + dispose(); +} + +void OTableSubscriptionDialog::dispose() +{ delete m_pOutSet; + SfxSingleTabDialog::dispose(); } short OTableSubscriptionDialog::Execute() diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index c99292a925ef..c10751766928 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -151,11 +151,6 @@ namespace dbaui Show(); } - OTextConnectionHelper::~OTextConnectionHelper() - { - - } - IMPL_LINK(OTextConnectionHelper, OnControlModified, Control*, /*EMPTYARG*/) { callModifiedHdl(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index b9317f8b46b6..03dde73cc6dd 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -48,7 +48,6 @@ namespace dbaui public: OTextConnectionHelper( vcl::Window* pParent, const short _nAvailableSections ); - virtual ~OTextConnectionHelper(); private: FixedText *m_pExtensionHeader; diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 6afe53364b3b..f776e80e4040 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -114,9 +114,9 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet) , m_pNEWUSER(0) , m_pCHANGEPWD(0) , m_pDELETEUSER(0) - ,m_TableCtrl(get<VclAlignment>("table"), WB_TABSTOP) + ,m_TableCtrl(new OTableGrantControl(get<VclAlignment>("table"), WB_TABSTOP)) { - m_TableCtrl.Show(); + m_TableCtrl->Show(); get(m_pUSER, "user"); get(m_pNEWUSER, "add"); get(m_pCHANGEPWD, "changepass"); @@ -131,7 +131,14 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet) OUserAdmin::~OUserAdmin() { + dispose(); +} + +void OUserAdmin::dispose() +{ m_xConnection = NULL; + m_TableCtrl.disposeAndClear(); + OGenericAdministrationPage::dispose(); } void OUserAdmin::FillUserNames() @@ -162,11 +169,11 @@ void OUserAdmin::FillUserNames() { Reference<XAuthorizable> xAuth; m_xUsers->getByName(m_UserName) >>= xAuth; - m_TableCtrl.setGrantUser(xAuth); + m_TableCtrl->setGrantUser(xAuth); } - m_TableCtrl.setUserName(GetUser()); - m_TableCtrl.Init(); + m_TableCtrl->setUserName(GetUser()); + m_TableCtrl->Init(); } } } @@ -177,7 +184,7 @@ void OUserAdmin::FillUserNames() m_pDELETEUSER->Enable(xDrop.is()); m_pCHANGEPWD->Enable(m_xUsers.is()); - m_TableCtrl.Enable(m_xUsers.is()); + m_TableCtrl->Enable(m_xUsers.is()); } @@ -261,10 +268,10 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) { - m_TableCtrl.setUserName(GetUser()); - m_TableCtrl.UpdateTables(); - m_TableCtrl.DeactivateCell(); - m_TableCtrl.ActivateCell(m_TableCtrl.GetCurRow(),m_TableCtrl.GetCurColumnId()); + m_TableCtrl->setUserName(GetUser()); + m_TableCtrl->UpdateTables(); + m_TableCtrl->DeactivateCell(); + m_TableCtrl->ActivateCell(m_TableCtrl->GetCurRow(),m_TableCtrl->GetCurColumnId()); return 0; } @@ -283,7 +290,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) { - m_TableCtrl.setComponentContext(m_xORB); + m_TableCtrl->setComponentContext(m_xORB); try { if ( !m_xConnection.is() && m_pAdminDialog ) @@ -302,7 +309,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) } if ( xUsersSup.is() ) { - m_TableCtrl.setTablesSupplier(xTablesSup); + m_TableCtrl->setTablesSupplier(xTablesSup); m_xUsers = xUsersSup->getUsers(); } } diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 6f0720d7a43b..76922bb421c4 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -45,7 +45,7 @@ protected: PushButton *m_pNEWUSER; PushButton *m_pCHANGEPWD; PushButton *m_pDELETEUSER; - OTableGrantControl m_TableCtrl; // show the grant rights of one user + VclPtr<OTableGrantControl> m_TableCtrl; // show the grant rights of one user ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers; @@ -65,6 +65,7 @@ public: static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet ); virtual ~OUserAdmin(); + virtual void dispose() SAL_OVERRIDE; OUString GetUser(); // subclasses must override this, but it isn't pure virtual diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 2b17eccec0f9..fbfa3b5cb366 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -73,6 +73,11 @@ namespace dbaui OUserAdminDlg::~OUserAdminDlg() { + dispose(); + } + + void OUserAdminDlg::dispose() + { if ( m_bOwnConnection ) { try @@ -86,8 +91,9 @@ namespace dbaui SetInputSet(NULL); DELETEZ(pExampleSet); - + SfxTabDialog::dispose(); } + short OUserAdminDlg::Execute() { try diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index ddff2e67b7cf..9b6f331202ac 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -168,10 +168,6 @@ namespace dbaui #endif } - MySQLNativeSettings::~MySQLNativeSettings() - { - } - void MySQLNativeSettings::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ) { _rControlList.push_back( new OSaveValueWrapper< Edit >( m_pDatabaseName ) ); diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index e6e214dca1b9..e1daa864e730 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -53,7 +53,6 @@ namespace dbaui public: MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink ); - virtual ~MySQLNativeSettings(); void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 5e4cb63aa6f0..707645b93ac1 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -362,7 +362,13 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont OAddTableDlg::~OAddTableDlg() { + dispose(); +} + +void OAddTableDlg::dispose() +{ m_rContext.onWindowClosing( this ); + ModelessDialog::dispose(); } void OAddTableDlg::impl_switchTo( ObjectList _eList ) diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 65288cd41c81..d9d36cdfc36c 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -134,7 +134,13 @@ namespace dbaui SpecialSettingsPage::~SpecialSettingsPage() { + dispose(); + } + + void SpecialSettingsPage::dispose() + { m_aControlDependencies.clear(); + OGenericAdministrationPage::dispose(); } void SpecialSettingsPage::impl_initBooleanSettings() @@ -317,7 +323,13 @@ namespace dbaui GeneratedValuesPage::~GeneratedValuesPage() { + dispose(); + } + + void GeneratedValuesPage::dispose() + { m_aControlDependencies.clear(); + OGenericAdministrationPage::dispose(); } void GeneratedValuesPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ) @@ -406,8 +418,14 @@ namespace dbaui AdvancedSettingsDialog::~AdvancedSettingsDialog() { + dispose(); + } + + void AdvancedSettingsDialog::dispose() + { SetInputSet(NULL); DELETEZ(pExampleSet); + SfxTabDialog::dispose(); } bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const OUString& _sURL ) diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 005f0cb909c5..40f1643cd036 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -78,6 +78,7 @@ namespace dbaui protected: virtual ~SpecialSettingsPage(); + virtual void dispose() SAL_OVERRIDE; // OGenericAdministrationPage overridables virtual void implInitControls (const SfxItemSet& _rSet, bool _bSaveValue ) SAL_OVERRIDE; @@ -115,6 +116,7 @@ namespace dbaui // nControlFlags is a combination of the CBTP_xxx-constants virtual ~GeneratedValuesPage(); + virtual void dispose() SAL_OVERRIDE; // subclasses must override this, but it isn't pure virtual virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 646db7cb7e5b..a49694507280 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -66,9 +66,14 @@ ODbAdminDialog::ODbAdminDialog(vcl::Window* _pParent ODbAdminDialog::~ODbAdminDialog() { + dispose(); +} + +void ODbAdminDialog::dispose() +{ SetInputSet(NULL); DELETEZ(pExampleSet); - + SfxTabDialog::dispose(); } short ODbAdminDialog::Ok() diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 27c57af8fc3b..346128c37469 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -102,7 +102,13 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent ODbTypeWizDialog::~ODbTypeWizDialog() { + dispose(); +} + +void ODbTypeWizDialog::dispose() +{ delete m_pOutSet; + svt::OWizardMachine::dispose(); } IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage) diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 30240f286c08..0852c7550522 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -264,7 +264,13 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup() { + dispose(); +} + +void ODbTypeWizDialogSetup::dispose() +{ delete m_pOutSet; + svt::RoadmapWizard::dispose(); } IMPL_LINK(ODbTypeWizDialogSetup, OnTypeSelected, OGeneralPage*, /*_pTabPage*/) diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 5018b582288d..21ecc09d73fe 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -97,6 +97,11 @@ namespace dbaui OCommonBehaviourTabPage::~OCommonBehaviourTabPage() { + dispose(); + } + + void OCommonBehaviourTabPage::dispose() + { if(m_bDelete) { DELETEZ(m_pOptionsLabel); @@ -112,7 +117,7 @@ namespace dbaui DELETEZ(m_pAutoRetrievingLabel); DELETEZ(m_pAutoRetrieving); } - + OGenericAdministrationPage::dispose(); } void OCommonBehaviourTabPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) @@ -194,11 +199,6 @@ namespace dbaui m_pShowDeleted->SetClickHdl(LINK(this, ODbaseDetailsPage, OnButtonClicked)); } - ODbaseDetailsPage::~ODbaseDetailsPage() - { - - } - SfxTabPage* ODriversSettings::CreateDbase( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new ODbaseDetailsPage( pParent, *_rAttrSet ) ); @@ -261,10 +261,6 @@ namespace dbaui } - OAdoDetailsPage::~OAdoDetailsPage() - { - - } SfxTabPage* ODriversSettings::CreateAdo( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) { return ( new OAdoDetailsPage( pParent, *_rAttrSet ) ); @@ -511,7 +507,7 @@ namespace dbaui // MySQLNativePage MySQLNativePage::MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) :OCommonBehaviourTabPage(pParent, "MysqlNativePage", "dbaccess/ui/mysqlnativepage.ui", _rCoreAttrs, CBTP_USE_CHARSET ) - ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() ) + ,m_aMySQLSettings ( new MySQLNativeSettings(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) ) { get(m_pSeparator1, "connectionheader"); get(m_pSeparator2, "userheader"); @@ -521,13 +517,24 @@ namespace dbaui m_pUserName->SetModifyHdl(getControlModifiedLink()); - m_aMySQLSettings.Show(); + m_aMySQLSettings->Show(); + } + + MySQLNativePage::~MySQLNativePage() + { + dispose(); + } + + void MySQLNativePage::dispose() + { + m_aMySQLSettings.disposeAndClear(); + OCommonBehaviourTabPage::dispose(); } void MySQLNativePage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { OCommonBehaviourTabPage::fillControls( _rControlList ); - m_aMySQLSettings.fillControls( _rControlList ); + m_aMySQLSettings->fillControls( _rControlList ); _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pUserName)); _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pPasswordRequired)); @@ -535,7 +542,7 @@ namespace dbaui void MySQLNativePage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { OCommonBehaviourTabPage::fillWindows( _rControlList ); - m_aMySQLSettings.fillWindows( _rControlList); + m_aMySQLSettings->fillWindows( _rControlList); _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator1)); _rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator2)); @@ -546,7 +553,7 @@ namespace dbaui { bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet ); - bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); + bChangedSomething |= m_aMySQLSettings->FillItemSet( _rSet ); if ( m_pUserName->IsValueChangedFromSaved() ) { @@ -564,7 +571,7 @@ namespace dbaui bool bValid, bReadonly; getFlags(_rSet, bValid, bReadonly); - m_aMySQLSettings.implInitControls( _rSet ); + m_aMySQLSettings->implInitControls( _rSet ); SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true); SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true); @@ -680,8 +687,13 @@ namespace dbaui OTextDetailsPage::~OTextDetailsPage() { - DELETEZ(m_pTextConnectionHelper); + dispose(); + } + void OTextDetailsPage::dispose() + { + DELETEZ(m_pTextConnectionHelper); + OCommonBehaviourTabPage::dispose(); } SfxTabPage* ODriversSettings::CreateText( vcl::Window* pParent, const SfxItemSet* _rAttrSet ) diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index fd4119bdbbfa..de17ed7f83e8 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -74,6 +74,7 @@ namespace dbaui protected: virtual ~OCommonBehaviourTabPage(); + virtual void dispose() SAL_OVERRIDE; // subclasses must override this, but it isn't pure virtual virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -100,10 +101,6 @@ namespace dbaui OUString m_sDsn; protected: - - virtual ~ODbaseDetailsPage(); - - protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; private: @@ -113,10 +110,7 @@ namespace dbaui // OAdoDetailsPage class OAdoDetailsPage : public OCommonBehaviourTabPage { - protected: - virtual ~OAdoDetailsPage(); public: - OAdoDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); }; @@ -197,10 +191,12 @@ namespace dbaui public: MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); + virtual ~MySQLNativePage(); + virtual void dispose() SAL_OVERRIDE; private: FixedText *m_pSeparator1; - MySQLNativeSettings m_aMySQLSettings; + VclPtr<MySQLNativeSettings> m_aMySQLSettings; FixedText *m_pSeparator2; FixedText *m_pUserNameLabel; @@ -237,10 +233,7 @@ namespace dbaui // OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook class OMozillaDetailsPage : public OCommonBehaviourTabPage { - protected: - virtual ~OMozillaDetailsPage(); public: - OMozillaDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); }; @@ -255,6 +248,7 @@ namespace dbaui protected: virtual ~OTextDetailsPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool prepareLeave() SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index b02b73332e6f..139cd2441fd0 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -76,11 +76,16 @@ namespace dbaui DirectSQLDialog::~DirectSQLDialog() { + dispose(); + } + + void DirectSQLDialog::dispose() + { { ::osl::MutexGuard aGuard(m_aMutex); stopAllComponentListening(); } - + ModalDialog::dispose(); } void DirectSQLDialog::_disposing( const EventObject& _rSource ) diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 468233f5c748..6d09dcbb6cd8 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -52,8 +52,13 @@ SbaSbAttrDlg::SbaSbAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs, SbaSbAttrDlg::~SbaSbAttrDlg() { - delete pNumberInfoItem; + dispose(); +} +void SbaSbAttrDlg::dispose() +{ + delete pNumberInfoItem; + SfxTabDialog::dispose(); } void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index e2817a3d9b7a..7ca8febaeec8 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -285,7 +285,13 @@ OSaveAsDlg::OSaveAsDlg( vcl::Window * pParent, OSaveAsDlg::~OSaveAsDlg() { + dispose(); +} + +void OSaveAsDlg::dispose() +{ DELETEZ(m_pImpl); + ModalDialog::dispose(); } IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton) diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index bcd1dc6add60..5151b78d335a 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -70,10 +70,6 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(vcl::Window* _pParent, const St m_pDatasource->SetDoubleClickHdl(LINK(this,ODatasourceSelectDialog,ListDblClickHdl)); } -ODatasourceSelectDialog::~ODatasourceSelectDialog() -{ -} - IMPL_LINK( ODatasourceSelectDialog, ListDblClickHdl, ListBox *, pListBox ) { if (pListBox->GetSelectEntryCount()) diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index b124fb0cdaee..16f06de3e40d 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -53,7 +53,6 @@ protected: public: ODatasourceSelectDialog( vcl::Window* _pParent, const StringBag& _rDatasources, SfxItemSet* _pOutputSet = NULL ); - virtual ~ODatasourceSelectDialog(); OUString GetSelected() const { return m_pDatasource->GetSelectEntry();} void Select( const OUString& _rEntry ) { m_pDatasource->SelectEntry(_rEntry); } diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 1a543dce4c73..1e8bd033e50d 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -74,10 +74,6 @@ namespace dbaui m_pDatasourceType->SetSelectHdl(LINK(this, OGeneralPage, OnDatasourceTypeSelected)); } - OGeneralPage::~OGeneralPage() - { - } - namespace { struct DisplayedType diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 0668f679721a..083d3f0cda25 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -34,7 +34,6 @@ namespace dbaui { protected: OGeneralPage( vcl::Window* pParent, const OUString& _rUIXMLDescription, const SfxItemSet& _rItems ); - virtual ~OGeneralPage(); OUString m_eCurrentSelection; /// currently selected type ::dbaccess::DATASOURCE_TYPE diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index d034b68bd597..bdf95194ec94 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -311,9 +311,14 @@ namespace dbaui DbaIndexDialog::~DbaIndexDialog( ) { + dispose(); + } + + void DbaIndexDialog::dispose() + { setToolBox(NULL); delete m_pIndexes; - + ModalDialog::dispose(); } bool DbaIndexDialog::implCommit(SvTreeListEntry* _pEntry) diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index b4c8800fce7b..49a326f7b08d 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -110,9 +110,14 @@ namespace dbaui IndexFieldsControl::~IndexFieldsControl() { + dispose(); + } + + void IndexFieldsControl::dispose() + { delete m_pSortingCell; delete m_pFieldNameCell; - + ::svt::EditBrowseBox::dispose(); } bool IndexFieldsControl::SeekRow(long nRow) diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index d39d86fb623a..809c11f5b536 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -113,9 +113,14 @@ namespace dbaui OParameterDialog::~OParameterDialog() { + dispose(); + } + + void OParameterDialog::dispose() + { if (m_aResetVisitFlag.IsActive()) m_aResetVisitFlag.Stop(); - + ModalDialog::dispose(); } void OParameterDialog::Construct() diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 1274a03bf9b2..5648b84beecb 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -190,10 +190,6 @@ DlgFilterCrit::DlgFilterCrit(vcl::Window * pParent, m_pET_WHEREVALUE1->GrabFocus(); } -DlgFilterCrit::~DlgFilterCrit() -{ -} - #define LbText(x) ((x).GetSelectEntry()) #define LbPos(x) ((x).GetSelectEntryPos()) diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index f58d3ad7f0c5..9a77bf8be5dc 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -125,10 +125,6 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent, m_pLB_ORDERFIELD2->SetSelectHdl(LINK(this,DlgOrderCrit,FieldListSelectHdl)); } -DlgOrderCrit::~DlgOrderCrit() -{ -} - IMPL_LINK_INLINE_START( DlgOrderCrit, FieldListSelectHdl, ListBox *, /*pListBox*/ ) { EnableLines(); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 9d7cacc9512a..771c20477d42 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -470,24 +470,24 @@ void OSQLMessageBox::impl_positionControls() } // image - lcl_positionInAppFont( *this, m_aInfoImage, OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE ); - m_aInfoImage.Show(); + lcl_positionInAppFont( *this, *m_aInfoImage.get(), OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE ); + m_aInfoImage->Show(); // primary text - lcl_positionInAppFont( *this, m_aTitle, TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 ); + lcl_positionInAppFont( *this, *m_aTitle.get(), TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 ); sPrimary = lcl_stripOOoBaseVendor( sPrimary ); - m_aTitle.SetText( sPrimary ); - m_aTitle.Show(); + m_aTitle->SetText( sPrimary ); + m_aTitle->Show(); - Rectangle aPrimaryRect( m_aTitle.GetPosPixel(), m_aTitle.GetSizePixel() ); + Rectangle aPrimaryRect( m_aTitle->GetPosPixel(), m_aTitle->GetSizePixel() ); // secondary text (if applicable) - m_aMessage.SetStyle( m_aMessage.GetStyle() | WB_NOLABEL ); + m_aMessage->SetStyle( m_aMessage->GetStyle() | WB_NOLABEL ); sSecondary = lcl_stripOOoBaseVendor( sSecondary ); - m_aMessage.SetText( sSecondary ); + m_aMessage->SetText( sSecondary ); - lcl_positionInAppFont( *this, m_aMessage, TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 ); - Rectangle aSecondaryRect( m_aMessage.GetPosPixel(), m_aMessage.GetSizePixel() ); + lcl_positionInAppFont( *this, *m_aMessage.get(), TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 ); + Rectangle aSecondaryRect( m_aMessage->GetPosPixel(), m_aMessage->GetSizePixel() ); bool bHaveSecondaryText = !sSecondary.isEmpty(); @@ -498,8 +498,8 @@ void OSQLMessageBox::impl_positionControls() aSecondaryRect.Bottom() = aSecondaryRect.Top() - 1; // adjust secondary control height accordingly - m_aMessage.SetSizePixel( aSecondaryRect.GetSize() ); - m_aMessage.Show( aSecondaryRect.GetHeight() > 0 ); + m_aMessage->SetSizePixel( aSecondaryRect.GetSize() ); + m_aMessage->Show( aSecondaryRect.GetHeight() > 0 ); // if there's no secondary text ... if ( !bHaveSecondaryText ) @@ -508,23 +508,23 @@ void OSQLMessageBox::impl_positionControls() aPrimaryRect.Right() = aPrimaryRect.Left() + aSuggestedRect.GetWidth(); aPrimaryRect.Bottom() = aPrimaryRect.Top() + aSuggestedRect.GetHeight(); // and center it horizontally - m_aTitle.SetStyle( ( m_aTitle.GetStyle() & ~WB_LEFT ) | WB_CENTER ); + m_aTitle->SetStyle( ( m_aTitle->GetStyle() & ~WB_LEFT ) | WB_CENTER ); - Rectangle aInfoRect( m_aInfoImage.GetPosPixel(), m_aInfoImage.GetSizePixel() ); + Rectangle aInfoRect( m_aInfoImage->GetPosPixel(), m_aInfoImage->GetSizePixel() ); // also, if it's not as high as the image ... - if ( aPrimaryRect.GetHeight() < m_aInfoImage.GetSizePixel().Height() ) + if ( aPrimaryRect.GetHeight() < m_aInfoImage->GetSizePixel().Height() ) { // ... make it fit the image height aPrimaryRect.Bottom() += aInfoRect.GetHeight() - aPrimaryRect.GetHeight(); // and center it vertically - m_aTitle.SetStyle( m_aTitle.GetStyle() | WB_VCENTER ); + m_aTitle->SetStyle( m_aTitle->GetStyle() | WB_VCENTER ); } else { // ... otherwise, center the image vertically, relative to the primary text aInfoRect.Move( 0, ( aPrimaryRect.GetHeight() - aInfoRect.GetHeight() ) / 2 ); - m_aInfoImage.SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() ); + m_aInfoImage->SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() ); } - m_aTitle.SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() ); + m_aTitle->SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() ); } // adjust dialog size accordingly @@ -546,16 +546,16 @@ void OSQLMessageBox::impl_initImage( MessageType _eImage ) OSL_FAIL( "OSQLMessageBox::impl_initImage: unsupported image type!" ); /* Fall through */ case Info: - m_aInfoImage.SetImage(InfoBox::GetStandardImage()); + m_aInfoImage->SetImage(InfoBox::GetStandardImage()); break; case Warning: - m_aInfoImage.SetImage(WarningBox::GetStandardImage()); + m_aInfoImage->SetImage(WarningBox::GetStandardImage()); break; case Error: - m_aInfoImage.SetImage(ErrorBox::GetStandardImage()); + m_aInfoImage->SetImage(ErrorBox::GetStandardImage()); break; case Query: - m_aInfoImage.SetImage(QueryBox::GetStandardImage()); + m_aInfoImage->SetImage(QueryBox::GetStandardImage()); break; } } @@ -606,7 +606,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) void OSQLMessageBox::impl_addDetailsButton() { - size_t nFirstPageVisible = m_aMessage.IsVisible() ? 2 : 1; + size_t nFirstPageVisible = m_aMessage->IsVisible() ? 2 : 1; bool bMoreDetailsAvailable = m_pImpl->aDisplayInfo.size() > nFirstPageVisible; if ( !bMoreDetailsAvailable ) @@ -664,9 +664,9 @@ void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage ) OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _rException, WinBits _nStyle, const OUString& _rHelpURL ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) - ,m_aInfoImage( this ) - ,m_aTitle( this, WB_WORDBREAK | WB_LEFT ) - ,m_aMessage( this, WB_WORDBREAK | WB_LEFT ) + ,m_aInfoImage( new FixedImage(this) ) + ,m_aTitle( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) + ,m_aMessage( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) ,m_sHelpURL( _rHelpURL ) ,m_pImpl( new SQLMessageBox_Impl( _rException ) ) { @@ -675,9 +675,9 @@ OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _r OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, const OUString& _rMessage, WinBits _nStyle, MessageType _eType, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo ) :ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG ) - ,m_aInfoImage( this ) - ,m_aTitle( this, WB_WORDBREAK | WB_LEFT ) - ,m_aMessage( this, WB_WORDBREAK | WB_LEFT ) + ,m_aInfoImage( new FixedImage(this) ) + ,m_aTitle( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) + ,m_aMessage( new FixedText(this, WB_WORDBREAK | WB_LEFT) ) { SQLContext aError; aError.Message = _rTitle; @@ -692,6 +692,15 @@ OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, OSQLMessageBox::~OSQLMessageBox() { + dispose(); +} + +void OSQLMessageBox::dispose() +{ + m_aInfoImage.disposeAndClear(); + m_aTitle.disposeAndClear(); + m_aMessage.disposeAndClear(); + ButtonDialog::dispose(); } IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ ) diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index ee89c63ef83a..e6284d230b64 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -99,13 +99,18 @@ namespace dbaui OTableSubscriptionPage::~OTableSubscriptionPage() { + dispose(); + } + + void OTableSubscriptionPage::dispose() + { // just to make sure that our connection will be removed try { ::comphelper::disposeComponent(m_xCurrentConnection); } catch (RuntimeException&) { } - + OGenericAdministrationPage::dispose(); } void OTableSubscriptionPage::StateChanged( StateChangedType nType ) diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index 37db79c853a9..c8b50ddbda15 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -62,6 +62,7 @@ namespace dbaui OTableSubscriptionPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ,OTableSubscriptionDialog* _pTablesDlg); virtual ~OTableSubscriptionPage(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx index 11f84162318b..a0eb3330917e 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx +++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx @@ -39,10 +39,6 @@ namespace dbaui m_pOK->SetClickHdl( LINK( this, TextConnectionSettingsDialog, OnOK ) ); } - TextConnectionSettingsDialog::~TextConnectionSettingsDialog() - { - } - void TextConnectionSettingsDialog::bindItemStorages( SfxItemSet& _rSet, PropertyValues& _rValues ) { _rValues[ PROPERTY_ID_HEADER_LINE ].reset( new SetItemPropertyStorage( _rSet, DSID_TEXTFILEHEADER ) ); |