Remove unnecessary assert from wxMenuBar::MSWGetMenu().

This assert was triggered after the changes of the previous commit as we can
get WM_MENUSELECT with menu bar handle as parameter from Windows and still
search for the menu with this handle -- and there is nothing wrong with this,
so just return NULL but without asserting in this case.

This corrects the changes of r67355, see #13080.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:18:01 +00:00
parent 2d20e3fc51
commit 0c61827188

View File

@@ -1634,8 +1634,10 @@ void wxMenuBar::Detach()
// get the menu with given handle (recursively)
wxMenu* wxMenuBar::MSWGetMenu(WXHMENU hMenu)
{
wxCHECK_MSG( GetHMenu() != hMenu, NULL,
wxT("wxMenuBar::MSWGetMenu(): menu handle is wxMenuBar, not wxMenu") );
// If we're called with the handle of the menu bar itself, we can return
// immediately as it certainly can't be the handle of one of our menus.
if ( hMenu == GetHMenu() )
return NULL;
#if wxUSE_OWNER_DRAWN
// query all menus