From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/comctl32/listview.c | 3 ++- dlls/comctl32/tests/listview.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 57ad887364f..d82a2bba15e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -6711,7 +6711,8 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, /* if the app stores all the data, handle it separately */ if (infoPtr->dwStyle & LVS_OWNERDATA) { - dispInfo.item.state = 0; + if (lpLVItem->mask & LVIF_STATE) lpLVItem->state = 0; + dispInfo.item.state = lpLVItem->state;
/* apparently, we should not callback for lParam in LVS_OWNERDATA */ if ((lpLVItem->mask & ~(LVIF_STATE | LVIF_PARAM)) || diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 2abe27f354e..85cecd11159 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -3528,7 +3528,7 @@ static void test_ownerdata(void) item.state = 0xffff; res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); ok(res, "Failed to get item.\n"); - todo_wine ok(item.state == 0xffff, "Unexpected item state %#x.\n", item.state); + ok(item.state == 0xffff, "Unexpected item state %#x.\n", item.state);
/* LVIF_STATE is set with no statemask, state field zeroed. */ memset(&item, 0, sizeof(item)); @@ -3537,10 +3537,10 @@ static void test_ownerdata(void) item.state = 0xffff; res = SendMessageA(hwnd, LVM_GETITEMA, 0, (LPARAM)&item); ok(res, "Failed to get item.\n"); - todo_wine ok(!item.state, "Unexpected item state %#x.\n", item.state); + ok(!item.state, "Unexpected item state %#x.\n", item.state);
res = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, 0xff); - todo_wine ok(res == LVIS_SELECTED, "Unexpected item state %#lx.\n", res); + ok(res == LVIS_SELECTED, "Unexpected item state %#lx.\n", res);
/* Set the callback mask for LVIS_SELECTED. */ res = SendMessageA(hwnd, LVM_SETCALLBACKMASK, LVIS_SELECTED, 0);