Removed duplicated code from TOOL_MANAGER::RunAction()

This commit is contained in:
Maciej Suminski 2017-03-03 14:53:55 +01:00
parent 541b91fd15
commit ac38f1112d
1 changed files with 4 additions and 14 deletions

View File

@ -279,23 +279,13 @@ bool TOOL_MANAGER::RunAction( const std::string& aActionName, bool aNow, void* a
{
TOOL_ACTION* action = m_actionMgr->FindAction( aActionName );
if( action )
if( !action )
{
TOOL_EVENT event = action->MakeEvent();
// Allow to override the action parameter
if( aParam )
event.SetParameter( aParam );
if( aNow )
ProcessEvent( event );
else
PostEvent( event );
return true;
wxASSERT_MSG( false, wxString::Format( wxT( "Could not find action %s." ), aActionName ) );
return false;
}
wxASSERT_MSG( action != NULL, wxString::Format( wxT( "Could not find action %s." ), aActionName ) );
RunAction( *action, aNow, aParam );
return false;
}