Make LIB_PART::GetPins() return data for derived symbols

https://gitlab.com/kicad/code/kicad/-/issues/8212
This commit is contained in:
david-beinder 2021-05-06 00:31:47 +02:00 committed by Jeff Young
parent 49d02560e4
commit 063f26531c
2 changed files with 8 additions and 6 deletions

View File

@ -700,7 +700,11 @@ 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 ) )

View File

@ -206,9 +206,7 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
return 0;
LIB_PINS pinList;
std::unique_ptr<LIB_PART> flattenedPart = part->Flatten();
flattenedPart->GetPins( pinList );
part->GetPins( pinList );
// Sort pins by pin num, so 2 duplicate pins
// (pins with the same number) will be consecutive in list