undid change accidentally committed as part of r57093 but which didn't have anything to do with it and resulted in #10253
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -242,10 +242,8 @@ private:
|
||||
// the common part of all ctors
|
||||
void Init();
|
||||
|
||||
// helper functions: DoGetItem() doesn't work for hidden virtual root item
|
||||
// while DoGetPossiblyRootItem() does
|
||||
// helper functions
|
||||
bool DoGetItem(wxTreeViewItem *tvItem) const;
|
||||
bool DoGetPossiblyRootItem(wxTreeViewItem *tvItem) const;
|
||||
void DoSetItem(wxTreeViewItem *tvItem);
|
||||
|
||||
void DoExpand(const wxTreeItemId& item, int flag);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user