removed useless checks for tree==NULL in wxGenericTreeItem::DeleteChildren(), as tree==this of the calling object (coverity checker CID 6)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
91894db3d7
commit
66619ee50c
@ -199,9 +199,9 @@ public:
|
|||||||
wxGenericTreeItem *GetParent() const { return m_parent; }
|
wxGenericTreeItem *GetParent() const { return m_parent; }
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
// deletes all children notifying the treectrl about it if !NULL
|
|
||||||
// pointer given
|
// deletes all children notifying the treectrl about it
|
||||||
void DeleteChildren(wxGenericTreeCtrl *tree = NULL);
|
void DeleteChildren(wxGenericTreeCtrl *tree);
|
||||||
|
|
||||||
// get count of all children (and grand children if 'recursively')
|
// get count of all children (and grand children if 'recursively')
|
||||||
size_t GetChildrenCount(bool recursively = true) const;
|
size_t GetChildrenCount(bool recursively = true) const;
|
||||||
@ -548,11 +548,10 @@ void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree)
|
|||||||
for ( size_t n = 0; n < count; n++ )
|
for ( size_t n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
wxGenericTreeItem *child = m_children[n];
|
wxGenericTreeItem *child = m_children[n];
|
||||||
if (tree)
|
tree->SendDeleteEvent(child);
|
||||||
tree->SendDeleteEvent(child);
|
|
||||||
|
|
||||||
child->DeleteChildren(tree);
|
child->DeleteChildren(tree);
|
||||||
if (child == tree->m_select_me)
|
if ( child == tree->m_select_me )
|
||||||
tree->m_select_me = NULL;
|
tree->m_select_me = NULL;
|
||||||
delete child;
|
delete child;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user