Nikolay Sivov : comctl32/listview: Simplify key selection handler a bit.

Alexandre Julliard julliard at winehq.org
Mon May 25 10:06:33 CDT 2009


Module: wine
Branch: master
Commit: 28bffafdf64a1316a6c3397b4397cba2234b5aed
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=28bffafdf64a1316a6c3397b4397cba2234b5aed

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Mon May 25 00:26:30 2009 +0400

comctl32/listview: Simplify key selection handler a bit.

---

 dlls/comctl32/listview.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0011b6f..d1dc2ee 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3269,18 +3269,14 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space)
   TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
   if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
   {
-    if (infoPtr->dwStyle & LVS_SINGLESEL)
-    {
-      bResult = TRUE;
+    bResult = TRUE;
+
+    if (infoPtr->dwStyle & LVS_SINGLESEL || (wShift == 0 && wCtrl == 0))
       LISTVIEW_SetSelection(infoPtr, nItem);
-    }
     else
     {
       if (wShift)
-      {
-        bResult = TRUE;
         LISTVIEW_SetGroupSelection(infoPtr, nItem);
-      }
       else if (wCtrl)
       {
         LVITEMW lvItem;
@@ -3294,11 +3290,6 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space)
         }
         bResult = LISTVIEW_SetItemFocus(infoPtr, nItem);
       }
-      else
-      {
-        bResult = TRUE;
-        LISTVIEW_SetSelection(infoPtr, nItem);
-      }
     }
     LISTVIEW_EnsureVisible(infoPtr, nItem, FALSE);
   }




More information about the wine-cvs mailing list