]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/checklst.cpp
Better scrolling to cursor.
[wxWidgets.git] / src / msw / checklst.cpp
index db05ff7812308cc12b1a23f7a2eb87acd766d717..756293a0eda958c23c2ef1f0a9508e717460f9d2 100644 (file)
@@ -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++ )