Eeschema: fix yet another symbol inheritance crash.

The schematic symbol swap function still had the old pin map swapping
code which overwrote the correct pin maps that were rebuild after the
library symbol was update.  Duh!

Fixes kicad/code/kicad#3661
This commit is contained in:
Wayne Stambaugh 2019-12-12 12:59:01 -05:00
parent a18d7a8495
commit bcaa15e54c
1 changed files with 0 additions and 18 deletions

View File

@ -997,27 +997,9 @@ void SCH_COMPONENT::SwapData( SCH_ITEM* aItem )
std::swap( m_Pos, component->m_Pos );
std::swap( m_unit, component->m_unit );
std::swap( m_convert, component->m_convert );
std::swap( m_pins, component->m_pins );
m_pinMap.clear();
component->m_pinMap.clear();
m_Fields.swap( component->m_Fields ); // std::vector's swap()
// Reparent items after copying data
// (after swap(), m_Parent member does not point to the right parent):
for( unsigned i = 0; i < m_pins.size(); ++i )
{
m_pins[ i ].SetParent( this );
m_pinMap[ m_pins[ i ].GetLibPin() ] = i;
}
for( unsigned i = 0; i < component->m_pins.size(); ++i )
{
component->m_pins[ i ].SetParent( component );
component->m_pinMap[ component->m_pins[ i ].GetLibPin() ] = i;
}
for( int ii = 0; ii < component->GetFieldCount(); ++ii )
component->GetField( ii )->SetParent( component );