Commit c7329015 authored by Angelo Haller's avatar Angelo Haller Committed by Alexandre Julliard

comctl32/listview: Send LVN_ODSTATECHANGED notification for LVS_OWNERDATA…

comctl32/listview: Send LVN_ODSTATECHANGED notification for LVS_OWNERDATA listview on selection changes. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52534Signed-off-by: 's avatarAngelo Haller <angelo@szanni.org>
parent 6c814f81
...@@ -3610,6 +3610,7 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) ...@@ -3610,6 +3610,7 @@ static BOOL LISTVIEW_AddGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
*/ */
static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
{ {
INT nFirst = -1, nLast = -1;
RANGES selection; RANGES selection;
DWORD old_mask; DWORD old_mask;
LVITEMW item; LVITEMW item;
...@@ -3661,21 +3662,28 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) ...@@ -3661,21 +3662,28 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem)
iterator_destroy(&i); iterator_destroy(&i);
} }
/* disable per item notifications on LVS_OWNERDATA style /* Disable per item notifications on LVS_OWNERDATA style */
FIXME: single LVN_ODSTATECHANGED should be used */
old_mask = infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE; old_mask = infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE;
if (infoPtr->dwStyle & LVS_OWNERDATA) if (infoPtr->dwStyle & LVS_OWNERDATA)
infoPtr->notify_mask &= ~NOTIFY_MASK_ITEM_CHANGE; infoPtr->notify_mask &= ~NOTIFY_MASK_ITEM_CHANGE;
LISTVIEW_DeselectAllSkipItems(infoPtr, selection); LISTVIEW_DeselectAllSkipItems(infoPtr, selection);
iterator_rangesitems(&i, selection); iterator_rangesitems(&i, selection);
while(iterator_next(&i)) while(iterator_next(&i))
LISTVIEW_SetItemState(infoPtr, i.nItem, &item); {
/* Find the range for LVN_ODSTATECHANGED */
if (nFirst == -1)
nFirst = i.nItem;
nLast = i.nItem;
LISTVIEW_SetItemState(infoPtr, i.nItem, &item);
}
/* this will also destroy the selection */ /* this will also destroy the selection */
iterator_destroy(&i); iterator_destroy(&i);
if (infoPtr->dwStyle & LVS_OWNERDATA)
LISTVIEW_SetOwnerDataState(infoPtr, nFirst, nLast, &item);
infoPtr->notify_mask |= old_mask; infoPtr->notify_mask |= old_mask;
LISTVIEW_SetItemFocus(infoPtr, nItem); LISTVIEW_SetItemFocus(infoPtr, nItem);
} }
......
...@@ -3577,7 +3577,7 @@ static void test_ownerdata_multiselect(void) ...@@ -3577,7 +3577,7 @@ static void test_ownerdata_multiselect(void)
ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
ownerdata_multiselect_odstatechanged_seq, ownerdata_multiselect_odstatechanged_seq,
"ownerdata select multiple notification", TRUE); "ownerdata select multiple notification", FALSE);
res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
expect(0, res); expect(0, res);
...@@ -3594,7 +3594,7 @@ static void test_ownerdata_multiselect(void) ...@@ -3594,7 +3594,7 @@ static void test_ownerdata_multiselect(void)
ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX, ok_sequence(sequences, PARENT_ODSTATECHANGED_SEQ_INDEX,
ownerdata_multiselect_odstatechanged_seq, ownerdata_multiselect_odstatechanged_seq,
"ownerdata select multiple notification", TRUE); "ownerdata select multiple notification", FALSE);
res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0); res = SendMessageA(hwnd, WM_KEYUP, VK_DOWN, 0);
expect(0, res); expect(0, res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment