fix for items without accelerators
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -810,6 +810,10 @@ static wxString GetHotKey( const wxMenuItem& item )
|
||||
// as wxGetAccelFromString() looks for TAB, insert a dummy one here
|
||||
wxString label;
|
||||
label << wxT('\t') << item.GetHotKey();
|
||||
|
||||
// but if the hotkey is empty don't do anything
|
||||
if ( label.length() > 1 )
|
||||
{
|
||||
wxAcceleratorEntry *accel = wxGetAccelFromString(label);
|
||||
if ( accel )
|
||||
{
|
||||
@@ -852,9 +856,10 @@ static wxString GetHotKey( const wxMenuItem& item )
|
||||
|
||||
wxFAIL_MSG( wxT("unknown keyboard accel") );
|
||||
}
|
||||
}
|
||||
if (accel)
|
||||
|
||||
delete accel;
|
||||
}
|
||||
}
|
||||
|
||||
return hotkey;
|
||||
}
|
||||
|
@@ -810,6 +810,10 @@ static wxString GetHotKey( const wxMenuItem& item )
|
||||
// as wxGetAccelFromString() looks for TAB, insert a dummy one here
|
||||
wxString label;
|
||||
label << wxT('\t') << item.GetHotKey();
|
||||
|
||||
// but if the hotkey is empty don't do anything
|
||||
if ( label.length() > 1 )
|
||||
{
|
||||
wxAcceleratorEntry *accel = wxGetAccelFromString(label);
|
||||
if ( accel )
|
||||
{
|
||||
@@ -852,9 +856,10 @@ static wxString GetHotKey( const wxMenuItem& item )
|
||||
|
||||
wxFAIL_MSG( wxT("unknown keyboard accel") );
|
||||
}
|
||||
}
|
||||
if (accel)
|
||||
|
||||
delete accel;
|
||||
}
|
||||
}
|
||||
|
||||
return hotkey;
|
||||
}
|
||||
|
Reference in New Issue
Block a user