Don't treat new netclass as changing a netclass name.
In particular, since it goes from empty string to non-empty, the oldName comparison will cause it to pick up all unassigned nets. Fixes https://gitlab.com/kicad/code/kicad/issues/4922
This commit is contained in:
parent
a25f7cc0a4
commit
49d242944d
|
@ -309,6 +309,7 @@ void PANEL_SETUP_NETCLASSES::rebuildNetclassDropdowns()
|
||||||
for( int ii = 0; ii < m_netclassGrid->GetNumberRows(); ii++ )
|
for( int ii = 0; ii < m_netclassGrid->GetNumberRows(); ii++ )
|
||||||
{
|
{
|
||||||
wxString netclassName = m_netclassGrid->GetCellValue( ii, GRID_NAME );
|
wxString netclassName = m_netclassGrid->GetCellValue( ii, GRID_NAME );
|
||||||
|
|
||||||
if( !netclassName.IsEmpty() )
|
if( !netclassName.IsEmpty() )
|
||||||
netclassNames.push_back( netclassName );
|
netclassNames.push_back( netclassName );
|
||||||
}
|
}
|
||||||
|
@ -421,17 +422,22 @@ void PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging( wxGridEvent& event )
|
||||||
wxString oldName = m_netclassGrid->GetCellValue( event.GetRow(), GRID_NAME );
|
wxString oldName = m_netclassGrid->GetCellValue( event.GetRow(), GRID_NAME );
|
||||||
wxString newName = event.GetString();
|
wxString newName = event.GetString();
|
||||||
|
|
||||||
|
if( !oldName.IsEmpty() )
|
||||||
|
{
|
||||||
for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
|
for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
|
||||||
{
|
{
|
||||||
if( m_membershipGrid->GetCellValue( row, 1 ) == oldName )
|
if( m_membershipGrid->GetCellValue( row, 1 ) == oldName )
|
||||||
m_membershipGrid->SetCellValue( row, 1, newName );
|
m_membershipGrid->SetCellValue( row, 1, newName );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_netclassesDirty = true;
|
m_netclassesDirty = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
event.Veto();
|
event.Veto();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue