From b0d7c1a81003633bf0b37672238903132a21c0cc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 27 Nov 2021 12:33:34 +0000 Subject: [PATCH] Don't leave orphaned nets in pads after editing in FPEditor. Fixes https://gitlab.com/kicad/code/kicad/issues/9789 --- pcbnew/dialogs/dialog_exchange_footprints.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 0bf42eb447..bf10795c4c 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -517,13 +517,19 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, { PAD* pad_model = nullptr; - // Skip pad not on a copper layer, because we only want to transfer the net info + // Pads with no copper are never connected to a net if( !pad->IsOnCopperLayer() ) + { + pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); continue; + } // Pads with no numbers are never connected to a net if( pad->GetNumber().IsEmpty() ) + { + pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); continue; + } // Search for a similar pad on a copper layer, to reuse net info PAD* last_pad = nullptr;