]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
don't refresh the current cell in SetCellHighlightROPenWidth() if it's invalid (...
[wxWidgets.git] / 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 )