Minor correction, use wxCHECK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1997,16 +1997,10 @@ void DestroyTreeHelper( wxDataViewTreeNode * node);
|
|||||||
bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
|
bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
|
||||||
const wxDataViewItem& item)
|
const wxDataViewItem& item)
|
||||||
{
|
{
|
||||||
SortPrepare();
|
wxDataViewTreeNode * node = FindNode(parent);
|
||||||
|
|
||||||
wxDataViewTreeNode * node;
|
wxCHECK_MSG( node != NULL, false, "item not found" );
|
||||||
node = FindNode(parent);
|
wxCHECK_MSG( node->GetChildren().Index( item.GetID() ) != wxNOT_FOUND, false, "item not found" );
|
||||||
|
|
||||||
SendModelEvent(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, item);
|
|
||||||
if( node == NULL || node->GetChildren().Index( item.GetID() ) == wxNOT_FOUND )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sub = -1;
|
int sub = -1;
|
||||||
node->GetChildren().Remove( item.GetID() );
|
node->GetChildren().Remove( item.GetID() );
|
||||||
@@ -2030,8 +2024,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!n)
|
wxCHECK_MSG( n != NULL, false, "item not found" );
|
||||||
return false;
|
|
||||||
|
|
||||||
node->GetNodes().Remove( n );
|
node->GetNodes().Remove( n );
|
||||||
sub -= n->GetSubTreeCount();
|
sub -= n->GetSubTreeCount();
|
||||||
@@ -2049,6 +2042,9 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
|
|||||||
m_currentRow = m_count - 1;
|
m_currentRow = m_count - 1;
|
||||||
|
|
||||||
UpdateDisplay();
|
UpdateDisplay();
|
||||||
|
|
||||||
|
SendModelEvent(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, item);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user