eeschema: preserve unit number after pasting a component

Fixes: lp:1757373
* https://bugs.launchpad.net/kicad/+bug/1757373
This commit is contained in:
Maciej Suminski 2018-03-22 10:55:32 +01:00
parent a931ac436a
commit 351fc0c343
1 changed files with 7 additions and 2 deletions

View File

@ -528,8 +528,13 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
// Clear annotation and init new time stamp for the new components and sheets:
if( item->Type() == SCH_COMPONENT_T )
{
( (SCH_COMPONENT*) item )->SetTimeStamp( GetNewTimeStamp() );
( (SCH_COMPONENT*) item )->ClearAnnotation( NULL );
SCH_COMPONENT* cmp = static_cast<SCH_COMPONENT*>( item );
cmp->SetTimeStamp( GetNewTimeStamp() );
// clear the annotation, but preserve the selected unit
int unit = cmp->GetUnit();
cmp->ClearAnnotation( NULL );
cmp->SetUnit( unit );
}
else if( item->Type() == SCH_SHEET_T )
{