Check for menu title being non-empty when appending it to the menu bar.
It doesn't make sense to add a menu with empty title to the menu bar so assert that the title is not empty and fail to add the menu if it is. See r64033 in wxQT branch. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -73,7 +73,7 @@ public:
|
||||
@param menu
|
||||
The menu to add. Do not deallocate this menu after calling Append().
|
||||
@param title
|
||||
The title of the menu.
|
||||
The title of the menu, must be non-empty.
|
||||
|
||||
@return @true on success, @false if an error occurred.
|
||||
|
||||
|
@@ -616,9 +616,10 @@ wxMenu *wxMenuBarBase::GetMenu(size_t pos) const
|
||||
return node->GetData();
|
||||
}
|
||||
|
||||
bool wxMenuBarBase::Append(wxMenu *menu, const wxString& WXUNUSED(title))
|
||||
bool wxMenuBarBase::Append(wxMenu *menu, const wxString& title)
|
||||
{
|
||||
wxCHECK_MSG( menu, false, wxT("can't append NULL menu") );
|
||||
wxCHECK_MSG( !title.empty(), false, wxT("can't append menu with empty title") );
|
||||
|
||||
m_menus.Append(menu);
|
||||
menu->Attach(this);
|
||||
|
Reference in New Issue
Block a user