From d8c159fbfdd96c987da9b325c3b47407d0f1f184 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Oct 2002 20:17:53 +0000 Subject: [PATCH] don't crash if IsVisible() is called for the hidden virtual root git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index d91e98645f..efad5e8001 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1240,6 +1240,12 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font) bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const { + if ( item == wxTreeItemId(TVI_ROOT) ) + { + // virtual (hidden) root is never visible + return FALSE; + } + // Bug in Gnu-Win32 headers, so don't use the macro TreeView_GetItemRect RECT rect;