X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32b1391332e67af96856865ded257aacd6e1e956..283587a491a718c8f568f70a143c9b1b2992306b:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index befcfd613d..a9d30e2bef 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -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]))) ) { - 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 @@ -206,6 +203,7 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) { 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: - if ( wxIsalnum((wxChar)code) ) + if ( wxIsalnum(code) ) { text << (wxChar)code; @@ -705,7 +703,7 @@ wxString wxMenuBase::GetLabel( int id ) const { 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(); } @@ -723,7 +721,7 @@ wxString wxMenuBase::GetHelpString( int id ) const { 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(); }