diff options
Diffstat (limited to 'dbaccess/source/ui/misc/WCopyTable.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/WCopyTable.cxx | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 90f1894c41bc..9569788f759b 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -578,16 +578,16 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window * pParent, const OUString& _rDef m_sName = ::dbtools::composeTableName(m_xDestConnection->getMetaData(),sCatalog,sSchema,sTable,false,::dbtools::eInTableDefinitions); } - OCopyTable* pPage1( new OCopyTable( this ) ); + VclPtrInstance<OCopyTable> pPage1( this ); pPage1->disallowUseHeaderLine(); if ( !bAllowViews ) pPage1->disallowViews(); pPage1->setCreateStyleAction(); AddWizardPage(pPage1); - AddWizardPage( new OWizNameMatching( this ) ); - AddWizardPage( new OWizColumnSelect( this ) ); - AddWizardPage( new OWizNormalExtend( this ) ); + AddWizardPage( VclPtr<OWizNameMatching>::Create( this ) ); + AddWizardPage( VclPtr<OWizColumnSelect>::Create( this ) ); + AddWizardPage( VclPtr<OWizNormalExtend>::Create( this ) ); ActivatePage(); } @@ -624,13 +624,13 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window* pParent, const OUString& _rDefa m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); - OCopyTable* pPage1( new OCopyTable( this ) ); + VclPtrInstance<OCopyTable> pPage1( this ); pPage1->disallowViews(); pPage1->setCreateStyleAction(); AddWizardPage( pPage1 ); - AddWizardPage( new OWizNameMatching( this ) ); - AddWizardPage( new OWizColumnSelect( this ) ); + AddWizardPage( VclPtr<OWizNameMatching>::Create( this ) ); + AddWizardPage( VclPtr<OWizColumnSelect>::Create( this ) ); AddWizardPage( (*_pTypeSelectionPageFactory)( this, _rTypeSelectionPageArg ) ); ActivatePage(); @@ -640,11 +640,11 @@ void OCopyTableWizard::construct() { SetSizePixel(Size(580, 350)); - AddButton( m_pbHelp = new HelpButton(this, WB_TABSTOP) ); - AddButton( m_pbCancel = new CancelButton(this, WB_TABSTOP) ); - AddButton( m_pbPrev = new PushButton(this, WB_TABSTOP)); - AddButton( m_pbNext = new PushButton(this, WB_TABSTOP)); - AddButton( m_pbFinish = new PushButton(this, WB_TABSTOP)); + AddButton( m_pbHelp = VclPtr<HelpButton>::Create(this, WB_TABSTOP) ); + AddButton( m_pbCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP) ); + AddButton( m_pbPrev = VclPtr<PushButton>::Create(this, WB_TABSTOP)); + AddButton( m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP)); + AddButton( m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP)); m_pbHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); m_pbCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); @@ -686,13 +686,18 @@ void OCopyTableWizard::construct() OCopyTableWizard::~OCopyTableWizard() { + disposeOnce(); +} + +void OCopyTableWizard::dispose() +{ for ( ;; ) { - TabPage *pPage = GetPage(0); - if ( pPage == NULL ) + VclPtr<TabPage> pPage = GetPage(0); + if ( pPage == nullptr ) break; RemovePage( pPage ); - delete pPage; + pPage.disposeAndClear(); } if ( m_bDeleteSourceColumns ) @@ -705,11 +710,12 @@ OCopyTableWizard::~OCopyTableWizard() m_aTypeInfo.clear(); m_aDestTypeInfoIndex.clear(); - delete m_pbHelp; - delete m_pbCancel; - delete m_pbPrev; - delete m_pbNext; - delete m_pbFinish; + m_pbHelp.disposeAndClear(); + m_pbCancel.disposeAndClear(); + m_pbPrev.disposeAndClear(); + m_pbNext.disposeAndClear(); + m_pbFinish.disposeAndClear(); + WizardDialog::dispose(); } IMPL_LINK_NOARG(OCopyTableWizard, ImplPrevHdl) |