Nikolay Sivov : comctl32/listview: Set LVIS_FOCUSED for all items with LVM_SETITEMSTATE not allowed.

Alexandre Julliard julliard at winehq.org
Fri Jul 24 08:49:24 CDT 2009


Module: wine
Branch: master
Commit: 092263f051dca826c8b93fed26ee3dfe2b72a54b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=092263f051dca826c8b93fed26ee3dfe2b72a54b

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Thu Jul 23 23:48:23 2009 +0400

comctl32/listview: Set LVIS_FOCUSED for all items with LVM_SETITEMSTATE not allowed.

---

 dlls/comctl32/listview.c       |    3 +++
 dlls/comctl32/tests/listview.c |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 05c033e..4d27ba7 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8108,6 +8108,9 @@ static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
 	if ((lvItem.state & lvItem.stateMask & LVIS_SELECTED) && (infoPtr->dwStyle & LVS_SINGLESEL))
 	    return FALSE;
 
+	/* focus all isn't allowed */
+	if (lvItem.state & lvItem.stateMask & LVIS_FOCUSED) return FALSE;
+
     	/* apply to all items */
     	for (lvItem.iItem = 0; lvItem.iItem < infoPtr->nItemCount; lvItem.iItem++)
 	    if (!LISTVIEW_SetItemT(infoPtr, &lvItem, TRUE)) bResult = FALSE;
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index bf87bca..1a7e5d8 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2547,10 +2547,10 @@ static void test_ownerdata(void)
     item.state     = LVIS_FOCUSED;
     g_dump_itemchanged = TRUE;
     res = SendMessageA(hwnd, LVM_SETITEMSTATE, -1, (LPARAM)&item);
-    todo_wine expect(FALSE, res);
+    expect(FALSE, res);
     g_dump_itemchanged = FALSE;
     ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
-                "ownerdata focus all notification", TRUE);
+                "ownerdata focus all notification", FALSE);
     /* focus single item, remove all */
     item.stateMask = LVIS_FOCUSED;
     item.state     = LVIS_FOCUSED;




More information about the wine-cvs mailing list