don't ask for bounding rectangle of a hidden root, this fixes a crash introduced by the previous patch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-04-07 20:12:57 +00:00
parent 26c093da54
commit 4a36036eb2

View File

@@ -1531,7 +1531,10 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent,
tvIns.item.lParam = (LPARAM)param;
tvIns.item.mask = mask;
const bool firstChild = !TreeView_GetChild(GetHwnd(), HITEM(parent));
// don't use the hack below for the children of hidden root: this results
// in a crash inside comctl32.dll when we call TreeView_GetItemRect()
const bool firstChild = !IsHiddenRoot(parent) &&
!TreeView_GetChild(GetHwnd(), HITEM(parent));
HTREEITEM id = TreeView_InsertItem(GetHwnd(), &tvIns);
if ( id == 0 )