diff options
Diffstat (limited to 'dbaccess')
4 files changed, 14 insertions, 14 deletions
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 19db7a2561ad..fdfda8cd7f17 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -693,11 +693,11 @@ 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 ) diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 5a858e9fe394..2125cbd7fa1e 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -265,7 +265,7 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete ) Any()); if ( _bDelete ) { - delete _pConn; + VclPtr<OTableConnection>(_pConn).disposeAndClear(); } return true; @@ -326,7 +326,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r TTableWindowData::value_type pNewTabWinData(createTableWindowData( _rComposedName, rWinName,rWinName )); // insert new window in window list - OTableWindow* pNewTabWin = createWindow( pNewTabWinData ); + VclPtr<OTableWindow> pNewTabWin = createWindow( pNewTabWinData ); if ( pNewTabWin->Init() ) { m_pView->getController().getTableWindowData().push_back( pNewTabWinData); @@ -348,7 +348,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r else { pNewTabWin->clearListBox(); - delete pNewTabWin; + pNewTabWin.disposeAndClear(); } } @@ -398,7 +398,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) m_pLastFocusTabWin = NULL; pTabWin->clearListBox(); - delete pTabWin; + VclPtr<OTableWindow>(pTabWin).disposeAndClear(); } if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 18d0fd583bb7..66c6e4dc978c 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -259,7 +259,7 @@ void OQueryTableView::ReSync() for(;aIter != rTabWinDataList.rend();++aIter) { OQueryTableWindowData* pData = static_cast<OQueryTableWindowData*>(aIter->get()); - OTableWindow* pTabWin = createWindow(*aIter); + VclPtr<OTableWindow> pTabWin = createWindow(*aIter); // I dont't use ShowTabWin as this adds the window data to the list of documents. // This would be bad as I am getting them from there. @@ -269,7 +269,7 @@ void OQueryTableView::ReSync() // The initialisation has gone wrong, this TabWin is not available, so // I must clean up the data and the document pTabWin->clearListBox(); - delete pTabWin; + pTabWin.disposeAndClear(); arrInvalidTables.push_back(pData->GetAliasName()); rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end()); @@ -926,7 +926,7 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc // Initialisation failed // (for example when the Connection to the database is not available at the moment) pTabWin->clearListBox(); - delete pTabWin; + VclPtr<OQueryTableWindow>(pTabWin).disposeAndClear(); } } diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 75b0c7919147..615a760349de 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -106,14 +106,14 @@ void ORelationTableView::ReSync() for(;aIter != rTabWinDataList.rend();++aIter) { TTableWindowData::value_type pData = *aIter; - OTableWindow* pTabWin = createWindow(pData); + VclPtr<OTableWindow> pTabWin = createWindow(pData); if (!pTabWin->Init()) { // initialisation failed, which means this TabWin is not available, therefore, // it should be cleaned up, including its data in the document pTabWin->clearListBox(); - delete pTabWin; + pTabWin.disposeAndClear(); arrInvalidTables.push_back(pData->GetTableName()); rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end()); @@ -300,7 +300,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin pNewTabWinData->ShowAll(false); // link new window into the window list - OTableWindow* pNewTabWin = createWindow( pNewTabWinData ); + VclPtr<OTableWindow> pNewTabWin = createWindow( pNewTabWinData ); if(pNewTabWin->Init()) { m_pView->getController().getTableWindowData().push_back( pNewTabWinData); @@ -320,7 +320,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin else { pNewTabWin->clearListBox(); - delete pNewTabWin; + pNewTabWin.disposeAndClear(); } } |