From bcaa15e54c2146ac2c846bf3ee7f74b2266a2ecf Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 12 Dec 2019 12:59:01 -0500 Subject: [PATCH] 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 --- eeschema/sch_component.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index e5d457b102..421c48d398 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -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 );