Mikołaj Zalewski : comctl32: toolbar: We shouldn' t try to resize standard bitmaps.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 21 08:17:10 CDT 2007


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

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Mon Mar 19 18:57:25 2007 +0100

comctl32: toolbar: We shouldn't try to resize standard bitmaps.

---

 dlls/comctl32/tests/toolbar.c |   24 +-----------------------
 dlls/comctl32/toolbar.c       |    3 ++-
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 43c93dd..d5b055e 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -190,28 +190,6 @@ static void rebuild_toolbar_with_buttons(HWND *hToolbar)
     } \
 }
 
-#define CHECK_IMAGELIST_TODO_COUNT(count, dx, dy) { \
-    int cx, cy; \
-    HIMAGELIST himl = (HIMAGELIST)SendMessageA(hToolbar, TB_GETIMAGELIST, 0, 0); \
-    ok(himl != NULL, "No image list\n"); \
-    if (himl != NULL) {\
-        todo_wine ok(ImageList_GetImageCount(himl) == count, "Images count mismatch - %d vs %d\n", count, ImageList_GetImageCount(himl)); \
-        ImageList_GetIconSize(himl, &cx, &cy); \
-        ok(cx == dx && cy == dy, "Icon size mismatch - %dx%d vs %dx%d\n", dx, dy, cx, cy); \
-    } \
-}
-
-#define CHECK_IMAGELIST_TODO_COUNT_SIZE(count, dx, dy) { \
-    int cx, cy; \
-    HIMAGELIST himl = (HIMAGELIST)SendMessageA(hToolbar, TB_GETIMAGELIST, 0, 0); \
-    ok(himl != NULL, "No image list\n"); \
-    if (himl != NULL) {\
-        todo_wine ok(ImageList_GetImageCount(himl) == count, "Images count mismatch - %d vs %d\n", count, ImageList_GetImageCount(himl)); \
-        ImageList_GetIconSize(himl, &cx, &cy); \
-        todo_wine ok(cx == dx && cy == dy, "Icon size mismatch - %dx%d vs %dx%d\n", dx, dy, cx, cy); \
-    } \
-}
-
 static void test_add_bitmap(void)
 {
     HWND hToolbar = NULL;
@@ -358,7 +336,7 @@ static void test_add_bitmap(void)
     ok(SendMessageA(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&stdsmall) == 1, "TB_SETBITMAPSIZE failed\n");
     UpdateWindow(hToolbar);
     compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x");
-    CHECK_IMAGELIST_TODO_COUNT(22, 20, 15);
+    CHECK_IMAGELIST(22, 20, 15);
 
     /* check standard bitmaps */
     addbmp.hInst = HINST_COMMCTRL;
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index c40ced0..c17e7b9 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -2669,7 +2669,8 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB
 
     /* enlarge the bitmap if needed */
     ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon);
-    COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
+    if (bitmap->hInst != COMCTL32_hModule)
+        COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
     
     nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace);
     DeleteObject(hbmLoad);




More information about the wine-cvs mailing list