diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 583d7db375..ba5606c045 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -1138,20 +1138,14 @@ void BOARD::RemoveAll( std::initializer_list aTypes ) { std::vector removed; - if( aTypes.size() == 1 && *aTypes.begin() == TYPE_NOT_INIT ) - { - aTypes = { - PCB_NETINFO_T, PCB_MARKER_T, PCB_GROUP_T, PCB_ZONE_T, PCB_GENERATOR_T, PCB_FOOTPRINT_T, - PCB_TRACE_T, PCB_SHAPE_T - }; - } - for( const KICAD_T& type : aTypes ) { switch( type ) { case PCB_NETINFO_T: - std::copy( m_NetInfo.begin(), m_NetInfo.end(), std::back_inserter( removed ) ); + for( NETINFO_ITEM* item : m_NetInfo ) + removed.emplace_back( item ); + m_NetInfo.clear(); break; diff --git a/pcbnew/board.h b/pcbnew/board.h index f636fb725b..1af148e44d 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -390,7 +390,10 @@ public: * granular than that, use BOARD::Remove. * @param aTypes is a list of one or more types to remove, or leave default to remove all */ - void RemoveAll( std::initializer_list aTypes = { TYPE_NOT_INIT } ); + void RemoveAll( std::initializer_list aTypes = { PCB_NETINFO_T, PCB_MARKER_T, + PCB_GROUP_T, PCB_ZONE_T, + PCB_GENERATOR_T, PCB_FOOTPRINT_T, + PCB_TRACE_T, PCB_SHAPE_T } ); /** * Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 423e0b399f..b7db2ec379 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -849,7 +849,6 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) wxT( " • " ) + rcItem->GetErrorText() ); BOARD* board = m_frame->GetBoard(); - const std::vector& markers = board->Markers(); std::vector toRemove;