diff --git a/common/tool/selection.cpp b/common/tool/selection.cpp index d44360a1d0..535d8030a0 100644 --- a/common/tool/selection.cpp +++ b/common/tool/selection.cpp @@ -135,7 +135,7 @@ bool SELECTION::HasType( KICAD_T aType ) const { for( const EDA_ITEM* item : m_items ) { - if( item->Type() == aType ) + if( item->IsType( { aType } ) ) return true; } @@ -149,7 +149,7 @@ size_t SELECTION::CountType( KICAD_T aType ) const for( const EDA_ITEM* item : m_items ) { - if( item->Type() == aType ) + if( item->IsType( { aType } ) ) count++; } @@ -183,18 +183,7 @@ bool SELECTION::OnlyContains( std::vector aList ) const return ( std::all_of( m_items.begin(), m_items.end(), [&]( const EDA_ITEM* r ) { - bool ok = false; - - for( const KICAD_T& type : aList ) - { - if( r->Type() == type ) - { - ok = true; - break; - } - } - - return ok; + return r->IsType( aList ); } ) ); }