diff options
Diffstat (limited to 'extensions/source')
65 files changed, 738 insertions, 282 deletions
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 3092133c2cee..136cb675023a 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -70,6 +70,12 @@ namespace abp void FinalPage::dispose() { delete m_pLocationController; + m_pLocation.clear(); + m_pBrowse.clear(); + m_pRegisterName.clear(); + m_pNameLabel.clear(); + m_pName.clear(); + m_pDuplicateNameError.clear(); AddressBookSourcePage::dispose(); } diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx index 65c40b3ba037..eedeac43b25d 100644 --- a/extensions/source/abpilot/abpfinalpage.hxx +++ b/extensions/source/abpilot/abpfinalpage.hxx @@ -26,6 +26,7 @@ #include <svtools/urlcontrol.hxx> #include <svx/databaselocationinput.hxx> #include <vcl/edit.hxx> +#include <vcl/vclptr.hxx> namespace abp @@ -38,12 +39,12 @@ namespace abp class FinalPage : public AddressBookSourcePage { protected: - ::svt::OFileURLControl* m_pLocation; - PushButton* m_pBrowse; - CheckBox* m_pRegisterName; - FixedText* m_pNameLabel; - Edit* m_pName; - FixedText* m_pDuplicateNameError; + VclPtr<::svt::OFileURLControl> m_pLocation; + VclPtr<PushButton> m_pBrowse; + VclPtr<CheckBox> m_pRegisterName; + VclPtr<FixedText> m_pNameLabel; + VclPtr<Edit> m_pName; + VclPtr<FixedText> m_pDuplicateNameError; ::svx::DatabaseLocationInputController* m_pLocationController; diff --git a/extensions/source/abpilot/admininvokationimpl.hxx b/extensions/source/abpilot/admininvokationimpl.hxx index 486223ca30c0..9dc5d3b0cb8a 100644 --- a/extensions/source/abpilot/admininvokationimpl.hxx +++ b/extensions/source/abpilot/admininvokationimpl.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } @@ -36,7 +37,7 @@ namespace abp ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xDataSource; - vcl::Window* m_pMessageParent; + VclPtr<vcl::Window> m_pMessageParent; public: OAdminDialogInvokation( diff --git a/extensions/source/abpilot/admininvokationpage.cxx b/extensions/source/abpilot/admininvokationpage.cxx index a92e90d7eb1e..dd11939e9416 100644 --- a/extensions/source/abpilot/admininvokationpage.cxx +++ b/extensions/source/abpilot/admininvokationpage.cxx @@ -34,7 +34,16 @@ namespace abp get(m_pErrorMessage, "warning"); m_pInvokeAdminDialog->SetClickHdl( LINK(this, AdminDialogInvokationPage, OnInvokeAdminDialog) ); } - + AdminDialogInvokationPage::~AdminDialogInvokationPage() + { + dispose(); + } + void AdminDialogInvokationPage::dispose() + { + m_pInvokeAdminDialog.clear(); + m_pErrorMessage.clear(); + AddressBookSourcePage::dispose(); + } void AdminDialogInvokationPage::ActivatePage() { AddressBookSourcePage::ActivatePage(); diff --git a/extensions/source/abpilot/admininvokationpage.hxx b/extensions/source/abpilot/admininvokationpage.hxx index 4b264274f290..7e2e7efce8c2 100644 --- a/extensions/source/abpilot/admininvokationpage.hxx +++ b/extensions/source/abpilot/admininvokationpage.hxx @@ -29,14 +29,15 @@ namespace abp class AdminDialogInvokationPage : public AddressBookSourcePage { protected: - PushButton* m_pInvokeAdminDialog; - FixedText* m_pErrorMessage; + VclPtr<PushButton> m_pInvokeAdminDialog; + VclPtr<FixedText> m_pErrorMessage; bool m_bSuccessfullyExecutedDialog; public: AdminDialogInvokationPage( OAddessBookSourcePilot* _pParent ); - + virtual ~AdminDialogInvokationPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabDialog overridables virtual void ActivatePage() SAL_OVERRIDE; diff --git a/extensions/source/abpilot/fieldmappingpage.cxx b/extensions/source/abpilot/fieldmappingpage.cxx index c30bf82265c6..1e4ca7a5efa4 100644 --- a/extensions/source/abpilot/fieldmappingpage.cxx +++ b/extensions/source/abpilot/fieldmappingpage.cxx @@ -37,6 +37,18 @@ namespace abp m_pInvokeDialog->SetClickHdl( LINK( this, FieldMappingPage, OnInvokeDialog ) ); } + FieldMappingPage::~FieldMappingPage() + { + dispose(); + } + + void FieldMappingPage::dispose() + { + m_pInvokeDialog.clear(); + m_pHint.clear(); + AddressBookSourcePage::dispose(); + } + void FieldMappingPage::ActivatePage() { AddressBookSourcePage::ActivatePage(); diff --git a/extensions/source/abpilot/fieldmappingpage.hxx b/extensions/source/abpilot/fieldmappingpage.hxx index 35ce8a2fcc3b..6adaf511800a 100644 --- a/extensions/source/abpilot/fieldmappingpage.hxx +++ b/extensions/source/abpilot/fieldmappingpage.hxx @@ -21,6 +21,7 @@ #define INCLUDED_EXTENSIONS_SOURCE_ABPILOT_FIELDMAPPINGPAGE_HXX #include "abspage.hxx" +#include <vcl/vclptr.hxx> namespace abp @@ -33,12 +34,13 @@ namespace abp class FieldMappingPage : public AddressBookSourcePage { protected: - PushButton* m_pInvokeDialog; - FixedText* m_pHint; + VclPtr<PushButton> m_pInvokeDialog; + VclPtr<FixedText> m_pHint; public: FieldMappingPage( OAddessBookSourcePilot* _pParent ); - + virtual ~FieldMappingPage(); + virtual void dispose() SAL_OVERRIDE; protected: // OWizardPage overridables virtual void initializePage() SAL_OVERRIDE; diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx index 61ac27d8f1ce..d85423b17481 100644 --- a/extensions/source/abpilot/tableselectionpage.cxx +++ b/extensions/source/abpilot/tableselectionpage.cxx @@ -41,6 +41,16 @@ namespace abp m_pTableList->SetDoubleClickHdl( LINK( this, TableSelectionPage, OnTableDoubleClicked ) ); } + TableSelectionPage::~TableSelectionPage() + { + dispose(); + } + + void TableSelectionPage::dispose() + { + m_pTableList.clear(); + AddressBookSourcePage::dispose(); + } void TableSelectionPage::ActivatePage() { diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx index c9fcd755920d..7abcf547af45 100644 --- a/extensions/source/abpilot/tableselectionpage.hxx +++ b/extensions/source/abpilot/tableselectionpage.hxx @@ -22,6 +22,7 @@ #include "abspage.hxx" #include <vcl/lstbox.hxx> +#include <vcl/vclptr.hxx> namespace abp @@ -34,11 +35,12 @@ namespace abp class TableSelectionPage : public AddressBookSourcePage { protected: - ListBox* m_pTableList; + VclPtr<ListBox> m_pTableList; public: TableSelectionPage( OAddessBookSourcePilot* _pParent ); - + virtual ~TableSelectionPage(); + virtual void dispose() SAL_OVERRIDE; protected: // OWizardPage overridables virtual void initializePage() SAL_OVERRIDE; diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 494c7b84df63..813b5465ccc0 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -161,6 +161,17 @@ namespace abp { loop->m_bVisible = false; } + m_pEvolution.clear(); + m_pEvolutionGroupwise.clear(); + m_pEvolutionLdap.clear(); + m_pMORK.clear(); + m_pThunderbird.clear(); + m_pKab.clear(); + m_pMacab.clear(); + m_pLDAP.clear(); + m_pOutlook.clear(); + m_pOE.clear(); + m_pOther.clear(); AddressBookSourcePage::dispose(); } diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx index 131d5ea91bb6..b7c628f884c1 100644 --- a/extensions/source/abpilot/typeselectionpage.hxx +++ b/extensions/source/abpilot/typeselectionpage.hxx @@ -23,6 +23,7 @@ #include "abspage.hxx" #include "addresssettings.hxx" #include <vcl/edit.hxx> +#include <vcl/vclptr.hxx> namespace abp @@ -35,20 +36,20 @@ namespace abp class TypeSelectionPage : public AddressBookSourcePage { protected: - RadioButton* m_pEvolution; - RadioButton* m_pEvolutionGroupwise; - RadioButton* m_pEvolutionLdap; - RadioButton* m_pMORK; - RadioButton* m_pThunderbird; - RadioButton* m_pKab; - RadioButton* m_pMacab; - RadioButton* m_pLDAP; - RadioButton* m_pOutlook; - RadioButton* m_pOE; - RadioButton* m_pOther; + VclPtr<RadioButton> m_pEvolution; + VclPtr<RadioButton> m_pEvolutionGroupwise; + VclPtr<RadioButton> m_pEvolutionLdap; + VclPtr<RadioButton> m_pMORK; + VclPtr<RadioButton> m_pThunderbird; + VclPtr<RadioButton> m_pKab; + VclPtr<RadioButton> m_pMacab; + VclPtr<RadioButton> m_pLDAP; + VclPtr<RadioButton> m_pOutlook; + VclPtr<RadioButton> m_pOE; + VclPtr<RadioButton> m_pOther; struct ButtonItem { - RadioButton *m_pItem; + VclPtr<RadioButton> m_pItem; AddressSourceType m_eType; bool m_bVisible; diff --git a/extensions/source/abpilot/unodialogabp.cxx b/extensions/source/abpilot/unodialogabp.cxx index dd24e0c5cd54..8a0714eb17be 100644 --- a/extensions/source/abpilot/unodialogabp.cxx +++ b/extensions/source/abpilot/unodialogabp.cxx @@ -179,7 +179,7 @@ namespace abp { if ( _nExecutionResult == RET_OK ) { - const AddressSettings& aSettings = static_cast<OAddessBookSourcePilot*>(m_pDialog)->getSettings(); + const AddressSettings& aSettings = static_cast<OAddessBookSourcePilot*>(m_pDialog.get())->getSettings(); m_sDataSourceName = aSettings.bRegisterDataSource ? aSettings.sRegisteredDataSourceName : aSettings.sDataSourceName; } } diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 1a4713c8d173..0174189c2cb4 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -29,6 +29,7 @@ #include <vcl/edit.hxx> #include <tools/debug.hxx> #include "bibbeam.hxx" +#include "bibview.hxx" #include "toolbar.hrc" #include "bibresid.hxx" #include "datman.hxx" @@ -216,17 +217,17 @@ namespace bib if ( pToolBar ) { pDatMan->SetToolbar(0); - - DELETEZ( pToolBar ); } if( pGridWin ) { BibGridwin* pDel = pGridWin; - pGridWin = NULL; + pGridWin.clear(); pDel->disposeGridWin(); delete pDel; } + pToolBar.clear(); + pGridWin.clear(); BibSplitWindow::dispose(); } diff --git a/extensions/source/bibliography/bibbeam.hxx b/extensions/source/bibliography/bibbeam.hxx index 980ebf84b5fa..aea7d49db079 100644 --- a/extensions/source/bibliography/bibbeam.hxx +++ b/extensions/source/bibliography/bibbeam.hxx @@ -52,8 +52,8 @@ namespace bib ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xGridWin; BibDataManager* pDatMan; - BibToolBar* pToolBar; - BibGridwin* pGridWin; + VclPtr<BibToolBar> pToolBar; + VclPtr<BibGridwin> pGridWin; DECL_LINK( RecalcLayout_Impl, void* ); diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index d13600c89eb7..b6e65e1665d8 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -31,6 +31,7 @@ #include "datman.hxx" #include "bibcont.hxx" +#include "bibview.hxx" BibShortCutHandler::~BibShortCutHandler() @@ -154,6 +155,8 @@ void BibBookContainer::dispose() } CloseBibModul( pBibMod ); + pTopWin.clear(); + pBottomWin.clear(); BibSplitWindow::dispose(); } @@ -178,7 +181,7 @@ void BibBookContainer::createTopFrame( BibShortCutHandler* pWin ) if(pTopWin) { RemoveItem(TOP_WINDOW); - delete pTopWin; + pTopWin.clear(); } pTopWin=new BibWindowContainer(this,pWin); pTopWin->Show(); @@ -195,7 +198,7 @@ void BibBookContainer::createBottomFrame( BibShortCutHandler* pWin ) if(pBottomWin) { RemoveItem(BOTTOM_WINDOW); - delete pBottomWin; + pBottomWin.clear(); } pBottomWin=new BibWindowContainer(this,pWin); diff --git a/extensions/source/bibliography/bibcont.hxx b/extensions/source/bibliography/bibcont.hxx index 9c26ca05a41e..3488c2ee27ee 100644 --- a/extensions/source/bibliography/bibcont.hxx +++ b/extensions/source/bibliography/bibcont.hxx @@ -70,8 +70,8 @@ class BibBookContainer: public BibSplitWindow ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xTopPeerRef; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xBottomPeerRef; - BibWindowContainer* pTopWin; - BibWindowContainer* pBottomWin; + VclPtr<BibWindowContainer> pTopWin; + VclPtr<BibWindowContainer> pBottomWin; HdlBibModul pBibMod; Idle aIdle; diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx index 4336c1a54461..cda8769d0204 100644 --- a/extensions/source/bibliography/bibmod.cxx +++ b/extensions/source/bibliography/bibmod.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/lang/XLocalizable.hpp> #include "bibmod.hxx" +#include "bibview.hxx" #include "bibresid.hxx" #include "datman.hxx" #include "bibconfig.hxx" diff --git a/extensions/source/bibliography/bibshortcuthandler.hxx b/extensions/source/bibliography/bibshortcuthandler.hxx index f109aebfbc5a..4fd79657efa1 100644 --- a/extensions/source/bibliography/bibshortcuthandler.hxx +++ b/extensions/source/bibliography/bibshortcuthandler.hxx @@ -31,7 +31,7 @@ class BibShortCutHandler { private: - vcl::Window* pBaseClass; // in cases, where BibShortCutHandler also has to be a window + VclPtr<vcl::Window> pBaseClass; // in cases, where BibShortCutHandler also has to be a window protected: inline BibShortCutHandler( vcl::Window* pBaseClass ); diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx index c32e07723a09..f00d4276b2dd 100644 --- a/extensions/source/bibliography/bibview.cxx +++ b/extensions/source/bibliography/bibview.cxx @@ -52,9 +52,10 @@ namespace bib ,m_pDatMan( _pManager ) ,m_xDatMan( _pManager ) ,m_pGeneralPage( NULL ) + ,m_aFormControlContainer(this) { if ( m_xDatMan.is() ) - connectForm( m_xDatMan ); + m_aFormControlContainer.connectForm( m_xDatMan ); } @@ -66,7 +67,7 @@ namespace bib void BibView::dispose() { BibGeneralPage* pGeneralPage = m_pGeneralPage; - m_pGeneralPage = NULL; + m_pGeneralPage.clear(); pGeneralPage->CommitActiveControl(); Reference< XForm > xForm = m_pDatMan->getForm(); @@ -97,8 +98,8 @@ namespace bib } } - if ( isFormConnected() ) - disconnectForm(); + if ( m_aFormControlContainer.isFormConnected() ) + m_aFormControlContainer.disconnectForm(); pGeneralPage->RemoveListeners(); m_xGeneralPage = NULL; @@ -118,7 +119,8 @@ namespace bib m_xGeneralPage = 0; } - m_xGeneralPage = m_pGeneralPage = new BibGeneralPage( this, m_pDatMan ); + m_pGeneralPage = new BibGeneralPage( this, m_pDatMan ); + m_xGeneralPage = &m_pGeneralPage->GetFocusListener(); m_pGeneralPage->Show(); if( HasFocus() ) @@ -156,16 +158,18 @@ namespace bib } } - void BibView::_loaded( const EventObject& _rEvent ) + BibViewFormControlContainer::BibViewFormControlContainer(BibView *pBibView) : mpBibView(pBibView) {} + + void BibViewFormControlContainer::_loaded( const EventObject& _rEvent ) { - UpdatePages(); + mpBibView->UpdatePages(); FormControlContainer::_loaded( _rEvent ); Resize(); } - void BibView::_reloaded( const EventObject& _rEvent ) + void BibViewFormControlContainer::_reloaded( const EventObject& _rEvent ) { - UpdatePages(); + mpBibView->UpdatePages(); FormControlContainer::_loaded( _rEvent ); Resize(); } @@ -186,6 +190,11 @@ namespace bib Window::Resize(); } + Reference< awt::XControlContainer > BibViewFormControlContainer::getControlContainer() + { + return mpBibView->getControlContainer(); + } + Reference< awt::XControlContainer > BibView::getControlContainer() { Reference< awt::XControlContainer > xReturn; diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx index 6ab966dee1c4..0ab5744244da 100644 --- a/extensions/source/bibliography/bibview.hxx +++ b/extensions/source/bibliography/bibview.hxx @@ -34,29 +34,40 @@ namespace bib { + class BibView; + class BibViewFormControlContainer : public FormControlContainer + { + private: + VclPtr<BibView> mpBibView; + protected: + // FormControlContainer + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > + getControlContainer() SAL_OVERRIDE; + // XLoadListener equivalents + virtual void _loaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE; + virtual void _reloaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE; + public: + using FormControlContainer::connectForm; + using FormControlContainer::disconnectForm; + using FormControlContainer::isFormConnected; + BibViewFormControlContainer(BibView *pBibView); + }; - class BibView : public BibWindow, public FormControlContainer + class BibView : public BibWindow { private: BibDataManager* m_pDatMan; ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable> m_xDatMan; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener> m_xGeneralPage; - BibGeneralPage* m_pGeneralPage; + VclPtr<BibGeneralPage> m_pGeneralPage; + BibViewFormControlContainer m_aFormControlContainer; private: DECL_STATIC_LINK(BibView, CallMappingHdl, BibView*); protected: // Window overridables - virtual void Resize() SAL_OVERRIDE; - - // FormControlContainer - virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > - getControlContainer() SAL_OVERRIDE; - - // XLoadListener equivalents - virtual void _loaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE; - virtual void _reloaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE; + virtual void Resize() SAL_OVERRIDE; public: BibView( vcl::Window* _pParent, BibDataManager* _pDatMan, WinBits nStyle = WB_3DLOOK ); @@ -64,6 +75,7 @@ namespace bib virtual void dispose() SAL_OVERRIDE; void UpdatePages(); + css::uno::Reference< css::awt::XControlContainer > getControlContainer(); virtual void GetFocus() SAL_OVERRIDE; diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index f28936d540f1..818eea9c9c37 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -195,39 +195,39 @@ Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm) class MappingDialog_Impl : public ModalDialog { BibDataManager* pDatMan; - OKButton* pOKBT; - ListBox* pIdentifierLB; - ListBox* pAuthorityTypeLB; - ListBox* pAuthorLB; - ListBox* pTitleLB; - ListBox* pMonthLB; - ListBox* pYearLB; - ListBox* pISBNLB; - ListBox* pBooktitleLB; - ListBox* pChapterLB; - ListBox* pEditionLB; - ListBox* pEditorLB; - ListBox* pHowpublishedLB; - ListBox* pInstitutionLB; - ListBox* pJournalLB; - ListBox* pNoteLB; - ListBox* pAnnoteLB; - ListBox* pNumberLB; - ListBox* pOrganizationsLB; - ListBox* pPagesLB; - ListBox* pPublisherLB; - ListBox* pAddressLB; - ListBox* pSchoolLB; - ListBox* pSeriesLB; - ListBox* pReportTypeLB; - ListBox* pVolumeLB; - ListBox* pURLLB; - ListBox* pCustom1LB; - ListBox* pCustom2LB; - ListBox* pCustom3LB; - ListBox* pCustom4LB; - ListBox* pCustom5LB; - ListBox* aListBoxes[COLUMN_COUNT]; + VclPtr<OKButton> pOKBT; + VclPtr<ListBox> pIdentifierLB; + VclPtr<ListBox> pAuthorityTypeLB; + VclPtr<ListBox> pAuthorLB; + VclPtr<ListBox> pTitleLB; + VclPtr<ListBox> pMonthLB; + VclPtr<ListBox> pYearLB; + VclPtr<ListBox> pISBNLB; + VclPtr<ListBox> pBooktitleLB; + VclPtr<ListBox> pChapterLB; + VclPtr<ListBox> pEditionLB; + VclPtr<ListBox> pEditorLB; + VclPtr<ListBox> pHowpublishedLB; + VclPtr<ListBox> pInstitutionLB; + VclPtr<ListBox> pJournalLB; + VclPtr<ListBox> pNoteLB; + VclPtr<ListBox> pAnnoteLB; + VclPtr<ListBox> pNumberLB; + VclPtr<ListBox> pOrganizationsLB; + VclPtr<ListBox> pPagesLB; + VclPtr<ListBox> pPublisherLB; + VclPtr<ListBox> pAddressLB; + VclPtr<ListBox> pSchoolLB; + VclPtr<ListBox> pSeriesLB; + VclPtr<ListBox> pReportTypeLB; + VclPtr<ListBox> pVolumeLB; + VclPtr<ListBox> pURLLB; + VclPtr<ListBox> pCustom1LB; + VclPtr<ListBox> pCustom2LB; + VclPtr<ListBox> pCustom3LB; + VclPtr<ListBox> pCustom4LB; + VclPtr<ListBox> pCustom5LB; + VclPtr<ListBox> aListBoxes[COLUMN_COUNT]; OUString sNone; bool bModified; @@ -240,6 +240,7 @@ class MappingDialog_Impl : public ModalDialog public: MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pDatMan); virtual ~MappingDialog_Impl(); + virtual void dispose() SAL_OVERRIDE; void SetModified() {bModified = true;} @@ -376,7 +377,48 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa } MappingDialog_Impl::~MappingDialog_Impl() -{} +{ + dispose(); +} + +void MappingDialog_Impl::dispose() +{ + pOKBT.clear(); + pIdentifierLB.clear(); + pAuthorityTypeLB.clear(); + pAuthorLB.clear(); + pTitleLB.clear(); + pMonthLB.clear(); + pYearLB.clear(); + pISBNLB.clear(); + pBooktitleLB.clear(); + pChapterLB.clear(); + pEditionLB.clear(); + pEditorLB.clear(); + pHowpublishedLB.clear(); + pInstitutionLB.clear(); + pJournalLB.clear(); + pNoteLB.clear(); + pAnnoteLB.clear(); + pNumberLB.clear(); + pOrganizationsLB.clear(); + pPagesLB.clear(); + pPublisherLB.clear(); + pAddressLB.clear(); + pSchoolLB.clear(); + pSeriesLB.clear(); + pReportTypeLB.clear(); + pVolumeLB.clear(); + pURLLB.clear(); + pCustom1LB.clear(); + pCustom2LB.clear(); + pCustom3LB.clear(); + pCustom4LB.clear(); + pCustom5LB.clear(); + for(auto & a : aListBoxes) + a.clear(); + ModalDialog::dispose(); +} IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox) { @@ -426,7 +468,7 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl) class DBChangeDialog_Impl : public ModalDialog { - ListBox* m_pSelectionLB; + VclPtr<ListBox> m_pSelectionLB; DBChangeDialogConfig_Impl aConfig; BibDataManager* pDatMan; @@ -435,6 +477,7 @@ class DBChangeDialog_Impl : public ModalDialog public: DBChangeDialog_Impl(vcl::Window* pParent, BibDataManager* pMan ); virtual ~DBChangeDialog_Impl(); + virtual void dispose() SAL_OVERRIDE; OUString GetCurrentURL()const; }; @@ -477,6 +520,13 @@ IMPL_LINK(DBChangeDialog_Impl, DoubleClickHdl, SvTabListBox*, /*pLB*/) DBChangeDialog_Impl::~DBChangeDialog_Impl() { + dispose(); +} + +void DBChangeDialog_Impl::dispose() +{ + m_pSelectionLB.clear(); + ModalDialog::dispose(); } OUString DBChangeDialog_Impl::GetCurrentURL()const diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index ea5738f51378..80349cc3e09e 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -33,6 +33,7 @@ #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <cppuhelper/implbase1.hxx> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } @@ -100,8 +101,8 @@ private: ::cppu::OInterfaceContainerHelper m_aLoadListeners; - ::bib::BibView* pBibView; - BibToolBar* pToolbar; + VclPtr<::bib::BibView> pBibView; + VclPtr<BibToolBar> pToolbar; OUString sIdentifierMapping; protected: diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index a586fe69aa4c..563aa8a57067 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -25,6 +25,7 @@ #include <comphelper/sequence.hxx> #include "framectr.hxx" #include "datman.hxx" +#include "bibview.hxx" #include "bibresid.hxx" #include "bib.hrc" #include <toolkit/helper/vclunohelper.hxx> diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index e63300c5515d..a8af7177fb2f 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -36,6 +36,7 @@ #include "bibprop.hrc" #include "bib.hrc" #include "bibmod.hxx" +#include "bibview.hxx" #include "bibtools.hxx" #include "bibliography.hrc" #include <tools/debug.hxx> @@ -70,7 +71,7 @@ static OUString lcl_GetColumnName( const Mapping* pMapping, sal_uInt16 nIndexPos class BibPosListener :public cppu::WeakImplHelper1 <sdbc::XRowSetListener> { - BibGeneralPage* pParentPage; + VclPtr<BibGeneralPage> pParentPage; public: BibPosListener(BibGeneralPage* pParent); @@ -168,6 +169,7 @@ void BibPosListener::disposing(const lang::EventObject& /*Source*/) throw( uno:: BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan): BibTabPage(pParent, "GeneralPage", "modules/sbibliography/ui/generalpage.ui"), sErrorPrefix(BIB_RESSTR(ST_ERROR_PREFIX)), + maBibGeneralPageFocusListener(this), pDatMan(pMan) { get(pIdentifierFT, "shortname"); @@ -375,6 +377,40 @@ void BibGeneralPage::dispose() if(xRowSet.is()) xRowSet->removeRowSetListener(xPosListener); } + pGrid.clear(); + pScrolledWindow.clear(); + pIdentifierFT.clear(); + pAuthTypeFT.clear(); + pYearFT.clear(); + pAuthorFT.clear(); + pTitleFT.clear(); + pPublisherFT.clear(); + pAddressFT.clear(); + pISBNFT.clear(); + pChapterFT.clear(); + pPagesFT.clear(); + pEditorFT.clear(); + pEditionFT.clear(); + pBooktitleFT.clear(); + pVolumeFT.clear(); + pHowpublishedFT.clear(); + pOrganizationsFT.clear(); + pInstitutionFT.clear(); + pSchoolFT.clear(); + pReportTypeFT.clear(); + pMonthFT.clear(); + pJournalFT.clear(); + pNumberFT.clear(); + pSeriesFT.clear(); + pAnnoteFT.clear(); + pNoteFT.clear(); + pURLFT.clear(); + pCustom1FT.clear(); + pCustom2FT.clear(); + pCustom3FT.clear(); + pCustom4FT.clear(); + pCustom5FT.clear(); + for (auto & a: aFixedTexts) a.clear(); BibTabPage::dispose(); } @@ -385,7 +421,7 @@ void BibGeneralPage::RemoveListeners() if(aControls[i].is()) { uno::Reference< awt::XWindow > xCtrWin(aControls[i], uno::UNO_QUERY ); - xCtrWin->removeFocusListener( this ); + xCtrWin->removeFocusListener( &maBibGeneralPageFocusListener ); aControls[i] = 0; } } @@ -506,7 +542,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( // Peer as Child to the FrameWindow xCtrlContnr->addControl(rName, xControl); uno::Reference< awt::XWindow > xCtrWin(xControl, UNO_QUERY ); - xCtrWin->addFocusListener( this ); + xCtrWin->addFocusListener( &maBibGeneralPageFocusListener ); rIndex = -1; // -> implies, that not found for(sal_uInt16 i = 0; i < FIELD_COUNT; i++) if(!aControls[i].is()) @@ -627,10 +663,6 @@ void BibGeneralPage::focusLost(const awt::FocusEvent& ) throw( uno::RuntimeExcep CommitActiveControl(); } -void BibGeneralPage::disposing(const lang::EventObject& /*Source*/) throw( uno::RuntimeException, std::exception ) -{ -} - void BibGeneralPage::GetFocus() { Reference< awt::XWindow >* pxControl = aControls; @@ -713,4 +745,20 @@ bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent ) return bHandled; } +BibGeneralPageFocusListener::BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage): mpBibGeneralPage(pBibGeneralPage) +{} + +void BibGeneralPageFocusListener::focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) +{ + mpBibGeneralPage->focusGained(e); +} + +void BibGeneralPageFocusListener::focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) +{ + mpBibGeneralPage->focusLost(e); +} + +void BibGeneralPageFocusListener::disposing( const ::com::sun::star::lang::EventObject& ) throw( com::sun::star::uno::RuntimeException, std::exception ) +{} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index 106f7f3416b2..809f4e112ca8 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -41,56 +41,70 @@ class BibDataManager; #define TYPE_COUNT 22 #define FIELD_COUNT 31 -typedef cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > BibGeneralPageBaseClass; +/** + * We need to split off the listener because both it and the vcl::Window baseclass are ref-counted + */ +class BibGeneralPage; +class BibGeneralPageFocusListener : public cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > +{ +private: + VclPtr<BibGeneralPage> mpBibGeneralPage; +public: + BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage); + virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; -class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage +}; + +class BibGeneralPage: public BibTabPage { - VclGrid* pGrid; - VclScrolledWindow* pScrolledWindow; + VclPtr<VclGrid> pGrid; + VclPtr<VclScrolledWindow> pScrolledWindow; - FixedText* pIdentifierFT; - FixedText* pAuthTypeFT; - FixedText* pYearFT; + VclPtr<FixedText> pIdentifierFT; + VclPtr<FixedText> pAuthTypeFT; + VclPtr<FixedText> pYearFT; - FixedText* pAuthorFT; - FixedText* pTitleFT; + VclPtr<FixedText> pAuthorFT; + VclPtr<FixedText> pTitleFT; - FixedText* pPublisherFT; - FixedText* pAddressFT; - FixedText* pISBNFT; + VclPtr<FixedText> pPublisherFT; + VclPtr<FixedText> pAddressFT; + VclPtr<FixedText> pISBNFT; - FixedText* pChapterFT; - FixedText* pPagesFT; + VclPtr<FixedText> pChapterFT; + VclPtr<FixedText> pPagesFT; - FixedText* pEditorFT; - FixedText* pEditionFT; + VclPtr<FixedText> pEditorFT; + VclPtr<FixedText> pEditionFT; - FixedText* pBooktitleFT; - FixedText* pVolumeFT; - FixedText* pHowpublishedFT; + VclPtr<FixedText> pBooktitleFT; + VclPtr<FixedText> pVolumeFT; + VclPtr<FixedText> pHowpublishedFT; - FixedText* pOrganizationsFT; - FixedText* pInstitutionFT; - FixedText* pSchoolFT; + VclPtr<FixedText> pOrganizationsFT; + VclPtr<FixedText> pInstitutionFT; + VclPtr<FixedText> pSchoolFT; - FixedText* pReportTypeFT; - FixedText* pMonthFT; + VclPtr<FixedText> pReportTypeFT; + VclPtr<FixedText> pMonthFT; - FixedText* pJournalFT; - FixedText* pNumberFT; - FixedText* pSeriesFT; + VclPtr<FixedText> pJournalFT; + VclPtr<FixedText> pNumberFT; + VclPtr<FixedText> pSeriesFT; - FixedText* pAnnoteFT; - FixedText* pNoteFT; - FixedText* pURLFT; + VclPtr<FixedText> pAnnoteFT; + VclPtr<FixedText> pNoteFT; + VclPtr<FixedText> pURLFT; - FixedText* pCustom1FT; - FixedText* pCustom2FT; - FixedText* pCustom3FT; - FixedText* pCustom4FT; - FixedText* pCustom5FT; + VclPtr<FixedText> pCustom1FT; + VclPtr<FixedText> pCustom2FT; + VclPtr<FixedText> pCustom3FT; + VclPtr<FixedText> pCustom4FT; + VclPtr<FixedText> pCustom5FT; - FixedText* aFixedTexts[ FIELD_COUNT ]; + VclPtr<FixedText> aFixedTexts[ FIELD_COUNT ]; sal_Int16 nFT2CtrlMap[ FIELD_COUNT ]; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > @@ -114,6 +128,7 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener > xPosListener; + BibGeneralPageFocusListener maBibGeneralPageFocusListener; BibDataManager* pDatMan; @@ -144,16 +159,17 @@ public: void CommitActiveControl(); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - - void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - void RemoveListeners(); virtual void GetFocus() SAL_OVERRIDE; virtual bool HandleShortCutKey( const KeyEvent& rKeyEvent ) SAL_OVERRIDE; // returns true, if key was handled + + inline BibGeneralPageFocusListener& GetFocusListener() { return maBibGeneralPageFocusListener; } + + void focusGained(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception ); + void focusLost(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception ); + }; diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 771cbdcff1d5..477e1afd745e 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -31,6 +31,7 @@ #include <vcl/settings.hxx> #include <vcl/mnemonic.hxx> #include "bibbeam.hxx" +#include "bibview.hxx" #include "toolbar.hrc" #include "bibresid.hxx" diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index 09e3074afe69..f7eef64155bd 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -39,12 +39,12 @@ class BibToolBarListener: public cppu::WeakImplHelper1 < ::com::sun::star::frame { private: - sal_uInt16 nIndex; + sal_uInt16 nIndex; OUString aCommand; protected: - BibToolBar *pToolBar; + VclPtr<BibToolBar> pToolBar; public: diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 5a9817164ca0..6416a234d748 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -77,6 +77,19 @@ namespace dbp m_pDatasource->SetDropDownLineCount(10); } + OTableSelectionPage::~OTableSelectionPage() + { + dispose(); + } + + void OTableSelectionPage::dispose() + { + m_pDatasourceLabel.clear(); + m_pDatasource.clear(); + m_pSearchDatabase.clear(); + m_pTable.clear(); + OControlWizardPage::dispose(); + } void OTableSelectionPage::ActivatePage() { @@ -383,6 +396,19 @@ namespace dbp { } + OMaybeListSelectionPage::~OMaybeListSelectionPage() + { + dispose(); + } + + void OMaybeListSelectionPage::dispose() + { + m_pYes.clear(); + m_pNo.clear(); + m_pList.clear(); + OControlWizardPage::dispose(); + } + void OMaybeListSelectionPage::announceControls(RadioButton& _rYesButton, RadioButton& _rNoButton, ListBox& _rSelection) { m_pYes = &_rYesButton; @@ -453,6 +479,19 @@ namespace dbp m_pStoreWhere->SetDropDownLineCount(10); } + ODBFieldPage::~ODBFieldPage() + { + dispose(); + } + + void ODBFieldPage::dispose() + { + m_pDescription.clear(); + m_pStoreYes.clear(); + m_pStoreNo.clear(); + m_pStoreWhere.clear(); + OMaybeListSelectionPage::dispose(); + } void ODBFieldPage::initializePage() { diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 8d9d9c801d3f..1ff1d51b4601 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -36,16 +36,18 @@ namespace dbp class OTableSelectionPage : public OControlWizardPage { protected: - FixedText *m_pDatasourceLabel; - ListBox *m_pDatasource; - PushButton *m_pSearchDatabase; - ListBox *m_pTable; + VclPtr<FixedText> m_pDatasourceLabel; + VclPtr<ListBox> m_pDatasource; + VclPtr<PushButton> m_pSearchDatabase; + VclPtr<ListBox> m_pTable; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > m_xDSContext; public: OTableSelectionPage(OControlWizard* _pParent); + virtual ~OTableSelectionPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables @@ -74,12 +76,14 @@ namespace dbp class OMaybeListSelectionPage : public OControlWizardPage { protected: - RadioButton* m_pYes; - RadioButton* m_pNo; - ListBox* m_pList; + VclPtr<RadioButton> m_pYes; + VclPtr<RadioButton> m_pNo; + VclPtr<ListBox> m_pList; public: OMaybeListSelectionPage( OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription ); + virtual ~OMaybeListSelectionPage(); + virtual void dispose() SAL_OVERRIDE; protected: DECL_LINK( OnRadioSelected, RadioButton* ); @@ -105,13 +109,15 @@ namespace dbp class ODBFieldPage : public OMaybeListSelectionPage { protected: - FixedText* m_pDescription; - RadioButton* m_pStoreYes; - RadioButton* m_pStoreNo; - ListBox* m_pStoreWhere; + VclPtr<FixedText> m_pDescription; + VclPtr<RadioButton> m_pStoreYes; + VclPtr<RadioButton> m_pStoreNo; + VclPtr<ListBox> m_pStoreWhere; public: ODBFieldPage( OControlWizard* _pParent ); + virtual ~ODBFieldPage(); + virtual void dispose() SAL_OVERRIDE; protected: void setDescriptionText(const OUString& _rDesc) { m_pDescription->SetText(_rDesc); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index c3f8c025d20c..da84b94502d1 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -86,6 +86,18 @@ namespace dbp OControlWizardPage::~OControlWizardPage() { + dispose(); + } + + void OControlWizardPage::dispose() + { + m_pFormDatasourceLabel.clear(); + m_pFormDatasource.clear(); + m_pFormContentTypeLabel.clear(); + m_pFormContentType.clear(); + m_pFormTableLabel.clear(); + m_pFormTable.clear(); + OControlWizardPage_Base::dispose(); } OControlWizard* OControlWizardPage::getDialog() diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index 2d0fdbac7aa1..81016f548ab0 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -57,12 +57,12 @@ namespace dbp class OControlWizardPage : public OControlWizardPage_Base { protected: - FixedText* m_pFormDatasourceLabel; - FixedText* m_pFormDatasource; - FixedText* m_pFormContentTypeLabel; - FixedText* m_pFormContentType; - FixedText* m_pFormTableLabel; - FixedText* m_pFormTable; + VclPtr<FixedText> m_pFormDatasourceLabel; + VclPtr<FixedText> m_pFormDatasource; + VclPtr<FixedText> m_pFormContentTypeLabel; + VclPtr<FixedText> m_pFormContentType; + VclPtr<FixedText> m_pFormTableLabel; + VclPtr<FixedText> m_pFormTable; protected: OControlWizard* getDialog(); @@ -75,6 +75,7 @@ namespace dbp public: OControlWizardPage( OControlWizard* _pParent, const OString& rID, const OUString& rUIXMLDescription ); virtual ~OControlWizardPage(); + virtual void dispose() SAL_OVERRIDE; protected: void fillListBox( diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 0c68df814ee3..aadc8f86536d 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -318,6 +318,21 @@ namespace dbp m_pSelFields->SetDoubleClickHdl(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); } + OGridFieldsSelection::~OGridFieldsSelection() + { + dispose(); + } + + void OGridFieldsSelection::dispose() + { + m_pExistFields.clear(); + m_pSelectOne.clear(); + m_pSelectAll.clear(); + m_pDeselectOne.clear(); + m_pDeselectAll.clear(); + m_pSelFields.clear(); + OGridPage::dispose(); + } void OGridFieldsSelection::ActivatePage() { diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index 91da2fd5bee7..42db6683d176 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -82,15 +82,17 @@ namespace dbp class OGridFieldsSelection : public OGridPage { protected: - ListBox *m_pExistFields; - PushButton *m_pSelectOne; - PushButton *m_pSelectAll; - PushButton *m_pDeselectOne; - PushButton *m_pDeselectAll; - ListBox *m_pSelFields; + VclPtr<ListBox> m_pExistFields; + VclPtr<PushButton> m_pSelectOne; + VclPtr<PushButton> m_pSelectAll; + VclPtr<PushButton> m_pDeselectOne; + VclPtr<PushButton> m_pDeselectAll; + VclPtr<ListBox> m_pSelFields; public: OGridFieldsSelection( OGridWizard* _pParent ); + virtual ~OGridFieldsSelection(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 2f165addf0cf..1c5ac976dcbd 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -207,11 +207,24 @@ namespace dbp implCheckMoveButtons(); m_pExistingRadios->EnableMultiSelection(true); - getDialog()->defaultButton(m_pMoveRight); + getDialog()->defaultButton(m_pMoveRight.get()); m_pExistingRadios->SetAccessibleRelationMemberOf(m_pExistingRadios); } + ORadioSelectionPage::~ORadioSelectionPage() + { + dispose(); + } + + void ORadioSelectionPage::dispose() + { + m_pRadioName.clear(); + m_pMoveRight.clear(); + m_pMoveLeft.clear(); + m_pExistingRadios.clear(); + OGBWPage::dispose(); + } void ORadioSelectionPage::ActivatePage() { @@ -315,7 +328,7 @@ namespace dbp if (bUnfinishedInput) { if (0 == (m_pMoveRight->GetStyle() & WB_DEFBUTTON)) - getDialog()->defaultButton(m_pMoveRight); + getDialog()->defaultButton(m_pMoveRight.get()); } else { @@ -341,6 +354,18 @@ namespace dbp m_pDefSelection->SetStyle(WB_DROPDOWN); } + ODefaultFieldSelectionPage::~ODefaultFieldSelectionPage() + { + dispose(); + } + + void ODefaultFieldSelectionPage::dispose() + { + m_pDefSelYes.clear(); + m_pDefSelNo.clear(); + m_pDefSelection.clear(); + OMaybeListSelectionPage::dispose(); + } void ODefaultFieldSelectionPage::initializePage() { @@ -388,6 +413,17 @@ namespace dbp m_pOptions->SetAccessibleRelationMemberOf(m_pOptions); } + OOptionValuesPage::~OOptionValuesPage() + { + dispose(); + } + + void OOptionValuesPage::dispose() + { + m_pValue.clear(); + m_pOptions.clear(); + OGBWPage::dispose(); + } IMPL_LINK( OOptionValuesPage, OnOptionSelected, ListBox*, /*NOTINTERESTEDIN*/ ) { @@ -486,6 +522,16 @@ namespace dbp get(m_pName, "nameit"); } + OFinalizeGBWPage::~OFinalizeGBWPage() + { + dispose(); + } + + void OFinalizeGBWPage::dispose() + { + m_pName.clear(); + OGBWPage::dispose(); + } void OFinalizeGBWPage::ActivatePage() { diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index e37840f88216..b594d5b59eae 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -94,13 +94,15 @@ namespace dbp class ORadioSelectionPage : public OGBWPage { protected: - Edit *m_pRadioName; - PushButton *m_pMoveRight; - PushButton *m_pMoveLeft; - ListBox *m_pExistingRadios; + VclPtr<Edit> m_pRadioName; + VclPtr<PushButton> m_pMoveRight; + VclPtr<PushButton> m_pMoveLeft; + VclPtr<ListBox> m_pExistingRadios; public: ORadioSelectionPage( OControlWizard* _pParent ); + virtual ~ORadioSelectionPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables @@ -124,12 +126,14 @@ namespace dbp class ODefaultFieldSelectionPage : public OMaybeListSelectionPage { protected: - RadioButton *m_pDefSelYes; - RadioButton *m_pDefSelNo; - ListBox *m_pDefSelection; + VclPtr<RadioButton> m_pDefSelYes; + VclPtr<RadioButton> m_pDefSelNo; + VclPtr<ListBox> m_pDefSelection; public: ODefaultFieldSelectionPage( OControlWizard* _pParent ); + virtual ~ODefaultFieldSelectionPage(); + virtual void dispose() SAL_OVERRIDE; protected: // OWizardPage overridables @@ -145,8 +149,8 @@ namespace dbp class OOptionValuesPage : public OGBWPage { protected: - Edit *m_pValue; - ListBox *m_pOptions; + VclPtr<Edit> m_pValue; + VclPtr<ListBox> m_pOptions; StringArray m_aUncommittedValues; ::svt::WizardTypes::WizardState @@ -154,6 +158,8 @@ namespace dbp public: OOptionValuesPage( OControlWizard* _pParent ); + virtual ~OOptionValuesPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables @@ -189,10 +195,12 @@ namespace dbp class OFinalizeGBWPage : public OGBWPage { protected: - Edit *m_pName; + VclPtr<Edit> m_pName; public: OFinalizeGBWPage( OControlWizard* _pParent ); + virtual ~OFinalizeGBWPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 6349c0796c58..473a3862b0de 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -285,6 +285,16 @@ namespace dbp m_pSelectTable->SetSelectHdl(LINK(this, OContentTableSelection, OnTableSelected)); } + OContentTableSelection::~OContentTableSelection() + { + dispose(); + } + + void OContentTableSelection::dispose() + { + m_pSelectTable.clear(); + OLCPage::dispose(); + } void OContentTableSelection::ActivatePage() { @@ -369,6 +379,18 @@ namespace dbp m_pSelectTableField->SetDoubleClickHdl(LINK(this, OContentFieldSelection, OnTableDoubleClicked)); } + OContentFieldSelection::~OContentFieldSelection() + { + dispose(); + } + + void OContentFieldSelection::dispose() + { + m_pSelectTableField.clear(); + m_pDisplayedField.clear(); + m_pInfo.clear(); + OLCPage::dispose(); + } void OContentFieldSelection::ActivatePage() { @@ -439,6 +461,17 @@ namespace dbp m_pTableField->SetSelectHdl(LINK(this, OLinkFieldsPage, OnSelectionModified)); } + OLinkFieldsPage::~OLinkFieldsPage() + { + dispose(); + } + + void OLinkFieldsPage::dispose() + { + m_pValueListField.clear(); + m_pTableField.clear(); + OLCPage::dispose(); + } void OLinkFieldsPage::ActivatePage() { diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index 6d4908cdda5c..d1d05fbc8e04 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -108,10 +108,12 @@ namespace dbp class OContentTableSelection : public OLCPage { protected: - ListBox *m_pSelectTable; + VclPtr<ListBox> m_pSelectTable; public: OContentTableSelection( OListComboWizard* _pParent ); + virtual ~OContentTableSelection(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables @@ -133,13 +135,15 @@ namespace dbp class OContentFieldSelection : public OLCPage { protected: - ListBox *m_pSelectTableField; - Edit *m_pDisplayedField; - FixedText *m_pInfo; + VclPtr<ListBox> m_pSelectTableField; + VclPtr<Edit> m_pDisplayedField; + VclPtr<FixedText> m_pInfo; public: OContentFieldSelection( OListComboWizard* _pParent ); + virtual ~OContentFieldSelection(); + virtual void dispose() SAL_OVERRIDE; protected: DECL_LINK( OnFieldSelected, ListBox* ); @@ -160,12 +164,14 @@ namespace dbp class OLinkFieldsPage : public OLCPage { protected: - ComboBox *m_pValueListField; - ComboBox *m_pTableField; + VclPtr<ComboBox> m_pValueListField; + VclPtr<ComboBox> m_pTableField; public: OLinkFieldsPage( OListComboWizard* _pParent ); + virtual ~OLinkFieldsPage(); + virtual void dispose() SAL_OVERRIDE; protected: // TabPage overridables diff --git a/extensions/source/plugin/inc/plugin/plctrl.hxx b/extensions/source/plugin/inc/plugin/plctrl.hxx index bab35813b453..ab5d33c80abd 100644 --- a/extensions/source/plugin/inc/plugin/plctrl.hxx +++ b/extensions/source/plugin/inc/plugin/plctrl.hxx @@ -60,6 +60,7 @@ #include <com/sun/star/awt/PosSize.hpp> #include <cppuhelper/implbase4.hxx> +#include <vcl/vclptr.hxx> #include <list> @@ -152,9 +153,9 @@ protected: protected: ::std::list< Reference< ::com::sun::star::lang::XEventListener > > _aDisposeListeners; - MRCListenerMultiplexerHelper* _pMultiplexer; + MRCListenerMultiplexerHelper* _pMultiplexer; - Reference< XInterface > _xContext; + Reference< XInterface > _xContext; sal_Int32 _nX; sal_Int32 _nY; @@ -162,11 +163,11 @@ protected: sal_Int32 _nHeight; sal_Int16 _nFlags; - bool _bVisible; - bool _bInDesignMode; - bool _bEnable; + bool _bVisible; + bool _bInDesignMode; + bool _bEnable; - SystemChildWindow* _pSysChild; + VclPtr<SystemChildWindow> _pSysChild; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xPeer; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xPeerWindow; diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 069a406c1f52..3de62a17848f 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -376,7 +376,7 @@ namespace pcr PushButton& OBrowserLine::impl_ensureButton( bool _bPrimary ) { - PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton; + VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton; if ( !rpButton ) { @@ -443,13 +443,12 @@ namespace pcr void OBrowserLine::implHideBrowseButton( bool _bPrimary, bool _bReLayout ) { - PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton; + VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton; if ( rpButton ) { rpButton->Hide(); - delete rpButton; - rpButton = NULL; + rpButton.clear(); } if ( _bReLayout ) diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index ff16ae9f549f..d720967c02bf 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -56,11 +56,11 @@ namespace pcr Point m_aLinePos; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > m_xControl; - vcl::Window* m_pControlWindow; - PushButton* m_pBrowseButton; - PushButton* m_pAdditionalBrowseButton; + VclPtr<vcl::Window> m_pControlWindow; + VclPtr<PushButton> m_pBrowseButton; + VclPtr<PushButton> m_pAdditionalBrowseButton; IButtonClickListener* m_pClickListener; - vcl::Window* m_pTheParent; + VclPtr<vcl::Window> m_pTheParent; sal_uInt16 m_nNameWidth; sal_uInt16 m_nEnableFlags; bool m_bIndentTitle; diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx index 7a39ac9092a7..dcf118164793 100644 --- a/extensions/source/propctrlr/browserview.cxx +++ b/extensions/source/propctrlr/browserview.cxx @@ -21,6 +21,7 @@ #include "propertyeditor.hxx" #include "propctrlr.hrc" #include <boost/scoped_ptr.hpp> +#include <vcl/tabpage.hxx> namespace pcr { @@ -63,9 +64,8 @@ namespace pcr sal_uInt16 nTmpPage = m_pPropBox->GetCurPage(); if (nTmpPage) m_nActivePage = nTmpPage; - boost::scoped_ptr<vcl::Window> aTemp(m_pPropBox); - m_pPropBox = NULL; } + m_pPropBox.clear(); vcl::Window::dispose(); } diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx index 249d87c962c0..9ae97d364295 100644 --- a/extensions/source/propctrlr/browserview.hxx +++ b/extensions/source/propctrlr/browserview.hxx @@ -37,7 +37,7 @@ namespace pcr class OPropertyBrowserView : public vcl::Window { - OPropertyEditor* m_pPropBox; + VclPtr<OPropertyEditor> m_pPropBox; sal_uInt16 m_nActivePage; Link m_aPageActivationHandler; diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx index 096b717c8f4a..c93594bec4ec 100644 --- a/extensions/source/propctrlr/commoncontrol.cxx +++ b/extensions/source/propctrlr/commoncontrol.cxx @@ -47,7 +47,7 @@ namespace pcr ,m_pModifyListener( _pModifyListener ) ,m_bModified( false ) { - DBG_ASSERT( m_pControlWindow != NULL, "ControlHelper::ControlHelper: invalid window!" ); + DBG_ASSERT( m_pControlWindow != nullptr, "ControlHelper::ControlHelper: invalid window!" ); } @@ -55,11 +55,6 @@ namespace pcr { } - - - - - void SAL_CALL ControlHelper::setControlContext( const Reference< XPropertyControlContext >& _controlcontext ) throw (RuntimeException) { m_xContext = _controlcontext; @@ -93,7 +88,7 @@ namespace pcr void SAL_CALL ControlHelper::dispose() { - DELETEZ( m_pControlWindow ); + m_pControlWindow.clear(); } diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index 629660eda8d7..cbe825f32156 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -86,7 +86,7 @@ namespace pcr class ControlHelper { private: - vcl::Window* m_pControlWindow; + VclPtr<vcl::Window> m_pControlWindow; sal_Int16 m_nControlType; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlContext > m_xContext; diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx index 66718f0d081d..c06fc1f880ae 100644 --- a/extensions/source/propctrlr/controlfontdialog.cxx +++ b/extensions/source/propctrlr/controlfontdialog.cxx @@ -169,7 +169,7 @@ namespace pcr OSL_ENSURE(m_pDialog, "OControlFontDialog::executedDialog: no dialog anymore?!!"); if (m_pDialog && (sal_True == _nExecutionResult) && m_xControlModel.is()) { - const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog)->GetOutputItemSet(); + const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog.get())->GetOutputItemSet(); if (pOutput) ControlCharacterDialog::translateItemsToProperties( *pOutput, m_xControlModel ); } diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index c7fda6ba8361..31011bf7ff3b 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -64,13 +64,15 @@ namespace pcr class FieldLinkRow : public TabPage { private: - ComboBox* m_pDetailColumn; - ComboBox* m_pMasterColumn; + VclPtr<ComboBox> m_pDetailColumn; + VclPtr<ComboBox> m_pMasterColumn; Link m_aLinkChangeHandler; public: FieldLinkRow( vcl::Window* _pParent ); + virtual ~FieldLinkRow(); + virtual void dispose() SAL_OVERRIDE; inline void SetLinkChangeHandler( const Link& _rHdl ) { m_aLinkChangeHandler = _rHdl; } @@ -105,6 +107,17 @@ namespace pcr m_pMasterColumn->SetModifyHdl( LINK( this, FieldLinkRow, OnFieldNameChanged ) ); } + FieldLinkRow::~FieldLinkRow() + { + dispose(); + } + + void FieldLinkRow::dispose() + { + m_pDetailColumn.clear(); + m_pMasterColumn.clear(); + TabPage::dispose(); + } void FieldLinkRow::fillList( LinkParticipant _eWhich, const Sequence< OUString >& _rFieldNames ) { @@ -193,8 +206,18 @@ namespace pcr FormLinkDialog::~FormLinkDialog( ) { + dispose(); } + void FormLinkDialog::dispose( ) + { + m_pExplanation.clear(); + m_pDetailLabel.clear(); + m_pMasterLabel.clear(); + m_pOK.clear(); + m_pSuggest.clear(); + ModalDialog::dispose(); + } void FormLinkDialog::commitLinkPairs() { diff --git a/extensions/source/propctrlr/formlinkdialog.hxx b/extensions/source/propctrlr/formlinkdialog.hxx index 94b386e7108f..7f563a2dafaf 100644 --- a/extensions/source/propctrlr/formlinkdialog.hxx +++ b/extensions/source/propctrlr/formlinkdialog.hxx @@ -44,15 +44,15 @@ namespace pcr class FormLinkDialog : public ModalDialog { private: - FixedText* m_pExplanation; - FixedText* m_pDetailLabel; - FixedText* m_pMasterLabel; + VclPtr<FixedText> m_pExplanation; + VclPtr<FixedText> m_pDetailLabel; + VclPtr<FixedText> m_pMasterLabel; ::std::unique_ptr< FieldLinkRow > m_aRow1; ::std::unique_ptr< FieldLinkRow > m_aRow2; ::std::unique_ptr< FieldLinkRow > m_aRow3; ::std::unique_ptr< FieldLinkRow > m_aRow4; - OKButton* m_pOK; - PushButton* m_pSuggest; + VclPtr<OKButton> m_pOK; + VclPtr<PushButton> m_pSuggest; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; @@ -80,6 +80,7 @@ namespace pcr const OUString& _sMasterLabel = OUString() ); virtual ~FormLinkDialog( ); + virtual void dispose() SAL_OVERRIDE; // Dialog overridables virtual short Execute() SAL_OVERRIDE; diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx index fdb6229dc370..b8a92d928e05 100644 --- a/extensions/source/propctrlr/listselectiondlg.cxx +++ b/extensions/source/propctrlr/listselectiondlg.cxx @@ -48,6 +48,17 @@ namespace pcr initialize( ); } + ListSelectionDialog::~ListSelectionDialog() + { + dispose(); + } + + void ListSelectionDialog::dispose() + { + m_pEntries.clear(); + ModalDialog::dispose(); + } + short ListSelectionDialog::Execute() { short nResult = ModalDialog::Execute(); diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx index aaccb0754ec2..ca9a118c06f9 100644 --- a/extensions/source/propctrlr/listselectiondlg.hxx +++ b/extensions/source/propctrlr/listselectiondlg.hxx @@ -31,7 +31,7 @@ namespace pcr class ListSelectionDialog : public ModalDialog { private: - ListBox* m_pEntries; + VclPtr<ListBox> m_pEntries; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xListBox; @@ -44,6 +44,8 @@ namespace pcr const OUString& _rPropertyName, const OUString& _rPropertyUIName ); + virtual ~ListSelectionDialog(); + virtual void dispose() SAL_OVERRIDE; // Dialog overridables virtual short Execute() SAL_OVERRIDE; diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx index 62cc6da9c247..9a7810578f49 100644 --- a/extensions/source/propctrlr/newdatatype.cxx +++ b/extensions/source/propctrlr/newdatatype.cxx @@ -67,6 +67,17 @@ namespace pcr OnNameModified( NULL ); } + NewDataTypeDialog::~NewDataTypeDialog() + { + dispose(); + } + + void NewDataTypeDialog::dispose() + { + m_pName.clear(); + m_pOK.clear(); + ModalDialog::dispose(); + } IMPL_LINK( NewDataTypeDialog, OnNameModified, void*, /*_pNotInterestedIn*/ ) { diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx index 135514aaa271..abccb19bd1f9 100644 --- a/extensions/source/propctrlr/newdatatype.hxx +++ b/extensions/source/propctrlr/newdatatype.hxx @@ -35,14 +35,16 @@ namespace pcr class NewDataTypeDialog : public ModalDialog { private: - Edit* m_pName; - OKButton* m_pOK; + VclPtr<Edit> m_pName; + VclPtr<OKButton> m_pOK; ::std::set< OUString > m_aProhibitedNames; public: NewDataTypeDialog(vcl::Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames ); + virtual ~NewDataTypeDialog(); + virtual void dispose() SAL_OVERRIDE; OUString GetName() const { return m_pName->GetText(); } diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 77b518878526..95786ad18e65 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -44,6 +44,7 @@ #include <comphelper/property.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> +#include <vcl/tabpage.hxx> #include <osl/mutex.hxx> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/component_context.hxx> diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx index af943de01f13..f204a86c8735 100644 --- a/extensions/source/propctrlr/propcontroller.hxx +++ b/extensions/source/propctrlr/propcontroller.hxx @@ -105,7 +105,7 @@ namespace pcr ::cppu::OInterfaceContainerHelper m_aDisposeListeners; ::cppu::OInterfaceContainerHelper m_aControlObservers; // meta data about the properties - OPropertyBrowserView* m_pView; + VclPtr<OPropertyBrowserView> m_pView; OUString m_sPageSelection; OUString m_sLastValidPageSelection; @@ -242,7 +242,7 @@ namespace pcr // stop the inspection void stopInspection( bool _bCommitModified ); - bool haveView() const { return NULL != m_pView; } + bool haveView() const { return nullptr != m_pView; } OPropertyEditor& getPropertyBox() { return m_pView->getPropertyBox(); } // does the inspection of the objects as indicated by our model diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx index 45a59b2c7275..50057870ab84 100644 --- a/extensions/source/propctrlr/propertyeditor.cxx +++ b/extensions/source/propctrlr/propertyeditor.cxx @@ -96,11 +96,7 @@ namespace pcr m_aPropertyPageIds.swap( aEmpty ); } - while ( !m_aHiddenPages.empty() ) - { - delete m_aHiddenPages.begin()->second.pPage; - m_aHiddenPages.erase( m_aHiddenPages.begin() ); - } + m_aHiddenPages.clear(); } diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx index 72f36441dddb..a43ee8ded711 100644 --- a/extensions/source/propctrlr/propertyeditor.hxx +++ b/extensions/source/propctrlr/propertyeditor.hxx @@ -49,7 +49,7 @@ namespace pcr struct HiddenPage { sal_uInt16 nPos; - TabPage* pPage; + VclPtr<TabPage> pPage; HiddenPage() : nPos( 0 ), pPage( NULL ) { } HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { } }; diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index a98910a55f39..fcc538e326ae 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -159,6 +159,9 @@ namespace pcr delete static_cast<Reference< XPropertySet > *>(pData); pLoop = m_pControlTree->Next(pLoop); } + m_pMainDesc.clear(); + m_pControlTree.clear(); + m_pNoAssignment.clear(); ModalDialog::dispose(); } diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx index 40073fde83a8..45144c646738 100644 --- a/extensions/source/propctrlr/selectlabeldialog.hxx +++ b/extensions/source/propctrlr/selectlabeldialog.hxx @@ -40,9 +40,9 @@ namespace pcr :public ModalDialog ,public PcrClient { - FixedText *m_pMainDesc; - SvTreeListBox *m_pControlTree; - CheckBox *m_pNoAssignment; + VclPtr<FixedText> m_pMainDesc; + VclPtr<SvTreeListBox> m_pControlTree; + VclPtr<CheckBox> m_pNoAssignment; ImageList m_aModelImages; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControlModel; diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index c4b452c46cd0..f78da9b8f6c6 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -1041,7 +1041,7 @@ namespace pcr { SetCompoundControl( true ); - m_pImplEdit = VclPtr<MultiLineEdit>( new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ) ); + m_pImplEdit = new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) ); SetSubEdit( m_pImplEdit ); m_pImplEdit->Show(); @@ -1077,16 +1077,10 @@ namespace pcr void DropDownEditControl::dispose() { - { - boost::scoped_ptr<vcl::Window> aTemp(m_pFloatingEdit); - m_pFloatingEdit = NULL; - } - SetSubEdit(VclPtr<Edit>()); - { - boost::scoped_ptr<vcl::Window> aTemp(m_pDropdownButton); - m_pDropdownButton = NULL; - } + SetSubEdit(nullptr); m_pImplEdit.disposeAndClear(); + m_pFloatingEdit.clear(); + m_pDropdownButton.clear(); DropDownEditControl_Base::dispose(); } @@ -1095,7 +1089,7 @@ namespace pcr { ::Size aOutSz = GetOutputSizePixel(); - if (m_pDropdownButton!=NULL) + if (m_pDropdownButton!=nullptr) { long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); nSBWidth = CalcZoom( nSBWidth ); diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index cf8c473ad8f5..9eb99354abda 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -374,9 +374,9 @@ namespace pcr class DropDownEditControl : public DropDownEditControl_Base { private: - OMultilineFloatingEdit* m_pFloatingEdit; + VclPtr<OMultilineFloatingEdit> m_pFloatingEdit; VclPtr<MultiLineEdit> m_pImplEdit; - PushButton* m_pDropdownButton; + VclPtr<PushButton> m_pDropdownButton; MultiLineOperationMode m_nOperationMode; bool m_bDropdown : 1; diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 64b7e107900d..52ec5c8ad250 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -126,6 +126,11 @@ namespace pcr m_pLB_Controls->Hide(); // delete pLB_Controls; delete pImageList; + m_pLB_Controls.clear(); + m_pPB_OK.clear(); + m_pPB_MoveUp.clear(); + m_pPB_MoveDown.clear(); + m_pPB_AutoOrder.clear(); ModalDialog::dispose(); } diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx index 3685b9cda2e0..f56d4b45bc01 100644 --- a/extensions/source/propctrlr/taborder.hxx +++ b/extensions/source/propctrlr/taborder.hxx @@ -73,13 +73,13 @@ namespace pcr ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB; - TabOrderListBox* m_pLB_Controls; + VclPtr<TabOrderListBox> m_pLB_Controls; - OKButton* m_pPB_OK; + VclPtr<OKButton> m_pPB_OK; - PushButton* m_pPB_MoveUp; - PushButton* m_pPB_MoveDown; - PushButton* m_pPB_AutoOrder; + VclPtr<PushButton> m_pPB_MoveUp; + VclPtr<PushButton> m_pPB_MoveDown; + VclPtr<PushButton> m_pPB_AutoOrder; ImageList* pImageList; diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index faa33e9f0dae..e99ffb542459 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -213,6 +213,20 @@ GridDialog::GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Win m_pResetButton->SetClickHdl( LINK( this, GridDialog, ClickButtonHdl ) ); } +GridDialog::~GridDialog() +{ + dispose(); +} + +void GridDialog::dispose() +{ + m_pOKButton.clear(); + m_pResetTypeBox.clear(); + m_pResetButton.clear(); + m_pGridWindow.clear(); + ModalDialog::dispose(); +} + GridWindow::~GridWindow() { dispose(); diff --git a/extensions/source/scanner/grid.hxx b/extensions/source/scanner/grid.hxx index 6fca647facd5..940dec60097e 100644 --- a/extensions/source/scanner/grid.hxx +++ b/extensions/source/scanner/grid.hxx @@ -37,19 +37,20 @@ enum resetType class GridDialog : public ModalDialog { - OKButton* m_pOKButton; + VclPtr<OKButton> m_pOKButton; - ListBox* m_pResetTypeBox; - PushButton* m_pResetButton; + VclPtr<ListBox> m_pResetTypeBox; + VclPtr<PushButton> m_pResetButton; - GridWindow* m_pGridWindow; + VclPtr<GridWindow> m_pGridWindow; DECL_LINK( ClickButtonHdl, Button* ); public: GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Window* pParent, bool bCutValues = true); - + virtual ~GridDialog(); + virtual void dispose() SAL_OVERRIDE; void setBoundings(double fMinX, double fMinY, double fMaxX, double fMaxY); double* getNewYValues(); }; diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 8c84962cf957..6f977ef7cce0 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -43,7 +43,7 @@ private: Rectangle maPreviewRect; Point maTopLeft, maBottomRight; Point maMinTopLeft, maMaxBottomRight; - SaneDlg* mpParentDialog; + VclPtr<SaneDlg> mpParentDialog; DragDirection meDragDirection; bool mbDragEnable; bool mbDragDrawn; @@ -61,6 +61,12 @@ public: , mbIsDragging(false) { } + virtual ~ScanPreview() { dispose(); } + virtual void dispose() SAL_OVERRIDE + { + mpParentDialog.clear(); + vcl::Window::dispose(); + } void Init(SaneDlg *pParent) { mpParentDialog = pParent; @@ -245,6 +251,30 @@ SaneDlg::~SaneDlg() void SaneDlg::dispose() { mrSane.SetReloadOptionsHdl( maOldLink ); + mpOKButton.clear(); + mpCancelButton.clear(); + mpDeviceInfoButton.clear(); + mpPreviewButton.clear(); + mpScanButton.clear(); + mpButtonOption.clear(); + mpOptionTitle.clear(); + mpOptionDescTxt.clear(); + mpVectorTxt.clear(); + mpLeftField.clear(); + mpTopField.clear(); + mpRightField.clear(); + mpBottomField.clear(); + mpDeviceBox.clear(); + mpReslBox.clear(); + mpAdvancedBox.clear(); + mpVectorBox.clear(); + mpQuantumRangeBox.clear(); + mpStringRangeBox.clear(); + mpBoolCheckBox.clear(); + mpStringEdit.clear(); + mpNumericEdit.clear(); + mpOptionBox.clear(); + mpPreview.clear(); ModalDialog::dispose(); } diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index ac7d664082be..6aca2733c3a7 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -40,38 +40,38 @@ private: Link maOldLink; - OKButton* mpOKButton; - CancelButton* mpCancelButton; - PushButton* mpDeviceInfoButton; - PushButton* mpPreviewButton; - PushButton* mpScanButton; - PushButton* mpButtonOption; + VclPtr<OKButton> mpOKButton; + VclPtr<CancelButton> mpCancelButton; + VclPtr<PushButton> mpDeviceInfoButton; + VclPtr<PushButton> mpPreviewButton; + VclPtr<PushButton> mpScanButton; + VclPtr<PushButton> mpButtonOption; - FixedText* mpOptionTitle; - FixedText* mpOptionDescTxt; - FixedText* mpVectorTxt; + VclPtr<FixedText> mpOptionTitle; + VclPtr<FixedText> mpOptionDescTxt; + VclPtr<FixedText> mpVectorTxt; - MetricField* mpLeftField; - MetricField* mpTopField; - MetricField* mpRightField; - MetricField* mpBottomField; + VclPtr<MetricField> mpLeftField; + VclPtr<MetricField> mpTopField; + VclPtr<MetricField> mpRightField; + VclPtr<MetricField> mpBottomField; - ListBox* mpDeviceBox; - NumericBox* mpReslBox; - CheckBox* mpAdvancedBox; + VclPtr<ListBox> mpDeviceBox; + VclPtr<NumericBox> mpReslBox; + VclPtr<CheckBox> mpAdvancedBox; - NumericField* mpVectorBox; - ListBox* mpQuantumRangeBox; - ListBox* mpStringRangeBox; + VclPtr<NumericField> mpVectorBox; + VclPtr<ListBox> mpQuantumRangeBox; + VclPtr<ListBox> mpStringRangeBox; - CheckBox* mpBoolCheckBox; + VclPtr<CheckBox> mpBoolCheckBox; - Edit* mpStringEdit; - Edit* mpNumericEdit; + VclPtr<Edit> mpStringEdit; + VclPtr<Edit> mpNumericEdit; - SvTreeListBox* mpOptionBox; + VclPtr<SvTreeListBox> mpOptionBox; - ScanPreview* mpPreview; + VclPtr<ScanPreview> mpPreview; int mnCurrentOption; int mnCurrentElement; |