pcbnew: don't pick up selection after unsuccessful Duplicate
Following rev 6627 (git 2777182
), if a non-duplicatable item was the object of
a Duplicate action, the original item would be picked up, potentially
misleading the user into thinking something was actually duplicated.
This commit is contained in:
parent
fd1d7ecb6e
commit
60d93d024c
|
@ -777,16 +777,18 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
// record the new items as added
|
// record the new items as added
|
||||||
if( !m_editModules )
|
if( !m_editModules && !selection.Empty() )
|
||||||
|
{
|
||||||
editFrame->SaveCopyInUndoList( selection.items, UR_NEW );
|
editFrame->SaveCopyInUndoList( selection.items, UR_NEW );
|
||||||
|
|
||||||
editFrame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ),
|
editFrame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ),
|
||||||
(int) old_items.size() ) );
|
(int) old_items.size() ) );
|
||||||
|
|
||||||
// pick up the selected item(s) and start moving
|
// If items were duplicated, pick them up
|
||||||
// this works well for "dropping" copies around
|
// this works well for "dropping" copies around
|
||||||
TOOL_EVENT evt = COMMON_ACTIONS::editActivate.MakeEvent();
|
TOOL_EVENT evt = COMMON_ACTIONS::editActivate.MakeEvent();
|
||||||
Main( evt );
|
Main( evt );
|
||||||
|
}
|
||||||
|
|
||||||
// and re-enable undos
|
// and re-enable undos
|
||||||
decUndoInhibit();
|
decUndoInhibit();
|
||||||
|
|
Loading…
Reference in New Issue