From: Vadim Zeitlin Date: Wed, 5 Jan 2011 23:52:56 +0000 (+0000) Subject: Correct measurement for owner drawn menu items with only unchecked bitmap. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bbce6969f6966b0f1754341355d3ae64730d2268 Correct measurement for owner drawn menu items with only unchecked bitmap. Check for either checked or unchecked bitmap being specified for the item instead of checking the checked/normal bitmap twice which was an obvious typo and also resulted in items with unchecked bitmap only not being measured correctly (although I'm not sure if this is actually a supported use case). Closes #12846. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index f897ef67fe..96d19ebf0f 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -882,7 +882,7 @@ bool wxMenuItem::OnMeasureItem(size_t *width, size_t *height) *width += imgWidth + data->CheckBgMargin.GetTotalX(); } - if ( m_bmpChecked.IsOk() || m_bmpChecked.IsOk() ) + if ( m_bmpChecked.IsOk() || m_bmpUnchecked.IsOk() ) { // get size of bitmap always return valid value (0 for invalid bitmap), // so we don't needed check if bitmap is valid ;)