]> git.saurik.com Git - wxWidgets.git/commitdiff
don't ask for bounding rectangle of a hidden root, this fixes a crash introduced...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Apr 2008 20:12:57 +0000 (20:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Apr 2008 20:12:57 +0000 (20:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index 4a8d830be20bd1023461512965bfd19c0b54d0ec..3093583d52ad26a2a4852699c2211ab5fc47f431 100644 (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 )