ListView fix

François Gouget fgouget at codeweavers.com
Sat Mar 3 02:19:46 CST 2001


   Eric's got a sharp eye. Here's an updated patch removing the naughty
';'.

Changelog:

   François Gouget <fgouget at codeweavers.com>
   Eric Pouech <Eric.Pouech at wanadoo.fr>

 * dlls/comctl32/listview.c

   In LISTVIEW_AddGroupSelection and LISTVIEW_SetGroupSelection, if no
selection mark has been set, just select the current item
   In LISTVIEW_SetGroupSelection we must also set the selection mark in
that case (and only in that case)
   Removed a naughty ';'


-- 
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/cvs/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.99
diff -u -r1.99 listview.c
--- dlls/comctl32/listview.c	2001/02/28 05:31:02	1.99
+++ dlls/comctl32/listview.c	2001/03/03 08:14:22
@@ -1538,11 +1538,14 @@
   INT i;
   LVITEMA item;
 
+  if (nFirst == -1)
+    nFirst = nItem;
+
   ZeroMemory(&item,sizeof(LVITEMA));
   item.stateMask = LVIS_SELECTED;
   item.state = LVIS_SELECTED;
 
-  for (i = nFirst; i <= nLast; i++);
+  for (i = nFirst; i <= nLast; i++)
   {
     LISTVIEW_SetItemState(hwnd,i,&item);
   }
@@ -1679,8 +1682,17 @@
   if ((uView == LVS_LIST) || (uView == LVS_REPORT))
   {
     INT i;
-    INT nFirst = min(infoPtr->nSelectionMark, nItem);
-    INT nLast = max(infoPtr->nSelectionMark, nItem);
+    INT nFirst, nLast;
+
+    if (infoPtr->nSelectionMark == -1)
+    {
+      infoPtr->nSelectionMark = nFirst = nLast = nItem;
+    }
+    else
+    {
+      nFirst = min(infoPtr->nSelectionMark, nItem);
+      nLast = max(infoPtr->nSelectionMark, nItem);
+    }
 
     for (i = 0; i <= GETITEMCOUNT(infoPtr); i++)
     {


More information about the wine-patches mailing list