From 7044ac87512fb91287a96c3033c46fe6db873f26 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 10 Sep 2009 22:56:56 +0400 Subject: [PATCH] comctl32/dpa: Fix DPA_Merge() for DPAM_INTERSECT option. --- dlls/comctl32/dpa.c | 2 +- dlls/comctl32/tests/dpa.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c index 9a4883aeb28..def2e9596ef 100644 --- a/dlls/comctl32/dpa.c +++ b/dlls/comctl32/dpa.c @@ -311,7 +311,7 @@ BOOL WINAPI DPA_Merge (HDPA hdpa1, HDPA hdpa2, DWORD dwFlags, /* Now delete the extra item in DPA1 */ PVOID ptr; - ptr = DPA_DeletePtr (hdpa1, hdpa1->nItemCount - 1); + ptr = DPA_DeletePtr (hdpa1, nIndex); (pfnMerge)(DPAMM_DELETE, ptr, NULL, lParam); } diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index 5d16c67dad0..d7de37710c7 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -396,11 +396,9 @@ static void test_DPA_Merge(void) memset(nMessages, 0, sizeof(nMessages)); pDPA_Merge(dpa2, dpa, DPAM_INTERSECT, CB_CmpLT, CB_MergeDeleteOddSrc, 0xdeadbeef); - todo_wine - { - rc = CheckDPA(dpa2, 0x246, &dw); - ok(rc, "dw=0x%x\n", dw); - } + rc = CheckDPA(dpa2, 0x246, &dw); + ok(rc, "dw=0x%x\n", dw); + expect(3, nMessages[DPAMM_MERGE]); expect(3, nMessages[DPAMM_DELETE]); expect(0, nMessages[DPAMM_INSERT]); @@ -415,11 +413,9 @@ static void test_DPA_Merge(void) memset(nMessages, 0, sizeof(nMessages)); pDPA_Merge(dpa2, dpa, DPAM_INTERSECT, CB_CmpLT, CB_MergeInsertSrc, 0xdeadbeef); - todo_wine - { - rc = CheckDPA(dpa2, 0x135, &dw); - ok(rc, "dw=0x%x\n", dw); - } + rc = CheckDPA(dpa2, 0x135, &dw); + ok(rc, "dw=0x%x\n", dw); + expect(3, nMessages[DPAMM_MERGE]); expect(6, nMessages[DPAMM_DELETE]); expect(0, nMessages[DPAMM_INSERT]);