From dac12a6d99e696af1ea9fff3ab71d6a39a7dbdab Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 3 Apr 2020 16:34:37 +0200 Subject: [PATCH] Eeschema: SCH_COMPONENT::Visit(): do not select LIB_PIN* pins not related to the current selected unit and convert. Fixes #4152 https://gitlab.com/kicad/code/kicad/issues/4152 --- eeschema/sch_component.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index b6bc8feae5..d887341dc4 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1553,6 +1553,17 @@ SEARCH_RESULT SCH_COMPONENT::Visit( INSPECTOR aInspector, void* aTestData, { for( auto& pin : m_pins ) { + // Collect only pins attached to the current unit and convert. + // others are not associated to this component instance + int pin_unit = pin.get()->GetLibPin()->GetUnit(); + int pin_convert = pin.get()->GetLibPin()->GetConvert(); + + if( pin_unit > 0 && pin_unit != GetUnit() ) + continue; + + if( pin_convert > 0 && pin_convert != GetConvert() ) + continue; + if( SEARCH_RESULT::QUIT == aInspector( pin.get(), (void*) this ) ) return SEARCH_RESULT::QUIT; }