From cfb6a8a36e54895af86e942856edbc25824adf05 Mon Sep 17 00:00:00 2001 From: David Quintana Date: Thu, 24 Apr 2014 16:17:53 +0000 Subject: [PATCH] [RSHELL] * Fix stack overflow when pressing enter with a menu item selected. Executing with enter now works correctly. CORE-7586 svn path=/branches/shell-experiments/; revision=62957 --- base/shell/rshell/CMenuToolbars.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/base/shell/rshell/CMenuToolbars.cpp b/base/shell/rshell/CMenuToolbars.cpp index 6159b310ba2..de19f94b648 100644 --- a/base/shell/rshell/CMenuToolbars.cpp +++ b/base/shell/rshell/CMenuToolbars.cpp @@ -816,13 +816,6 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe INT iItem = (INT)wParam; - return ExecuteItem(iItem); -} - -HRESULT CMenuToolbarBase::ExecuteItem(INT iItem) -{ - m_menuBand->_KillPopupTimers(); - if (PopupItem(iItem) == S_OK) { TRACE("PopupItem returned S_OK\n"); @@ -831,10 +824,12 @@ HRESULT CMenuToolbarBase::ExecuteItem(INT iItem) TRACE("Executing...\n"); - HRESULT hr = m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); + return m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); +} - if (FAILED_UNEXPECTEDLY(hr)) - return hr; +HRESULT CMenuToolbarBase::ExecuteItem(INT iItem) +{ + m_menuBand->_KillPopupTimers(); INT index; DWORD_PTR data;