Commit 7044ac87 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/dpa: Fix DPA_Merge() for DPAM_INTERSECT option.

parent e97fcdd1
......@@ -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);
}
......
......@@ -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]);
......
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