mirror of
https://github.com/reactos/wine.git
synced 2024-12-01 15:40:43 +00:00
Deleting column zero should only delete the column and not the item
data.
This commit is contained in:
parent
759ef45945
commit
69f2e04ff8
@ -4229,13 +4229,9 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
|
||||
|| nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
|
||||
|
||||
/* While the MSDN specifically says that column zero should not be deleted,
|
||||
it does in fact work on WinNT, and at least one app depends on it. On
|
||||
WinNT, deleting column zero deletes the last column of items but the
|
||||
first header. Since no app will ever depend on that bizarre behavior,
|
||||
we just delete the last column including the header.
|
||||
what actually happens is that the column itself is deleted but no items or subitems
|
||||
are removed.
|
||||
*/
|
||||
if (nColumn == 0)
|
||||
nColumn = DPA_GetPtrCount(infoPtr->hdpaColumns) - 1;
|
||||
|
||||
LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol);
|
||||
|
||||
@ -4245,15 +4241,12 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
|
||||
Free(DPA_GetPtr(infoPtr->hdpaColumns, nColumn));
|
||||
DPA_DeletePtr(infoPtr->hdpaColumns, nColumn);
|
||||
|
||||
if (!(infoPtr->dwStyle & LVS_OWNERDATA))
|
||||
if (!(infoPtr->dwStyle & LVS_OWNERDATA) && nColumn)
|
||||
{
|
||||
SUBITEM_INFO *lpSubItem, *lpDelItem;
|
||||
HDPA hdpaSubItems;
|
||||
INT nItem, nSubItem, i;
|
||||
|
||||
if (nColumn == 0)
|
||||
return LISTVIEW_DeleteAllItems(infoPtr);
|
||||
|
||||
for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
|
||||
{
|
||||
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem);
|
||||
@ -4290,7 +4283,10 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
|
||||
}
|
||||
|
||||
/* update the other column info */
|
||||
LISTVIEW_ScrollColumns(infoPtr, nColumn, -(rcCol.right - rcCol.left));
|
||||
if(DPA_GetPtrCount(infoPtr->hdpaColumns) == 0)
|
||||
LISTVIEW_InvalidateList(infoPtr);
|
||||
else
|
||||
LISTVIEW_ScrollColumns(infoPtr, nColumn, -(rcCol.right - rcCol.left));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user