Commit 4633fc5c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 04e5e9cf
...@@ -1359,10 +1359,8 @@ static void test_delete_items(void) ...@@ -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);
......
...@@ -1479,12 +1479,12 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) ...@@ -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--;
......
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