]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
Reverted/commented out unsuccessful defer fix
[wxWidgets.git] / src / common / menucmn.cpp
index befcfd613d80586cc5eb79230e0d06b593603025..a9d30e2bef68931d4e7dddb61f0449adc5ce3cd8 100644 (file)
@@ -160,10 +160,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
                 if ( current[0U] == 'f' && wxIsdigit(current[1U]) &&
                      (current.Len() == 2 ||
                      (current.Len() == 3 && wxIsdigit(current[2U]))) ) {
                 if ( current[0U] == 'f' && wxIsdigit(current[1U]) &&
                      (current.Len() == 2 ||
                      (current.Len() == 3 && wxIsdigit(current[2U]))) ) {
-                    int n;
-                    wxSscanf(current.c_str() + 1, wxT("%d"), &n);
-
-                    keyCode = WXK_F1 + n - 1;
+                    keyCode = WXK_F1 + wxAtoi(current.c_str() + 1) - 1;
                 }
                 else {
                     // several special cases
                 }
                 else {
                     // several special cases
@@ -206,6 +203,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
                     {
                         wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
                                    current.c_str());
                     {
                         wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
                                    current.c_str());
+                        return NULL;
                     }
                 }
             }
                     }
                 }
             }
@@ -262,7 +260,7 @@ void wxMenuItemBase::SetAccel(wxAcceleratorEntry *accel)
             // we should process them here
 
             default:
             // we should process them here
 
             default:
-                if ( wxIsalnum((wxChar)code) )
+                if ( wxIsalnum(code) )
                 {
                     text << (wxChar)code;
 
                 {
                     text << (wxChar)code;
 
@@ -705,7 +703,7 @@ wxString wxMenuBase::GetLabel( int id ) const
 {
     wxMenuItem *item = FindItem(id);
 
 {
     wxMenuItem *item = FindItem(id);
 
-    wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetLabel: no such item") );
+    wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") );
 
     return item->GetText();
 }
 
     return item->GetText();
 }
@@ -723,7 +721,7 @@ wxString wxMenuBase::GetHelpString( int id ) const
 {
     wxMenuItem *item = FindItem(id);
 
 {
     wxMenuItem *item = FindItem(id);
 
-    wxCHECK_MSG( item, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
+    wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetHelpString: no such item") );
 
     return item->GetHelp();
 }
 
     return item->GetHelp();
 }