]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/checklst.cpp
Applied some of patch [ 688466 ] MSVC7 build & bug fixes
[wxWidgets.git] / src / msw / checklst.cpp
index db05ff7812308cc12b1a23f7a2eb87acd766d717..2a7e01108ecfb17e593f35a32ef3cfbca1b7ca6f 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     16.11.97
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// 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++ )