]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor correction, use wxCHECK
authorRobert Roebling <robert@roebling.de>
Tue, 28 Aug 2007 10:28:51 +0000 (10:28 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 28 Aug 2007 10:28:51 +0000 (10:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index 7dfffb0c4bd8520f65dcb9146771c3fb0d2a81a2..b99b53650793a813e070e615d10ea41d96d7f5a1 100644 (file)
@@ -1997,16 +1997,10 @@ void DestroyTreeHelper( wxDataViewTreeNode * node);
 bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
                                        const wxDataViewItem& item)
 {
-    SortPrepare();
-
-    wxDataViewTreeNode * node;
-    node = FindNode(parent);
-
-    SendModelEvent(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, item);
-    if( node == NULL || node->GetChildren().Index( item.GetID() ) == wxNOT_FOUND )
-    {
-        return false;
-    }
+    wxDataViewTreeNode * node = FindNode(parent);
+    
+    wxCHECK_MSG( node != NULL, false, "item not found" );
+    wxCHECK_MSG( node->GetChildren().Index( item.GetID() ) != wxNOT_FOUND, false, "item not found" );
 
     int sub = -1;
     node->GetChildren().Remove( item.GetID() );
@@ -2030,8 +2024,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
             }
         }
 
-        if (!n)
-            return false;
+        wxCHECK_MSG( n != NULL, false, "item not found" );
 
         node->GetNodes().Remove( n );
         sub -= n->GetSubTreeCount();
@@ -2049,6 +2042,9 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
         m_currentRow = m_count - 1;
 
     UpdateDisplay();
+    
+    SendModelEvent(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, item);
+
     return true;
 }