From dffdf04cd9728f5bd63acce0e092f39dc05ddfad Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 10 May 2018 12:14:54 +0100 Subject: [PATCH] Update footprint value when it's a proxy for FPID. Fixes: lp:1769207 * https://bugs.launchpad.net/kicad/+bug/1769207 --- pcbnew/dialogs/dialog_exchange_footprints.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index a82bd0f5e6..2f6464faf5 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -473,9 +473,13 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule, // but not local settings like clearances (use library values) aOldModule->CopyNetlistSettings( aNewModule, false ); - // Copy reference and value + // Copy reference aNewModule->SetReference( aOldModule->GetReference() ); - aNewModule->SetValue( aOldModule->GetValue() ); + + // Copy value unless it is a proxy for the footprint ID (a good example is replacing a + // footprint with value "MoutingHole-2.5mm" with one of value "MountingHole-4mm"). + if( aOldModule->GetValue() != aOldModule->GetFPID().GetLibItemName() ) + aNewModule->SetValue( aOldModule->GetValue() ); // Compare the footprint name only, in case the nickname is empty or in case // user moved the footprint to a new library. Chances are if footprint name is