]> git.saurik.com Git - wxWidgets.git/commitdiff
fix handling of the commands with negative ids (e.g. created by NewControlId()) in...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 May 2008 23:53:11 +0000 (23:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 May 2008 23:53:11 +0000 (23:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/mdi.cpp

index 4dd4bcc41c26154e2aea8c82163e80a1314dd628..5225e86be57ba44b5faa8b93d86cfcbc97ede51a 100644 (file)
@@ -518,8 +518,11 @@ bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate
     return processed;
 }
 
-bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
+bool wxMDIParentFrame::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND hwnd)
 {
+    // sign extend to int from short before comparing with the other int ids
+    int id = (signed short)id_;
+
     // In case it's e.g. a toolbar.
     if ( hwnd )
     {
@@ -1009,8 +1012,11 @@ WXLRESULT wxMDIChildFrame::MSWWindowProc(WXUINT message,
     return rc;
 }
 
-bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
+bool wxMDIChildFrame::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND hwnd)
 {
+    // sign extend to int from short before comparing with the other int ids
+    int id = (signed short)id_;
+
     // In case it's e.g. a toolbar.
     if ( hwnd )
     {