From f50d84586a757fd5116c8dd37c795c0021526c9e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Jul 2010 11:26:49 +0000 Subject: [PATCH] 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 --- src/common/docview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.47.2