From 47788d7b6ca4ae77400100a70ab706467bbf67bd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Apr 2008 20:12:57 +0000 Subject: [PATCH] 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/branches/WX_2_8_BRANCH@53084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index dac12fc4f2..ef13a3f1e8 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1549,7 +1549,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 )