Correct the check for MRU menu items range.

The last id of the range if offset by the first one by the number of items in
the menu, not the base id of the file history menu.

Closes #12141.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-28 11:26:49 +00:00
parent 1ef352a926
commit f50d84586a

View File

@@ -1087,7 +1087,7 @@ void wxDocManager::OnMRUFile(wxCommandEvent& event)
// Check if the id is in the range assigned to MRU list entries.
const int id = event.GetId();
if ( id >= wxID_FILE1 &&
id < wxID_FILE1 + m_fileHistory->GetBaseId() )
id < wxID_FILE1 + static_cast<int>(m_fileHistory->GetCount()) )
{
DoOpenMRUFile(id - wxID_FILE1);
}