diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 31ef736eb5..434af86282 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -1203,15 +1203,6 @@ void LIB_PART::SetConversion( bool aSetConvert ) } -void LIB_PART::SetLib( PART_LIB* aLibrary ) -{ - m_library = aLibrary; - - if( aLibrary ) - m_libId.SetLibNickname( aLibrary->GetName() ); -} - - wxArrayString LIB_PART::GetAliasNames( bool aIncludeRoot ) const { wxArrayString names; diff --git a/eeschema/class_libentry.h b/eeschema/class_libentry.h index 37215f6f7f..af546123e6 100644 --- a/eeschema/class_libentry.h +++ b/eeschema/class_libentry.h @@ -265,12 +265,13 @@ public: const wxString& GetName() const; const LIB_ID& GetLibId() const { return m_libId; } + void SetLibId( const LIB_ID& aLibId ) { m_libId = aLibId; } const wxString GetLibraryName(); PART_LIB* GetLib() { return m_library; } - void SetLib( PART_LIB* aLibrary ); + void SetLib( PART_LIB* aLibrary ) { m_library = aLibrary; } wxArrayString GetAliasNames( bool aIncludeRoot = true ) const; diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index 0e78f98195..9bd8a7f2b9 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -437,6 +437,7 @@ bool RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction( RESCUER* aRescuer ) wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." ); LIB_PART new_part( *tmp ); + new_part.SetLibId( m_new_id ); new_part.SetName( m_new_id.GetLibItemName() ); new_part.RemoveAllAliases(); aRescuer->AddPart( &new_part ); diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index 19aa0f6553..5b5d88a25a 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -2515,6 +2515,9 @@ LIB_PART* SCH_LEGACY_PLUGIN_CACHE::loadPart( FILE_LINE_READER& aReader ) part->GetValueField().SetVisible( false ); } + // Don't set the library alias, this is determined by the symbol library table. + part->SetLibId( LIB_ID( wxEmptyString, part->GetName() ) ); + // There are some code paths in SetText() that do not set the root alias to the // alias list so add it here if it didn't get added by SetText(). if( !part->HasAlias( part->GetName() ) )