Nikolay Sivov : comctl32/listview: Don' t alter selection mark in LVM_SETITEMSTATE.

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


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

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

comctl32/listview: Don't alter selection mark in LVM_SETITEMSTATE.

---

 dlls/comctl32/listview.c       |   33 ---------------------------------
 dlls/comctl32/tests/listview.c |    2 --
 2 files changed, 0 insertions(+), 35 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 4d27ba7..0713308 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8118,39 +8118,6 @@ static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE
     else
 	bResult = LISTVIEW_SetItemT(infoPtr, &lvItem, TRUE);
 
-    /*
-     * Update selection mark
-     *
-     * Investigation on windows 2k showed that selection mark was updated
-     * whenever a new selection was made, but if the selected item was
-     * unselected it was not updated.
-     *
-     * we are probably still not 100% accurate, but this at least sets the
-     * proper selection mark when it is needed
-     */
-
-    if (bResult && (lvItem.state & lvItem.stateMask & LVIS_SELECTED) &&
-        (infoPtr->nSelectionMark == -1))
-    {
-        int i;
-        for (i = 0; i < infoPtr->nItemCount; i++)
-        {
-            if (infoPtr->uCallbackMask & LVIS_SELECTED)
-            {
-                if (LISTVIEW_GetItemState(infoPtr, i, LVIS_SELECTED))
-                {
-                    infoPtr->nSelectionMark = i;
-                    break;
-                }
-            }
-            else if (ranges_contain(infoPtr->selectionRanges, i))
-            {
-                infoPtr->nSelectionMark = i;
-                break;
-            }
-        }
-    }
-
     return bResult;
 }
 
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 1a7e5d8..888b323 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1990,7 +1990,6 @@ static void test_multiselect(void)
     r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
     expect(3, r);
     r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0);
-todo_wine
     expect(-1, r);
 
     style = GetWindowLongPtrA(hwnd, GWL_STYLE);
@@ -2022,7 +2021,6 @@ todo_wine
     r = SendMessage(hwnd, LVM_GETSELECTEDCOUNT, 0, 0);
     expect(1, r);
     r = SendMessage(hwnd, LVM_GETSELECTIONMARK, 0, 0);
-todo_wine
     expect(-1, r);
 
     /* try to select all on LVS_SINGLESEL */




More information about the wine-cvs mailing list