X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77e00fe9da297d8adda003cf20981b1bc1c2d65f..083f7497d34a1df453b92ab411aace3fc4ace927:/src/msw/checklst.cpp diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index db05ff7812..2a7e01108e 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -6,7 +6,7 @@ // Created: 16.11.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -418,15 +418,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++ )