From 9adf012c20951611e91866e8f5e7442ae9bc0018 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 5 May 2019 11:29:55 +0100 Subject: [PATCH] Move duplicate hotkey check so it respects AS_CONTEXT. --- common/tool/action_manager.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index dd3d64a4d1..ad41fa344f 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -206,18 +206,20 @@ void ACTION_MANAGER::UpdateHotKeys() // are loaded after if( action->GetScope() == AS_GLOBAL && m_actionHotKeys.count( hotkey ) ) { - // Users are free to define colliding hotkeys, but we want to know if - // our default set has any collisions. - wxFAIL_MSG( wxString::Format( "Duplicate hotkey definitions for %s: %s and %s", - KeyNameFromKeyCode( hotkey ), - actionName.first, - m_actionHotKeys[hotkey].front()->GetName() ) ); - for( auto it = m_actionHotKeys[hotkey].begin(); it != m_actionHotKeys[hotkey].end(); ) { if( (*it)->GetScope() == AS_GLOBAL ) + { + // Users are free to define colliding hotkeys, but we want to know if + // our default set has any collisions. + wxFAIL_MSG( wxString::Format( "Duplicate hotkey definitions for %s: %s and %s", + KeyNameFromKeyCode( hotkey ), + actionName.first, + m_actionHotKeys[hotkey].front()->GetName() ) ); + it = m_actionHotKeys[hotkey].erase( it ); + } else it++; }