X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/633ecf268b2ebb1c453cf63e05e49e968092812a..cdef03346586b83cb87ed1e9d239f236ce8baaf7:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 2e2650bfed..fd499ea6fe 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -199,9 +199,9 @@ public: wxGenericTreeItem *GetParent() const { return m_parent; } // operations - // deletes all children notifying the treectrl about it if !NULL - // pointer given - void DeleteChildren(wxGenericTreeCtrl *tree = NULL); + + // deletes all children notifying the treectrl about it + void DeleteChildren(wxGenericTreeCtrl *tree); // get count of all children (and grand children if 'recursively') size_t GetChildrenCount(bool recursively = true) const; @@ -548,11 +548,10 @@ void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree) for ( size_t n = 0; n < count; n++ ) { wxGenericTreeItem *child = m_children[n]; - if (tree) - tree->SendDeleteEvent(child); + tree->SendDeleteEvent(child); child->DeleteChildren(tree); - if (child == tree->m_select_me) + if ( child == tree->m_select_me ) tree->m_select_me = NULL; delete child; } @@ -3144,6 +3143,8 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) } else if ( (event.LeftUp() || event.RightUp()) && m_isDragging ) { + ReleaseMouse(); + // erase the highlighting DrawDropEffect(m_dropTarget); @@ -3166,8 +3167,6 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) m_isDragging = false; m_dropTarget = (wxGenericTreeItem *)NULL; - ReleaseMouse(); - SetCursor(m_oldCursor); #if defined( __WXMSW__ ) || defined(__WXMAC__) @@ -3518,7 +3517,7 @@ void wxGenericTreeCtrl::Thaw() { wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen tree control?") ); - if ( !--m_freezeCount ) + if ( --m_freezeCount == 0 ) { Refresh(); }