From 982eee7905390f9a5f5a85645c33a7e51f246e40 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 24 Jul 2015 09:42:45 +0200 Subject: [PATCH] Do not invoke PNS inline dragging when 'Duplicate' is run. --- common/tool/action_manager.cpp | 4 ++-- pcbnew/tools/edit_tool.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index 16e4bba013..72706bea14 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -109,8 +109,8 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const int key = aHotKey & ~MD_MODIFIER_MASK; int mod = aHotKey & MD_MODIFIER_MASK; - if( key >= 'a' && key <= 'z') - key = std::toupper(key); + if( key >= 'a' && key <= 'z' ) + key = std::toupper( key ); HOTKEY_LIST::const_iterator it = m_actionHotKeys.find( key | mod ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index db6ef61c05..80376d6099 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -113,6 +113,9 @@ bool EDIT_TOOL::invokeInlineRouter() TRACK* track = uniqueSelected(); VIA* via = uniqueSelected(); + if( isUndoInhibited() ) + return false; + if( track || via ) { ROUTER_TOOL* theRouter = static_cast( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) ); @@ -753,7 +756,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) // so zones are not duplicated if( item->Type() != PCB_ZONE_AREA_T ) #endif - new_item = editFrame->GetBoard()->DuplicateAndAddItem( item, increment ); + new_item = editFrame->GetBoard()->DuplicateAndAddItem( item, increment ); } if( new_item )