mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Don't attempt to rename field more than once.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18330
This commit is contained in:
parent
1f18cc8e0e
commit
e9d376c912
@ -84,9 +84,12 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RenameColumn( int aCol, const wxString& newN
|
||||
{
|
||||
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
|
||||
|
||||
auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName );
|
||||
node.key() = newName;
|
||||
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
||||
// Careful; field may have already been renamed from another sheet instance
|
||||
if( auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName ) )
|
||||
{
|
||||
node.key() = newName;
|
||||
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
||||
}
|
||||
}
|
||||
|
||||
m_cols[aCol].m_fieldName = newName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user