Listview fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog
    Inserting column zero should not modify the main item
    (Spotted by Robert Shearman).

Index: dlls/comctl32/listview.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v
retrieving revision 1.351
diff -u -r1.351 listview.c
--- dlls/comctl32/listview.c	13 May 2003 00:30:10 -0000	1.351
+++ dlls/comctl32/listview.c	19 May 2003 07:28:54 -0000
@@ -6242,25 +6242,10 @@
     /* now we have to actually adjust the data */
     if (!(infoPtr->dwStyle & LVS_OWNERDATA) && infoPtr->nItemCount > 0)
     {
-	SUBITEM_INFO *lpSubItem, *lpMainItem, **lpNewItems = 0;
+	SUBITEM_INFO *lpSubItem;
 	HDPA hdpaSubItems;
 	INT nItem, i;
 	
-	/* preallocate memory, so we can fail gracefully */
-	if (nNewColumn == 0)
-	{
-	    lpNewItems = COMCTL32_Alloc(sizeof(SUBITEM_INFO *) * infoPtr->nItemCount);
-	    if (!lpNewItems) goto fail;
-	    for (i = 0; i < infoPtr->nItemCount; i++)
-		if (!(lpNewItems[i] = COMCTL32_Alloc(sizeof(SUBITEM_INFO)))) break;
-	    if (i != infoPtr->nItemCount)
-	    {
-		for(; i >=0; i--) COMCTL32_Free(lpNewItems[i]);
-		COMCTL32_Free(lpNewItems);
-		goto fail;
-	    }
-	}
-	
 	for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
 	{
 	    hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem);
@@ -6270,21 +6255,7 @@
 		if (lpSubItem->iSubItem >= nNewColumn)
 		    lpSubItem->iSubItem++;
 	    }
-
-	    /* for inserting column 0, we have to special-case the main item */	
-	    if (nNewColumn == 0)
-	    {
-		lpMainItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0);
-		lpSubItem = lpNewItems[nItem];
-		lpSubItem->hdr = lpMainItem->hdr;
-		lpSubItem->iSubItem = 1;
-		ZeroMemory(&lpMainItem->hdr, sizeof(lpMainItem->hdr));
-		lpMainItem->iSubItem = 0;
-		DPA_InsertPtr(hdpaSubItems, 1, lpSubItem);
-    	    }
 	}
-
-	COMCTL32_Free(lpNewItems);
     }
 
     /* make space for the new column */


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux