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:
Vadim Zeitlin
2008-10-29 16:04:06 +00:00
parent 5e27edecac
commit 838dd956a4

View File

@@ -2013,8 +2013,8 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
{ {
RemoveFileFromHistory(--numFiles); 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(); for ( wxList::compatibility_iterator node = m_fileMenus.GetFirst();
node; node;
node = node->GetNext() ) node = node->GetNext() )
@@ -2028,8 +2028,6 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
// be empty (this is supposed to indicate a stock item) // be empty (this is supposed to indicate a stock item)
menu->Append(m_idBase + numFiles, " "); menu->Append(m_idBase + numFiles, " ");
} }
}
// insert the new file in the beginning of the file history // insert the new file in the beginning of the file history
m_fileHistory.insert(m_fileHistory.begin(), file); m_fileHistory.insert(m_fileHistory.begin(), file);