Prevent duplicate sheetnames when using mouse copy

This commit is contained in:
Seth Hillbrand 2018-04-17 12:01:03 -07:00
parent ca544eb138
commit 853f73e6b7
1 changed files with 6 additions and 1 deletions

View File

@ -264,7 +264,12 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
case SCH_SHEET_T:
{
SCH_SHEET* sheet = (SCH_SHEET*) newitem;
sheet->SetTimeStamp( GetNewTimeStamp() );
// Duplicate sheet names and sheet time stamps are not valid. Use a time stamp
// based sheet name and update the time stamp for each sheet in the block.
timestamp_t timeStamp = GetNewTimeStamp();
sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)timeStamp ) );
sheet->SetTimeStamp( timeStamp );
break;
}