diff --git a/pcbnew/connectivity.cpp b/pcbnew/connectivity.cpp index b1e510a30b..d8d08304ae 100644 --- a/pcbnew/connectivity.cpp +++ b/pcbnew/connectivity.cpp @@ -344,11 +344,23 @@ const std::list CONNECTIVITY_DATA::GetNetItems( int aNetC std::set items; std::list rv; - // fixme: apply aTypes - - m_connAlgo->ForEachItem( [&items, aNetCode] ( CN_ITEM* aItem ) { + m_connAlgo->ForEachItem( [&items, aNetCode, &aTypes] ( CN_ITEM* aItem ) + { if( aItem->Net() == aNetCode ) - items.insert( aItem->Parent() ); + { + KICAD_T itemType = aItem->Parent()->Type(); + + for( int i = 0; aTypes[i] > 0; ++i ) + { + wxASSERT( aTypes[i] < MAX_STRUCT_TYPE_ID ); + + if( itemType == aTypes[i] ) + { + items.insert( aItem->Parent() ); + break; + } + } + } } ); std::copy( items.begin(), items.end(), std::front_inserter( rv ) );