Listview T7

Dimitrie O. Paun dpaun at rogers.com
Fri Oct 18 18:33:17 CDT 2002


This should fix the FTP Commander 'Access Violation'.
Carlos, can you please confirm?

ChangeLog
  When deleting an item, remove selection, don't add it!

--- dlls/comctl32/listview.c.T6	Fri Oct 18 19:11:13 2002
+++ dlls/comctl32/listview.c	Fri Oct 18 19:26:03 2002
@@ -4032,23 +4032,16 @@
 
   TRACE("(nItem=%d)\n", nItem);
 
+  /* remove selection, and focus */
+  item.state = 0;
+  item.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
+  LISTVIEW_SetItemState(infoPtr, nItem, &item);
 
-  /* First, send LVN_DELETEITEM notification. */
+  /* send LVN_DELETEITEM notification. */
   ZeroMemory(&nmlv, sizeof (NMLISTVIEW));
   nmlv.iItem = nItem;
   notify_listview(infoPtr, LVN_DELETEITEM, &nmlv);
 
-  if (nItem == infoPtr->nFocusedItem)
-  {
-    infoPtr->nFocusedItem = -1;
-    SetRectEmpty(&infoPtr->rcFocus);
-  }
-
-  /* remove it from the selection range */
-  item.state = LVIS_SELECTED;
-  item.stateMask = LVIS_SELECTED;
-  LISTVIEW_SetItemState(infoPtr,nItem,&item);
-
   if (lStyle & LVS_OWNERDATA)
   {
     infoPtr->nItemCount--;




More information about the wine-patches mailing list