comctl32/treeview: Store item state supplied from TVN_GETDISPINFO handler.

This commit is contained in:
Nikolay Sivov 2011-05-14 15:18:49 +04:00 committed by Alexandre Julliard
parent 1fa1c72d90
commit f9b14fda02
2 changed files with 8 additions and 1 deletions

View File

@ -468,10 +468,11 @@ static void test_callback(void)
tvi.hItem = hRoot;
tvi.mask = TVIF_IMAGE;
tvi.state = INDEXTOSTATEIMAGEMASK(1);
tvi.stateMask = 0;
ret = TreeView_GetItem(hTree, &tvi);
expect(TRUE, ret);
/* handler sets TVIS_SELECTED as well */
todo_wine ok(tvi.state == (TVIS_FOCUSED | TVIS_SELECTED | INDEXTOSTATEIMAGEMASK(2) | INDEXTOOVERLAYMASK(3)), "got 0x%x\n", tvi.state);
ok(tvi.state == (TVIS_FOCUSED | TVIS_SELECTED | INDEXTOSTATEIMAGEMASK(2) | INDEXTOOVERLAYMASK(3)), "got 0x%x\n", tvi.state);
g_disp_set_stateimage = FALSE;
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_get_dispinfo_seq,

View File

@ -815,6 +815,12 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
if (mask & TVIF_CHILDREN)
wineItem->cChildren = callback.item.cChildren;
if (callback.item.mask & TVIF_STATE)
{
wineItem->state &= ~callback.item.stateMask;
wineItem->state |= (callback.item.state & callback.item.stateMask);
}
/* These members are now permanently set. */
if (callback.item.mask & TVIF_DI_SETITEM)
wineItem->callbackMask &= ~callback.item.mask;