From 25b6604fc5b5297d3d1fa8c345431eb9a8e60e1d Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 30 Aug 2018 09:44:27 -0700 Subject: [PATCH] pcbnew: Swap all types of zones when swapping layers This is a 5.0-only commit to implement correct layer swapping. Fixes: lp:1789390 * https://bugs.launchpad.net/kicad/+bug/1789390 --- pcbnew/swap_layers.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index 1a7adbf428..8c16d72183 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -406,14 +407,14 @@ void PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event ) } } - // Change deprecated zones segments, only found in very old boards. - for( TRACK* segm = GetBoard()->m_SegZoneDeprecated; segm; segm = segm->Next() ) + // Change zones + for( auto zone : GetBoard()->Zones() ) { OnModify(); - int jj = segm->GetLayer(); + int jj = zone->GetLayer(); if( new_layer[jj] != NO_CHANGE ) - segm->SetLayer( new_layer[jj] ); + zone->SetLayer( new_layer[jj] ); } // Change other segments.