Prevent crash in case nothing is selected
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -408,15 +408,19 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event)
|
||||
if ( oper != None )
|
||||
{
|
||||
wxArrayInt selections;
|
||||
int count;
|
||||
int count = 0;
|
||||
if ( HasMultipleSelection() )
|
||||
{
|
||||
count = GetSelections(selections);
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 1;
|
||||
selections.Add(GetSelection());
|
||||
int sel = GetSelection();
|
||||
if (sel != -1)
|
||||
{
|
||||
count = 1;
|
||||
selections.Add(sel);
|
||||
}
|
||||
}
|
||||
|
||||
for ( int i = 0; i < count; i++ )
|
||||
|
Reference in New Issue
Block a user