Make sure pasted symbols get new pin UUIDs

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8218
This commit is contained in:
Jon Evans 2021-04-18 21:53:38 -04:00
parent dd828bd964
commit 1e52f0a180
2 changed files with 5 additions and 1 deletions

View File

@ -565,7 +565,7 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
wxString cache_name = CacheName( aProject->GetProjectFullName() );
PART_LIB* cache_lib;
if( !cache_name.IsEmpty() )
if( !aProject->IsNullProject() && !cache_name.IsEmpty() )
{
try
{

View File

@ -1466,6 +1466,10 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
symbol->ClearAnnotation( nullptr );
symbol->SetUnit( unit );
}
// Make sure pins get a new UUID
for( SCH_PIN* pin : symbol->GetPins() )
const_cast<KIID&>( pin->m_Uuid ) = KIID();
}
if( item->Type() == SCH_SHEET_T )