From 17b3b8f30db0d220c1a971932463ca2ff9b81d45 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 22 Apr 2019 22:04:46 +0100 Subject: [PATCH] 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 --- eeschema/sch_component.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 6039f5aa43..3c5162675f 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -170,14 +170,14 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) : m_Fields = aComponent.m_Fields; // 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 ); m_pins = aComponent.m_pins; m_pinMap.clear(); // Re-parent the pins and build the pinMap - for( SCH_PIN pin : m_pins ) + for( SCH_PIN& pin : m_pins ) { pin.SetParent( this ); 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 // Reparent fields after assignment to new component. - for( SCH_FIELD field : m_Fields ) + for( SCH_FIELD& field : m_Fields ) field.SetParent( this ); m_pins = c->m_pins; // std::vector's assignment operator m_pinMap.clear(); // Re-parent the pins and build the pinMap - for( SCH_PIN pin : m_pins ) + for( SCH_PIN& pin : m_pins ) { pin.SetParent( this ); m_pinMap[ pin.GetLibPin() ] = &pin;