X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/283ed244ade1cf6faa11022f7240323fe15aa58e..1d2fe15e719db47cc7a2630aa91f55a95dffbb98:/src/os2/menu.cpp diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 1b8c4885c9..dff498d244 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -52,11 +52,7 @@ static const int idMenuTitle = -2; // // The unique ID for Menus // -#ifdef __VISAGECPP__ USHORT wxMenu::m_nextMenuId = 0; -#else -static USHORT wxMenu::m_nextMenuId = 0; -#endif // ---------------------------------------------------------------------------- // macros @@ -348,7 +344,7 @@ bool wxMenu::DoInsertOrAppend( pItem->m_vMenuData.afStyle = rItem.afStyle; pItem->m_vMenuData.hItem = rItem.hItem; } - else + else if (!pItem->IsSeparator()) #endif { // @@ -419,11 +415,11 @@ void wxMenu::EndRadioGroup() m_nStartRadioGroup = -1; } // end of wxMenu::EndRadioGroup -bool wxMenu::DoAppend( +wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem ) { - wxCHECK_MSG( pItem, FALSE, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") ); bool bCheck = FALSE; @@ -475,7 +471,7 @@ bool wxMenu::DoAppend( if (!wxMenuBase::DoAppend(pItem) || !DoInsertOrAppend(pItem)) { - return FALSE; + return NULL; } if (bCheck) { @@ -484,20 +480,22 @@ bool wxMenu::DoAppend( // pItem->Check(TRUE); } - return TRUE; + return pItem; } // end of wxMenu::DoAppend -bool wxMenu::DoInsert( +wxMenuItem* wxMenu::DoInsert( size_t nPos , wxMenuItem* pItem ) { - return ( wxMenuBase::DoInsert( nPos - ,pItem) && + if ( wxMenuBase::DoInsert( nPos + ,pItem) && DoInsertOrAppend( pItem ,nPos - ) - ); + )) + return pItem; + else + return NULL; } // end of wxMenu::DoInsert wxMenuItem* wxMenu::DoRemove(