]> git.saurik.com Git - wxWidgets.git/commitdiff
Menu corruption fix
authorDavid Webster <Dave.Webster@bhmi.com>
Wed, 3 Jul 2002 21:44:40 +0000 (21:44 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Wed, 3 Jul 2002 21:44:40 +0000 (21:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/accel.cpp
src/os2/menu.cpp
src/os2/menuitem.cpp

index 09aa343e0a222e3c158736122bf2e3ab6a0401fe..039439d25d2112788476d654e7cd2fb489be7bc3 100644 (file)
@@ -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
index c63cfe2feaa4f019ed8626063387de657d42548c..8ca65be64b336bc72378cd49160b300d4c0d9b78 100644 (file)
@@ -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
index 6c912fc3e6e39f049634b635cda23dab3d21da3d..ca9fc82f000815b8d7eb4fd3718b2caf30f6df38 100644 (file)
@@ -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