fix assert when adding an entry to an already full file history (closes #10118)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2013,24 +2013,22 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
|
||||
{
|
||||
RemoveFileFromHistory(--numFiles);
|
||||
}
|
||||
else // add a new menu item to all file menus (will be updated below)
|
||||
|
||||
// add a new menu item to all file menus (they will be updated below)
|
||||
for ( wxList::compatibility_iterator node = m_fileMenus.GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
for ( wxList::compatibility_iterator node = m_fileMenus.GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
wxMenu * const menu = (wxMenu *)node->GetData();
|
||||
wxMenu * const menu = (wxMenu *)node->GetData();
|
||||
|
||||
if ( !numFiles && menu->GetMenuItemCount() )
|
||||
menu->AppendSeparator();
|
||||
if ( !numFiles && menu->GetMenuItemCount() )
|
||||
menu->AppendSeparator();
|
||||
|
||||
// label doesn't matter, it will be set below anyhow, but it can't
|
||||
// be empty (this is supposed to indicate a stock item)
|
||||
menu->Append(m_idBase + numFiles, " ");
|
||||
}
|
||||
// label doesn't matter, it will be set below anyhow, but it can't
|
||||
// be empty (this is supposed to indicate a stock item)
|
||||
menu->Append(m_idBase + numFiles, " ");
|
||||
}
|
||||
|
||||
|
||||
// insert the new file in the beginning of the file history
|
||||
m_fileHistory.insert(m_fileHistory.begin(), file);
|
||||
numFiles++;
|
||||
|
Reference in New Issue
Block a user