From 559692a5e550289dbcf0b8f03165a7414c5321c3 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 3 Aug 2000 00:24:09 +0000 Subject: [PATCH] - Fixed bug where InitSubItem was doing a ZeroMemory on the item. - Cleaned up a sit of extra blue at the end of a FULLROWSELECT list view if there is only one column. - Corrected a bug I introduced with an earlier patch which caused problems with multiple selections. --- dlls/comctl32/listview.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 6ef2fefd2c..a78ddc9337 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1729,7 +1729,6 @@ static BOOL LISTVIEW_InitSubItem(HWND hwnd, LISTVIEW_SUBITEM *lpSubItem, if (!(lpLVItem->mask & LVIF_INDENT)) { bResult = TRUE; - ZeroMemory(lpSubItem, sizeof(LISTVIEW_SUBITEM)); lpSubItem->iSubItem = lpLVItem->iSubItem; @@ -1799,6 +1798,7 @@ static BOOL LISTVIEW_AddSubItem(HWND hwnd, LPLVITEMA lpLVItem) lpSubItem = (LISTVIEW_SUBITEM *)COMCTL32_Alloc(sizeof(LISTVIEW_SUBITEM)); if (lpSubItem != NULL) { + ZeroMemory(lpSubItem, sizeof(LISTVIEW_SUBITEM)); if (LISTVIEW_InitSubItem(hwnd, lpSubItem, lpLVItem) != FALSE) { nPosition = LISTVIEW_FindInsertPosition(hdpaSubItems, @@ -1964,9 +1964,12 @@ static BOOL LISTVIEW_SetItem(HWND hwnd, LPLVITEMA lpLVItem) * however is required if the used directly calls SetItem * to set the selection. */ - LISTVIEW_RemoveSelections(hwnd, 0, lpLVItem->iItem-1); - LISTVIEW_RemoveSelections(hwnd, lpLVItem->iItem + 1, - GETITEMCOUNT(infoPtr)); + if (lStyle & LVS_SINGLESEL) + { + LISTVIEW_RemoveSelections(hwnd, 0, lpLVItem->iItem-1); + LISTVIEW_RemoveSelections(hwnd, lpLVItem->iItem + 1, + GETITEMCOUNT(infoPtr)); + } } else if (nmlv.uNewState & LVIS_FOCUSED) { @@ -2296,7 +2299,7 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F ExtTextOutA(hdc, rcItem.left + 1, rcItem.top, ETO_OPAQUE | ETO_CLIPPED, &rcItem, lvItem.pszText, lstrlenA(lvItem.pszText), NULL); - if (FullSelect) + if ((FullSelect)&&(Header_GetItemCount(infoPtr->hwndHeader) > 1)) { /* fill in the gap */ RECT rec; -- 2.32.0.93.g670b81a890