applied patch 103610
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2162,11 +2162,6 @@ void wxFileHistory::RemoveFileFromHistory(int i)
|
||||
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];
|
||||
|
||||
@@ -2176,6 +2171,12 @@ void wxFileHistory::RemoveFileFromHistory(int i)
|
||||
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++ )
|
||||
@@ -2187,6 +2188,7 @@ void wxFileHistory::RemoveFileFromHistory(int i)
|
||||
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
|
||||
|
Reference in New Issue
Block a user