[4/4] comctl32/listview: Don't alter selection mark in LVM_SETITEMSTATE

Nikolay Sivov bunglehead at gmail.com
Thu Jul 23 14:56:26 CDT 2009


Changelog:
    - Don't alter selection mark in LVM_SETITEMSTATE

>From ca0b43d8178836daeb9ce3be20ac1bf6335744a6 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu, 23 Jul 2009 23:50:12 +0400
Subject: 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 */
-- 
1.5.6.5





More information about the wine-patches mailing list