From 1ab459b212419fe36cd134c5c1e6d090bc8955b5 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Fri, 20 Jun 2014 01:35:16 +0000 Subject: [PATCH] Fix finding menu items in wxMenuItem::DoSetBitmap. FindChildItem gets passed the id of a menu item as returned by GetMSWId, however GetMSWId should be used in combination with Win32 API functions. Instead use GetId: this fixes finding menu items that have a negative id (as a result of using wxID_ANY as id) or have a sub menu. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menuitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 809668b35b..bbaddbcf68 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -761,7 +761,7 @@ void wxMenuItem::DoSetBitmap(const wxBitmap& bmp, bool bChecked) if ( m_parentMenu ) { size_t pos; - wxMenuItem *item = m_parentMenu->FindChildItem(GetMSWId(), &pos); + wxMenuItem *item = m_parentMenu->FindChildItem(GetId(), &pos); if ( item ) { wxCHECK_RET( item == this, wxS("Non unique menu item ID?") );