comctl32: LVM_SETITEMTEXT is not supported on LVS_OWNERDATA.

This commit is contained in:
Piotr Caban 2012-05-10 11:19:37 +02:00 committed by Alexandre Julliard
parent 90085afebf
commit 8276a3375b
2 changed files with 8 additions and 1 deletions

View File

@ -8896,6 +8896,7 @@ static BOOL LISTVIEW_SetItemTextT(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
LVITEMW lvItem;
if (!lpLVItem || nItem < 0 || nItem >= infoPtr->nItemCount) return FALSE;
if (infoPtr->dwStyle & LVS_OWNERDATA) return FALSE;
lvItem.iItem = nItem;
lvItem.iSubItem = lpLVItem->iSubItem;

View File

@ -2627,6 +2627,8 @@ static void test_sorting(void)
static void test_ownerdata(void)
{
static char test_str[] = "test";
HWND hwnd;
LONG_PTR style, ret;
DWORD res;
@ -2711,7 +2713,7 @@ static void test_ownerdata(void)
expect(1, res);
DestroyWindow(hwnd);
/* LVM_SETITEM is unsupported on LVS_OWNERDATA */
/* LVM_SETITEM and LVM_SETITEMTEXT is unsupported on LVS_OWNERDATA */
hwnd = create_listview_control(LVS_OWNERDATA | LVS_REPORT);
ok(hwnd != NULL, "failed to create a listview window\n");
res = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0);
@ -2725,6 +2727,10 @@ static void test_ownerdata(void)
item.state = LVIS_SELECTED;
res = SendMessageA(hwnd, LVM_SETITEM, 0, (LPARAM)&item);
expect(FALSE, res);
memset(&item, 0, sizeof(item));
item.pszText = test_str;
res = SendMessageA(hwnd, LVM_SETITEMTEXT, 0, (LPARAM)&item);
expect(FALSE, res);
DestroyWindow(hwnd);
/* check notifications after focused/selected changed */