Piotr Caban : comctl32: LVM_SETITEMTEXT is not supported on LVS_OWNERDATA.
Alexandre Julliard
julliard at winehq.org
Thu May 10 14:17:58 CDT 2012
Module: wine
Branch: master
Commit: 8276a3375b653cec5df2f823bf5b5ae08550152f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8276a3375b653cec5df2f823bf5b5ae08550152f
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu May 10 11:19:37 2012 +0200
comctl32: LVM_SETITEMTEXT is not supported on LVS_OWNERDATA.
---
dlls/comctl32/listview.c | 1 +
dlls/comctl32/tests/listview.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index ccabe6b..e507848 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -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;
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index c38bb61..b96e85f 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -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 */
More information about the wine-cvs
mailing list