Eeschema: fix project rescue bug.

Apparently at some point in our development history, we allowed aliases
to be saved in the cache library.  The rescue code was only looking for
root symbols in the cache library which caused missing symbol rescues.
Flattening the symbols ensures the rescue library will have a unique
symbol for every symbol in the schematic.  This bug also was in play
when rescuing from the symbol library table.

Fixes https://gitlab.com/kicad/code/kicad/issues/4494
This commit is contained in:
Wayne Stambaugh 2020-05-21 08:02:45 -04:00
parent 98be50883d
commit a02f4cc7e4
1 changed files with 7 additions and 7 deletions

View File

@ -316,9 +316,9 @@ bool RESCUE_CACHE_CANDIDATE::PerformAction( RESCUER* aRescuer )
wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." );
LIB_PART new_part( *tmp );
new_part.SetName( m_new_name );
aRescuer->AddPart( &new_part );
std::unique_ptr<LIB_PART> new_part = tmp->Flatten();
new_part->SetName( m_new_name );
aRescuer->AddPart( new_part.get() );
for( SCH_COMPONENT* each_component : *aRescuer->GetComponents() )
{
@ -477,10 +477,10 @@ 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() );
aRescuer->AddPart( &new_part );
std::unique_ptr<LIB_PART> new_part = tmp->Flatten();
new_part->SetLibId( m_new_id );
new_part->SetName( m_new_id.GetLibItemName() );
aRescuer->AddPart( new_part.get() );
for( SCH_COMPONENT* each_component : *aRescuer->GetComponents() )
{