From c6cd1a305eb98f34a74aab499249c6c760aa861f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Dec 2014 22:18:07 +0000 Subject: [PATCH] Don't put wxMenu::MSWGetMenu() inside wxUSE_OWNER_DRAWN check. This doesn't make any sense, this function is not related to the owner drawing code at all and should always be available. This corrects the changes of r70316, see #13851. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/menu.h | 6 +++--- src/msw/menu.cpp | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 0a56d318de..b85873e9ad 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -102,6 +102,9 @@ public: wxAcceleratorTable *CreateAccelTable() const; #endif // wxUSE_ACCEL + // get the menu with given handle (recursively) + wxMenu* MSWGetMenu(WXHMENU hMenu); + #if wxUSE_OWNER_DRAWN int GetMaxAccelWidth() @@ -116,9 +119,6 @@ public: m_maxAccelWidth = -1; } - // get the menu with given handle (recursively) - wxMenu* MSWGetMenu(WXHMENU hMenu); - private: void CalculateMaxAccelWidth(); diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 68422010cd..f27822dc49 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -989,7 +989,6 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id_) } // get the menu with given handle (recursively) -#if wxUSE_OWNER_DRAWN wxMenu* wxMenu::MSWGetMenu(WXHMENU hMenu) { // check self @@ -1012,7 +1011,6 @@ wxMenu* wxMenu::MSWGetMenu(WXHMENU hMenu) // unknown hMenu return NULL; } -#endif // wxUSE_OWNER_DRAWN // --------------------------------------------------------------------------- // Menu Bar @@ -1639,7 +1637,6 @@ wxMenu* wxMenuBar::MSWGetMenu(WXHMENU hMenu) if ( hMenu == GetHMenu() ) return NULL; -#if wxUSE_OWNER_DRAWN // query all menus for ( size_t n = 0 ; n < GetMenuCount(); ++n ) { @@ -1647,7 +1644,6 @@ wxMenu* wxMenuBar::MSWGetMenu(WXHMENU hMenu) if ( menu ) return menu; } -#endif // unknown hMenu return NULL;