Fix Bug #1426675 (Undo and cancel commands don't have effect for Duplicate operation in legacy mode)

This commit is contained in:
https://launchpad.net/~john-j-beard
2015-03-22 10:42:41 +01:00
committed by jean-pierre charras
parent 036404ded5
commit 0350290499
16 changed files with 184 additions and 143 deletions
+12 -6
View File
@@ -1132,12 +1132,6 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem,
{
D_PAD* new_pad = new D_PAD( *static_cast<const D_PAD*>( aItem ) );
if( aIncrementPadNumbers )
{
// Take the next available pad number
new_pad->IncrementPadName( true, true );
}
Pads().PushBack( new_pad );
new_item = new_pad;
break;
@@ -1177,6 +1171,11 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem,
break;
}
if( aIncrementPadNumbers && new_item )
{
new_item->IncrementItemReference();
}
return new_item;
}
@@ -1220,6 +1219,13 @@ wxString MODULE::GetReferencePrefix() const
}
bool MODULE::IncrementItemReference()
{
// Take the next available module number
return IncrementReference( true );
}
bool MODULE::IncrementReference( bool aFillSequenceGaps )
{
BOARD* board = GetBoard();