X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56873923f39af96aac6bfc5776d2637b8c4623ca..5b90e570c9cd075069292da898cf23b8e9408f75:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 9cf8532ae6..7aa4079cf6 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -797,11 +797,6 @@ bool wxTreeCtrl::DoGetItem(wxTreeViewItem *tvItem) const 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")); @@ -997,7 +992,14 @@ wxTreeItemParam *wxTreeCtrl::GetItemParam(const wxTreeItemId& item) const 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; } @@ -1212,7 +1214,7 @@ bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); wxTreeViewItem tvItem(item, TVIF_CHILDREN); - DoGetPossiblyRootItem(&tvItem); + DoGetItem(&tvItem); return tvItem.cChildren != 0; }