comctl32/treeview: Fix TVN_DELETEITEM to use item that is about to be deleted.

This commit is contained in:
Nikolay Sivov 2010-10-23 22:15:04 +04:00 committed by Alexandre Julliard
parent 04e5e9cfa0
commit 4633fc5c03
2 changed files with 5 additions and 7 deletions

View File

@ -1359,10 +1359,8 @@ static void test_delete_items(void)
if (item_sequence[0]->count == 2) if (item_sequence[0]->count == 2)
{ {
todo_wine { ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%lx\n", hChild, msg[0].lParam);
ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got %lx\n", hChild, msg[0].lParam); ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%lx\n", hRoot, msg[1].lParam);
ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got %lx\n", hRoot, msg[1].lParam);
}
} }
ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0); ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0);

View File

@ -1479,12 +1479,12 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
{ {
TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem)); TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem));
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN,
TVIF_HANDLE | TVIF_PARAM, wineItem, 0);
if (wineItem->firstChild) if (wineItem->firstChild)
TREEVIEW_RemoveAllChildren(infoPtr, wineItem); TREEVIEW_RemoveAllChildren(infoPtr, wineItem);
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN,
TVIF_HANDLE | TVIF_PARAM, wineItem, 0);
TREEVIEW_UnlinkItem(wineItem); TREEVIEW_UnlinkItem(wineItem);
infoPtr->uNumItems--; infoPtr->uNumItems--;