wxCHECK_MSG( tvItem->hItem != TVI_ROOT, false,
_T("can't retrieve virtual root item") );
- return DoGetPossiblyRootItem(tvItem);
-}
-
-bool wxTreeCtrl::DoGetPossiblyRootItem(wxTreeViewItem *tvItem) const
-{
if ( !TreeView_GetItem(GetHwnd(), tvItem) )
{
wxLogLastError(wxT("TreeView_GetItem"));
wxTreeViewItem tvItem(item, TVIF_PARAM);
- if ( !DoGetPossiblyRootItem(&tvItem) )
+ // hidden root may still have data.
+ if ( IS_VIRTUAL_ROOT(item) )
+ {
+ return GET_VIRTUAL_ROOT()->GetParam();
+ }
+
+ // visible node.
+ if ( !DoGetItem(&tvItem) )
{
return NULL;
}
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
wxTreeViewItem tvItem(item, TVIF_CHILDREN);
- DoGetPossiblyRootItem(&tvItem);
+ DoGetItem(&tvItem);
return tvItem.cChildren != 0;
}