From 8635b0dbb3342cb7de5d4c0f5775f83cfabfd74a Mon Sep 17 00:00:00 2001 From: David Webster Date: Wed, 3 Jul 2002 21:44:40 +0000 Subject: [PATCH] Menu corruption fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/accel.cpp | 2 +- src/os2/menu.cpp | 5 ++++- src/os2/menuitem.cpp | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index 09aa343e0a..039439d25d 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -148,7 +148,7 @@ wxAcceleratorTable::wxAcceleratorTable( pArr->aaccel[i].key = uKey; pArr->aaccel[i].cmd = uCmd; } - pArr->codepage = 437; // default to english Fix??? + pArr->codepage = 437; pArr->cAccel = (USHORT)n; M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain ,pArr diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index c63cfe2fea..8ca65be64b 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -73,9 +73,11 @@ static wxString TextToLabel( const wxString& rsTitle ) { - wxString sTitle; + wxString sTitle = ""; const wxChar* zPc; + if (rsTitle.IsEmpty()) + return sTitle; for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++ ) { if (*zPc == wxT('&') ) @@ -291,6 +293,7 @@ bool wxMenu::DoInsertOrAppend( ERRORID vError; wxString sError; char zMsg[128]; + #if wxUSE_ACCEL UpdateAccel(pItem); #endif // wxUSE_ACCEL diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index 6c912fc3e6..ca9fc82f00 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -135,6 +135,8 @@ wxMenuItem::wxMenuItem( #endif // owner drawn { wxASSERT_MSG(pParentMenu != NULL, wxT("a menu item should have a parent")); + memset(&m_vMenuData, '\0', sizeof(m_vMenuData)); + m_vMenuData.id = (USHORT)nId; Init(); } // end of wxMenuItem::wxMenuItem -- 2.45.2