git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9307
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxCHECK_RET( i < m_fileHistoryN,
wxT("invalid index in wxFileHistory::RemoveFileFromHistory") );
wxCHECK_RET( i < m_fileHistoryN,
wxT("invalid index in wxFileHistory::RemoveFileFromHistory") );
- wxNode* node = m_fileMenus.First();
- while ( node )
- {
- wxMenu* menu = (wxMenu*) node->Data();
-
// delete the element from the array (could use memmove() too...)
delete [] m_fileHistory[i];
// delete the element from the array (could use memmove() too...)
delete [] m_fileHistory[i];
m_fileHistory[j] = m_fileHistory[j + 1];
}
m_fileHistory[j] = m_fileHistory[j + 1];
}
+ wxNode* node = m_fileMenus.First();
+ while ( node )
+ {
+ wxMenu* menu = (wxMenu*) node->Data();
+
+
// shuffle filenames up
wxString buf;
for ( j = i; j < m_fileHistoryN - 1; j++ )
// shuffle filenames up
wxString buf;
for ( j = i; j < m_fileHistoryN - 1; j++ )
node = node->Next();
// delete the last menu item which is unused now
node = node->Next();
// delete the last menu item which is unused now
+ if (menu->FindItem(wxID_FILE1 + m_fileHistoryN - 1))
menu->Delete(wxID_FILE1 + m_fileHistoryN - 1);
// delete the last separator too if no more files are left
menu->Delete(wxID_FILE1 + m_fileHistoryN - 1);
// delete the last separator too if no more files are left