From 94e8855c139835fa82949038a865af62355d580b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 13 Apr 2021 13:43:02 +0100 Subject: [PATCH] Generate changed message before making change. Otherwise we've lost the "before" value. Fixes https://gitlab.com/kicad/code/kicad/issues/8186 --- .../netlist_reader/board_netlist_updater.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index 21f4fcd3a3..d4a9cf541c 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -268,12 +268,12 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint, } else { - changed = true; - aPcbFootprint->SetReference( aNetlistComponent->GetReference() ); - msg.Printf( _( "Changed %s reference designator to %s." ), aPcbFootprint->GetReference(), aNetlistComponent->GetReference() ); + + changed = true; + aPcbFootprint->SetReference( aNetlistComponent->GetReference() ); } m_reporter->Report( msg, RPT_SEVERITY_ACTION ); @@ -291,13 +291,13 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint, } else { - changed = true; - aPcbFootprint->SetValue( aNetlistComponent->GetValue() ); - msg.Printf( _( "Changed %s value from %s to %s." ), aPcbFootprint->GetReference(), aPcbFootprint->GetValue(), aNetlistComponent->GetValue() ); + + changed = true; + aPcbFootprint->SetValue( aNetlistComponent->GetValue() ); } m_reporter->Report( msg, RPT_SEVERITY_ACTION ); @@ -318,13 +318,13 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint, } else { - changed = true; - aPcbFootprint->SetPath( new_path ); - msg.Printf( _( "Updated %s symbol association from %s to %s." ), aPcbFootprint->GetReference(), aPcbFootprint->GetPath().AsString(), new_path.AsString() ); + + changed = true; + aPcbFootprint->SetPath( new_path ); } m_reporter->Report( msg, RPT_SEVERITY_ACTION ); @@ -339,11 +339,11 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint, } else { - changed = true; - aPcbFootprint->SetProperties( aNetlistComponent->GetProperties() ); - msg.Printf( _( "Updated %s properties." ), aPcbFootprint->GetReference() ); + + changed = true; + aPcbFootprint->SetProperties( aNetlistComponent->GetProperties() ); } m_reporter->Report( msg, RPT_SEVERITY_ACTION );