X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dee1a63ff52bfe4da396187f8438aa1a29796737..74ebd40690d3676e74a7cfc239eee6c7e9764f05:/src/common/framecmn.cpp?ds=inline diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 3137700a88..923fb49e2d 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -523,16 +523,16 @@ void wxFrameBase::SetToolBar(wxToolBar *toolbar) // update all menus void wxFrameBase::DoMenuUpdates(wxMenu* menu) { - wxEvtHandler* source = GetEventHandler(); - wxMenuBar* bar = GetMenuBar(); - if (menu) + { + wxEvtHandler* source = GetEventHandler(); menu->UpdateUI(source); - else if ( bar != NULL ) + } + else { - int nCount = bar->GetMenuCount(); - for (int n = 0; n < nCount; n++) - bar->GetMenu(n)->UpdateUI(source); + wxMenuBar* bar = GetMenuBar(); + if (bar != NULL) + bar->UpdateMenus(); } }