diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index 7fcf81efdd..701c4729ff 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -83,7 +83,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected ) ( i->Type() != PCB_PAD_T ) ) { onlyModuleParts = false; - continue; + break; } } diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index f679eae3b1..14a066dbcb 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -771,7 +771,7 @@ static void moveNoFlagToVector( std::deque& aList, std::vector& { std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ), [](T aItem){ - bool retval = aItem->GetFlags() & FLAG0; + bool retval = ( aItem->GetFlags() & FLAG0 ) == 0; aItem->ClearFlags( FLAG0 ); return retval; } ); @@ -876,27 +876,19 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) if( !brd ) return 1; - // Mark existing items, in order to know what are the new items - // to be ble to select only the new items after loadind + // Mark existing items, in order to know what are the new items so we can select only + // the new items after loading for( auto track : brd->Tracks() ) - { track->SetFlags( FLAG0 ); - } for( auto module : brd->Modules() ) - { module->SetFlags( FLAG0 ); - } for( auto drawing : brd->Drawings() ) - { drawing->SetFlags( FLAG0 ); - } for( auto zone : brd->Zones() ) - { zone->SetFlags( FLAG0 ); - } // Keep also the count of copper layers, to adjust if necessary int initialCopperLayerCount = brd->GetCopperLayerCount();