Module: wine Branch: master Commit: 7deb2779007993a8031ce943486120d42d82c22f URL: http://source.winehq.org/git/wine.git/?a=commit;h=7deb2779007993a8031ce94348...
Author: Nikolay Sivov bunglehead@gmail.com Date: Wed Dec 23 23:08:32 2009 +0300
comctl32/comboex: Fix silly typo in CBEM_SETITEM handler (lParam wasn't set).
---
dlls/comctl32/comboex.c | 2 +- dlls/comctl32/tests/comboex.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index d423527..1609b90 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -806,7 +806,7 @@ static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if (cit->mask & CBEIF_INDENT) item->iIndent = cit->iIndent; if (cit->mask & CBEIF_LPARAM) - cit->lParam = cit->lParam; + item->lParam = cit->lParam;
if (TRACE_ON(comboex)) COMBOEX_DumpItem (item);
diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index f732af5..d6bbce1 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -29,6 +29,8 @@
#define EDITBOX_ID 0
+#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) + static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
static HWND hComboExParentWnd; @@ -491,10 +493,27 @@ static void test_get_set_item(void) item.pszText = textA; item.iItem = -1; ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); - ok(ret, "CBEM_SETITEMA failed\n"); + expect(TRUE, ret);
ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE);
+ /* get/set lParam */ + item.mask = CBEIF_LPARAM; + item.iItem = -1; + item.lParam = 0xdeadbeef; + ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.lParam == 0, "Expected zero, got %ld\n", item.lParam); + + item.lParam = 0xdeadbeef; + ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + + item.lParam = 0; + ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.lParam == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", item.lParam); + DestroyWindow(hComboEx); }