summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-18 08:33:14 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 11:59:25 +0100
commit0556598b35eb6d81fdaff04520f14202660f0333 (patch)
tree2fb64309bbd8e519f25b1e55824bad5513754e91 /dbaccess/source
parent7aa921cb53eedd0a107fbe9f75365adcce4d37d9 (diff)
vclwidget: check for calling delete on subclasses of vcl::Window
Change-Id: I7fb7cf919e3f46dd03a18b1cb95fa881915f9642
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx8
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();
}
}