X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c7df356f9cdbf99bf09f276d67f0fd65c4ca8ea..cd5e9298159e58f57e05f3b76c9d4a45e1eefe12:/src/msw/treectrl.cpp?ds=sidebyside diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index ef5bc1d065..5628353b4b 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1621,11 +1621,8 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) wxT("Unknown flag in wxTreeCtrl::DoExpand") ); // A hidden root can be neither expanded nor collapsed. - if ( (HITEM(item) == TVI_ROOT) && (m_windowStyle & wxTR_HIDE_ROOT) ) - { - // No action will be taken. - return; - } + wxCHECK_RET( !(m_windowStyle & wxTR_HIDE_ROOT) || (HITEM(item) != TVI_ROOT), + wxT("Can't expand/collapse hidden root node!") ) // TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must // emulate them. This behaviour has changed slightly with comctl32.dll