From 063f26531ca99189e3cfdaef9406bcb68686ae18 Mon Sep 17 00:00:00 2001 From: david-beinder Date: Thu, 6 May 2021 00:31:47 +0200 Subject: [PATCH] Make LIB_PART::GetPins() return data for derived symbols https://gitlab.com/kicad/code/kicad/-/issues/8212 --- eeschema/lib_symbol.cpp | 8 ++++++-- eeschema/tools/ee_inspection_tool.cpp | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index 8e442e119e..41a610b802 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -700,11 +700,15 @@ void LIB_PART::GetPins( LIB_PINS& aList, int aUnit, int aConvert ) const * when m_unit == 0, the body item is common to units * when m_convert == 0, the body item is common to shapes */ - for( const LIB_ITEM& item : m_drawings[ LIB_PIN_T ] ) + + PART_SPTR parent = m_parent.lock(); + const LIB_ITEMS_CONTAINER& drawItems = parent ? parent->m_drawings : m_drawings; + + for( const LIB_ITEM& item : drawItems[LIB_PIN_T] ) { // Unit filtering: if( aUnit && item.m_unit && ( item.m_unit != aUnit ) ) - continue; + continue; // Shape filtering: if( aConvert && item.m_convert && ( item.m_convert != aConvert ) ) diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 94ac501191..0bde80c10b 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -205,10 +205,8 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent ) if( !part ) return 0; - LIB_PINS pinList; - std::unique_ptr flattenedPart = part->Flatten(); - - flattenedPart->GetPins( pinList ); + LIB_PINS pinList; + part->GetPins( pinList ); // Sort pins by pin num, so 2 duplicate pins // (pins with the same number) will be consecutive in list