From 84138d50397cfd03fa646266c60c67c0733e5690 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 14 Aug 2022 23:05:30 +0100 Subject: [PATCH] Fix bug adding netclass in Eeschema. --- common/dialogs/panel_setup_netclasses.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index dc1808d2cc..00ac8b3b1c 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -533,14 +533,17 @@ void PANEL_SETUP_NETCLASSES::OnAddNetclassClick( wxCommandEvent& event ) { for( int col = GRID_FIRST_EESCHEMA; col < GRID_END; col++ ) { - col -= GRID_FIRST_EESCHEMA; - m_netclassGrid->SetCellValue( row, col, m_netclassGrid->GetCellValue( 0, col ) ); + wxString defaultValue = m_netclassGrid->GetCellValue( 0, col - EESCHEMA_COL_OFFSET ); + m_netclassGrid->SetCellValue( row, col - EESCHEMA_COL_OFFSET, defaultValue ); } } else { for( int col = GRID_FIRST_PCBNEW; col < GRID_FIRST_EESCHEMA; col++ ) - m_netclassGrid->SetCellValue( row, col, m_netclassGrid->GetCellValue( 0, col ) ); + { + wxString defaultValue = m_netclassGrid->GetCellValue( 0, col ); + m_netclassGrid->SetCellValue( row, col, defaultValue ); + } } m_netclassGrid->MakeCellVisible( row, 0 );