From b274b9f9723131f733ec306a2a4e05dfb0c03a8c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 4 Jun 2020 22:08:09 +0100 Subject: [PATCH] Fix type-checking which was too tight. Also fixes a typo leaving the return statement in the wrong place. Fixes https://gitlab.com/kicad/code/kicad/issues/4611 --- common/tool/action_menu.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 47ce110097..e97cf9f5b2 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -404,19 +404,19 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) keyEvent.m_shiftDown = ( acceleratorKey->GetFlags() & wxMOD_SHIFT ) > 0; keyEvent.m_altDown = ( acceleratorKey->GetFlags() & wxMOD_ALT ) > 0; - if( dynamic_cast( focus ) ) - focus->HandleWindowEvent( keyEvent ); - else if( dynamic_cast( focus ) ) + if( dynamic_cast( focus ) ) TEXTENTRY_TRICKS::OnCharHook( dynamic_cast( focus ), keyEvent ); + else + focus->HandleWindowEvent( keyEvent ); if( keyEvent.GetSkipped() ) { keyEvent.SetEventType( wxEVT_CHAR ); focus->HandleWindowEvent( keyEvent ); } - } - return; + return; + } } // Store the selected position, so it can be checked by the tools