From 0bd83d3096e521ccd7a6b827a5dcb3562571baf6 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 29 Mar 2023 16:53:49 +0200 Subject: [PATCH] Footprint viewer: ensure the footprint is updated after new library selection Previously, if the first fp of the new lib has the same name as the old displayed fp, the old fp was not replace by the new fp. --- pcbnew/footprint_viewer_frame.cpp | 3 +++ pcbnew/teardrop/teardrop.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index bbaeb4cd4d..1ed54ad969 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -732,6 +732,9 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& aEvent ) setCurNickname( name ); + // Ensure the displayed footprint is loade/reloaded from the new library + setCurFootprintName( wxEmptyString ); + ReCreateFootprintList(); UpdateTitle(); } diff --git a/pcbnew/teardrop/teardrop.cpp b/pcbnew/teardrop/teardrop.cpp index 6f61b719ca..1f0e1ae78f 100644 --- a/pcbnew/teardrop/teardrop.cpp +++ b/pcbnew/teardrop/teardrop.cpp @@ -301,7 +301,7 @@ int TEARDROP_MANAGER::addTeardropsOnTracks( BOARD_COMMIT* aCommitter ) TEARDROP_PARAMETERS* currParams = m_prmsList->GetParameters( TARGET_TRACK ); // Explore groups (a group is a set of tracks on the same layer and the same net): - for( auto grp : trackLookupList.GetBuffer() ) + for( auto& grp : trackLookupList.GetBuffer() ) { int layer, netcode; TRACK_BUFFER::GetNetcodeAndLayerFromIndex( grp.first, &layer, &netcode );