Mike McCormack : comctl32: Remove Nx1 assumptions in ImageList_Merge.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 6 05:48:33 CST 2006


Module: wine
Branch: master
Commit: ca6be70819746a10e80af48c9b13d39e90633705
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ca6be70819746a10e80af48c9b13d39e90633705

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sun Nov  5 17:10:09 2006 +0900

comctl32: Remove Nx1 assumptions in ImageList_Merge.

---

 dlls/comctl32/imagelist.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 3db07e5..99c83be 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -1773,7 +1773,7 @@ ImageList_Merge (HIMAGELIST himl1, INT i
     HIMAGELIST himlDst = NULL;
     INT      cxDst, cyDst;
     INT      xOff1, yOff1, xOff2, yOff2;
-    INT      nX1, nX2;
+    POINT    pt1, pt2;
 
     TRACE("(himl1=%p i1=%d himl2=%p i2=%d dx=%d dy=%d)\n", himl1, i1, himl2,
 	   i2, dx, dy);
@@ -1817,25 +1817,25 @@ ImageList_Merge (HIMAGELIST himl1, INT i
 
     if (himlDst)
     {
-        nX1 = i1 * himl1->cx;
-        nX2 = i2 * himl2->cx;
+        imagelist_point_from_index( himl1, i1, &pt1 );
+        imagelist_point_from_index( himl1, i2, &pt2 );
 
         /* copy image */
         BitBlt (himlDst->hdcImage, 0, 0, cxDst, cyDst, himl1->hdcImage, 0, 0, BLACKNESS);
         if (i1 >= 0 && i1 < himl1->cCurImage)
-            BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, nX1, 0, SRCCOPY);
+            BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, pt1.x, pt1.y, SRCCOPY);
         if (i2 >= 0 && i2 < himl2->cCurImage)
         {
-            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , nX2, 0, SRCAND);
-            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, nX2, 0, SRCPAINT);
+            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
+            BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
         }
 
         /* copy mask */
         BitBlt (himlDst->hdcMask, 0, 0, cxDst, cyDst, himl1->hdcMask, 0, 0, WHITENESS);
         if (i1 >= 0 && i1 < himl1->cCurImage)
-            BitBlt (himlDst->hdcMask,  xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcMask,  nX1, 0, SRCCOPY);
+            BitBlt (himlDst->hdcMask,  xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcMask,  pt1.x, pt1.y, SRCCOPY);
         if (i2 >= 0 && i2 < himl2->cCurImage)
-            BitBlt (himlDst->hdcMask,  xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask,  nX2, 0, SRCAND);
+            BitBlt (himlDst->hdcMask,  xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask,  pt2.x, pt2.y, SRCAND);
 
 	himlDst->cCurImage = 1;
     }




More information about the wine-cvs mailing list