X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa9f937f05d77c2d8f8c96374f6856b8ccc3a642..df7f0a04ba6c573a8e13738d63d31e5395640ae3:/src/mac/carbon/menu.cpp?ds=sidebyside diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 046f7e0166..e4e0879b02 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -177,9 +177,9 @@ void wxMenu::EndRadioGroup() m_startRadioGroup = -1; } -bool wxMenu::DoAppend(wxMenuItem *item) +wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { - wxCHECK_MSG( item, FALSE, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); bool check = FALSE; @@ -222,7 +222,7 @@ bool wxMenu::DoAppend(wxMenuItem *item) if ( !wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item) ) { - return FALSE; + return NULL; } if ( check ) @@ -231,12 +231,15 @@ bool wxMenu::DoAppend(wxMenuItem *item) item->Check(TRUE); } - return TRUE; + return item; } -bool wxMenu::DoInsert(size_t pos, wxMenuItem *item) +wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) { - return wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos); + if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos)) + return item; + else + return NULL; } wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)