We should callback for inexistent subitems.

Do not store callback items for subitems, even if we're asked to.
Small cleanup.
oldstable
Dimitrie O. Paun 2002-10-25 03:17:04 +00:00 committed by Alexandre Julliard
parent 16db256923
commit b14c82a8b8
1 changed files with 6 additions and 3 deletions

View File

@ -3073,7 +3073,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isNew
item.stateMask = ~0;
item.state = 0;
item.lParam = 0;
if (!isNew && !LISTVIEW_GetItemT(infoPtr, &item, TRUE)) return FALSE;
if (!isNew && !LISTVIEW_GetItemW(infoPtr, &item)) return FALSE;
TRACE("oldState=%x, newState=%x\n", item.state, lpLVItem->state);
/* determine what fields will change */
@ -4723,6 +4723,7 @@ static HIMAGELIST LISTVIEW_GetImageList(LISTVIEW_INFO *infoPtr, INT nImageList)
*/
static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
{
ITEMHDR callbackHdr = { LPSTR_TEXTCALLBACKW, I_IMAGECALLBACK };
NMLVDISPINFOW dispInfo;
ITEM_INFO *lpItem;
ITEMHDR* pItemHdr;
@ -4808,8 +4809,7 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
if (lpLVItem->iSubItem)
{
SUBITEM_INFO *lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem);
if(!lpSubItem) return FALSE;
pItemHdr = &lpSubItem->hdr;
pItemHdr = lpSubItem ? &lpSubItem->hdr : &callbackHdr;
}
else
pItemHdr = &lpItem->hdr;
@ -4845,6 +4845,9 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
TRACE(" getdispinfo(2):item=%s\n", debuglvitem_t(&dispInfo.item, isW));
}
/* we should not store values for subitems */
if (lpLVItem->iSubItem) dispInfo.item.mask &= ~LVIF_DI_SETITEM;
/* Now, handle the iImage field */
if (dispInfo.item.mask & LVIF_IMAGE)
{