Rebase against 287dabd9b6887e94cabfa2a5f9bfe822522095e5

This commit is contained in:
Alistair Leslie-Hughes 2020-01-15 09:12:06 +11:00
parent d8496cacd1
commit 329005baaf

View File

@ -56,57 +56,6 @@ index 56e2563..a35f5f2 100644
if (subitemstage & CDRF_NOTIFYPOSTPAINT)
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPOSTPAINT, &nmlvcd);
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index ec87e3b..eb4db0e 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1830,12 +1830,16 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
clr = GetBkColor(nmlvcd->nmcd.hdc);
ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
- todo_wine_if(nmlvcd->iSubItem)
- ok(clr == c0ffee, "clr=%.8x\n", clr);
+ if (!(GetWindowLongW(nmhdr->hwndFrom, GWL_STYLE) & LVS_SHOWSELALWAYS))
+ {
+ todo_wine_if(nmlvcd->iSubItem)
+ ok(clr == c0ffee, "clr=%.8x\n", clr);
+ }
return CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc);
- todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
+ if (!(GetWindowLongW(nmhdr->hwndFrom, GWL_STYLE) & LVS_SHOWSELALWAYS))
+ todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
return CDRF_DODEFAULT;
@@ -1851,6 +1855,7 @@ static void test_customdraw(void)
{
HWND hwnd;
WNDPROC oldwndproc;
+ LVITEMA item;
hwnd = create_listview_control(LVS_REPORT);
@@ -1870,6 +1875,18 @@ static void test_customdraw(void)
UpdateWindow(hwnd);
ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_report_cd_seq, "parent customdraw, LVS_REPORT", FALSE);
+ /* check colors when item is selected */
+ SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | LVS_SHOWSELALWAYS);
+ item.mask = LVIF_STATE;
+ item.stateMask = LVIS_SELECTED;
+ item.state = LVIS_SELECTED;
+ SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ InvalidateRect(hwnd, NULL, TRUE);
+ UpdateWindow(hwnd);
+ ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_report_cd_seq, "parent customdraw, LVS_REPORT, selection", FALSE);
+
DestroyWindow(hwnd);
hwnd = create_listview_control(LVS_LIST);
--
2.9.0