From 8087e6c94203a511ec26d870350c802bce16fa07 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 May 2012 14:24:16 +0000 Subject: [PATCH] Remove assert checking bitmap size in wxMenuItem drawing code in wxMSW. This assert was fatal, as usual when asserting from a WM_PAINT handler, as the function was reentered resulting in nested asserts and program abort, so remove it to at least let the program continue to run even if there is not enough space for the bitmap in the menu. There is, of course, still something wrong with the menu geometry calculations if this happens but I can't even reproduce this any more so not sure what exactly. See #11657. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menuitem.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 94d963d4ac..b9414823aa 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -1072,9 +1072,6 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, int nBmpWidth = bmp.GetWidth(), nBmpHeight = bmp.GetHeight(); - // there should be enough space! - wxASSERT( nBmpWidth <= imgWidth && nBmpHeight <= (rcImg.bottom - rcImg.top) ); - int x = rcImg.left + (imgWidth - nBmpWidth) / 2; int y = rcImg.top + (rcImg.bottom - rcImg.top - nBmpHeight) / 2; dc.Blit(x, y, nBmpWidth, nBmpHeight, &dcMem, 0, 0, wxCOPY, true);