From 2eb96279a2238eeba47d8d51735ef90254a97697 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sat, 10 Apr 2021 19:11:28 +0100 Subject: [PATCH] Fix FOOTPRINT copy constructor so it maintains ordering of containers --- pcbnew/footprint.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 54e96ed8bb..3d83b296e1 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -123,7 +123,7 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) : { PAD* newPad = static_cast( pad->Clone() ); ptrMap[ pad ] = newPad; - Add( newPad ); + Add( newPad, ADD_MODE::APPEND ); // Append to ensure indexes are identical } // Copy zones @@ -131,7 +131,7 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) : { FP_ZONE* newZone = static_cast( zone->Clone() ); ptrMap[ zone ] = newZone; - Add( newZone ); + Add( newZone, ADD_MODE::APPEND ); // Append to ensure indexes are identical // Ensure the net info is OK and especially uses the net info list // living in the current board @@ -145,7 +145,7 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) : { BOARD_ITEM* newItem = static_cast( item->Clone() ); ptrMap[ item ] = newItem; - Add( newItem ); + Add( newItem, ADD_MODE::APPEND ); // Append to ensure indexes are identical } // Copy groups @@ -153,7 +153,7 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) : { PCB_GROUP* newGroup = static_cast( group->Clone() ); ptrMap[ group ] = newGroup; - Add( newGroup ); + Add( newGroup, ADD_MODE::APPEND ); // Append to ensure indexes are identical } // Rebuild groups