Fix wandering text problem.

Setting a variable on a temp copy doesn't do much of use.

Fixes: lp:1825853
* https://bugs.launchpad.net/kicad/+bug/1825853
This commit is contained in:
Jeff Young 2019-04-22 22:04:46 +01:00
parent 5e2cf51309
commit 17b3b8f30d
1 changed files with 4 additions and 4 deletions

View File

@ -170,14 +170,14 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) :
m_Fields = aComponent.m_Fields; m_Fields = aComponent.m_Fields;
// Re-parent the fields, which before this had aComponent as parent // Re-parent the fields, which before this had aComponent as parent
for( SCH_FIELD field : m_Fields ) for( SCH_FIELD& field : m_Fields )
field.SetParent( this ); field.SetParent( this );
m_pins = aComponent.m_pins; m_pins = aComponent.m_pins;
m_pinMap.clear(); m_pinMap.clear();
// Re-parent the pins and build the pinMap // Re-parent the pins and build the pinMap
for( SCH_PIN pin : m_pins ) for( SCH_PIN& pin : m_pins )
{ {
pin.SetParent( this ); pin.SetParent( this );
m_pinMap[ pin.GetLibPin() ] = &pin; m_pinMap[ pin.GetLibPin() ] = &pin;
@ -1752,14 +1752,14 @@ SCH_ITEM& SCH_COMPONENT::operator=( const SCH_ITEM& aItem )
m_Fields = c->m_Fields; // std::vector's assignment operator m_Fields = c->m_Fields; // std::vector's assignment operator
// Reparent fields after assignment to new component. // Reparent fields after assignment to new component.
for( SCH_FIELD field : m_Fields ) for( SCH_FIELD& field : m_Fields )
field.SetParent( this ); field.SetParent( this );
m_pins = c->m_pins; // std::vector's assignment operator m_pins = c->m_pins; // std::vector's assignment operator
m_pinMap.clear(); m_pinMap.clear();
// Re-parent the pins and build the pinMap // Re-parent the pins and build the pinMap
for( SCH_PIN pin : m_pins ) for( SCH_PIN& pin : m_pins )
{ {
pin.SetParent( this ); pin.SetParent( this );
m_pinMap[ pin.GetLibPin() ] = &pin; m_pinMap[ pin.GetLibPin() ] = &pin;