From: Vadim Zeitlin Date: Sat, 11 Aug 2012 23:09:29 +0000 (+0000) Subject: Really delete the item in wxDataViewTreeStore::DeleteItem(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a73a80a9879a1781a230fa40749f16975b0670e4?ds=inline Really delete the item in wxDataViewTreeStore::DeleteItem(). For some incomprehensible reason only child branches were ever deleted from the list of parents children in DeleteItem(), not simple tree items. This meant that reexpanding a node after deleting all its children showed the previously "deleted" children again. Closes #14574. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 881fc24cd1..69301bc8a1 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -2184,10 +2184,7 @@ void wxDataViewTreeStore::DeleteItem( const wxDataViewItem& item ) wxDataViewTreeStoreContainerNode *parent_node = FindContainerNode( parent_item ); if (!parent_node) return; - wxDataViewTreeStoreContainerNode *node = FindContainerNode( item ); - if (!node) return; - - parent_node->GetChildren().DeleteObject( node ); + parent_node->GetChildren().DeleteObject( FindNode(item) ); } void wxDataViewTreeStore::DeleteChildren( const wxDataViewItem& item )