From 046e73ecacfbefb0d32acd2fb1a839d36acb1a93 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 7 May 2018 22:17:20 +0200 Subject: [PATCH] Clear the source DLIST when pasting items to a BOARD Fixes the assert triggering when items already belonging to a list are added to another one. --- pcbnew/tools/pcbnew_control.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 495bb8051d..9340f3d461 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -929,7 +929,7 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard ) { std::vector items; - for( auto track : aBoard->Tracks() ) + while( auto track = aBoard->m_Track.PopBack() ) { if( track->GetFlags() & FLAG0 ) track->ClearFlags( FLAG0 ); @@ -937,7 +937,7 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard ) items.push_back( track ); } - for( auto module : aBoard->Modules() ) + while( auto module = aBoard->m_Modules.PopBack() ) { if( module->GetFlags() & FLAG0 ) module->ClearFlags( FLAG0 ); @@ -945,7 +945,7 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard ) items.push_back( module ); } - for( auto drawing : aBoard->Drawings() ) + while( auto drawing = aBoard->DrawingsList().PopBack() ) { if( drawing->GetFlags() & FLAG0 ) drawing->ClearFlags( FLAG0 ); @@ -953,7 +953,7 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard ) items.push_back( drawing ); } - for( auto zone : aBoard->Zones() ) + while( auto zone = aBoard->m_Zone.PopBack() ) { if( zone->GetFlags() & FLAG0 ) zone->ClearFlags( FLAG0 );