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:
Robin Dunn
2003-03-12 19:48:45 +00:00
parent 6fc391d57d
commit bee5ccc4aa

View File

@@ -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++ )