Commit b14c82a8 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

We should callback for inexistent subitems.

Do not store callback items for subitems, even if we're asked to. Small cleanup.
parent 16db2569
...@@ -3073,7 +3073,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isNew ...@@ -3073,7 +3073,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isNew
item.stateMask = ~0; item.stateMask = ~0;
item.state = 0; item.state = 0;
item.lParam = 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); TRACE("oldState=%x, newState=%x\n", item.state, lpLVItem->state);
/* determine what fields will change */ /* determine what fields will change */
...@@ -4723,6 +4723,7 @@ static HIMAGELIST LISTVIEW_GetImageList(LISTVIEW_INFO *infoPtr, INT nImageList) ...@@ -4723,6 +4723,7 @@ static HIMAGELIST LISTVIEW_GetImageList(LISTVIEW_INFO *infoPtr, INT nImageList)
*/ */
static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW) static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
{ {
ITEMHDR callbackHdr = { LPSTR_TEXTCALLBACKW, I_IMAGECALLBACK };
NMLVDISPINFOW dispInfo; NMLVDISPINFOW dispInfo;
ITEM_INFO *lpItem; ITEM_INFO *lpItem;
ITEMHDR* pItemHdr; ITEMHDR* pItemHdr;
...@@ -4808,8 +4809,7 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i ...@@ -4808,8 +4809,7 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
if (lpLVItem->iSubItem) if (lpLVItem->iSubItem)
{ {
SUBITEM_INFO *lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem); SUBITEM_INFO *lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem);
if(!lpSubItem) return FALSE; pItemHdr = lpSubItem ? &lpSubItem->hdr : &callbackHdr;
pItemHdr = &lpSubItem->hdr;
} }
else else
pItemHdr = &lpItem->hdr; pItemHdr = &lpItem->hdr;
...@@ -4845,6 +4845,9 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i ...@@ -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)); 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 */ /* Now, handle the iImage field */
if (dispInfo.item.mask & LVIF_IMAGE) if (dispInfo.item.mask & LVIF_IMAGE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment