Tighter control over lambda capture.

This commit is contained in:
Jeff Young 2022-09-12 20:51:15 +01:00
parent eaccd40c75
commit c2643f53cf
1 changed files with 4 additions and 3 deletions

View File

@ -1490,16 +1490,17 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
canvas()->ForceRefresh(); canvas()->ForceRefresh();
DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(), DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(),
[&]( const std::vector<wxString>& aNetNames ) [this]( const std::vector<wxString>& aNetNames )
{ {
selectionTool->ClearSelection(); PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
selTool->ClearSelection();
for( const wxString& curr_netName : aNetNames ) for( const wxString& curr_netName : aNetNames )
{ {
int curr_netCode = board()->GetNetInfo().GetNetItem( curr_netName )->GetNetCode(); int curr_netCode = board()->GetNetInfo().GetNetItem( curr_netName )->GetNetCode();
if( curr_netCode > 0 ) if( curr_netCode > 0 )
selectionTool->SelectAllItemsOnNet( curr_netCode ); selTool->SelectAllItemsOnNet( curr_netCode );
} }
canvas()->ForceRefresh(); canvas()->ForceRefresh();