From: Vadim Zeitlin Date: Wed, 28 Jul 2010 11:26:49 +0000 (+0000) Subject: Correct the check for MRU menu items range. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f50d84586a757fd5116c8dd37c795c0021526c9e 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 --- diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 69e5061128..e2ff18c915 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -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(m_fileHistory->GetCount()) ) { DoOpenMRUFile(id - wxID_FILE1); }