From 1e52f0a180f78885cd9ab1c69c98d86200d90c3d Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 18 Apr 2021 21:53:38 -0400 Subject: [PATCH] Make sure pasted symbols get new pin UUIDs Fixes https://gitlab.com/kicad/code/kicad/-/issues/8218 --- eeschema/class_library.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 1d00a366c2..22ef432086 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -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 { diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 0c982937ab..3b9fc4c353 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -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( pin->m_Uuid ) = KIID(); } if( item->Type() == SCH_SHEET_T )