mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +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,10 +84,13 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RenameColumn( int aCol, const wxString& newN
|
|||||||
{
|
{
|
||||||
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
|
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
|
||||||
|
|
||||||
auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName );
|
// 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;
|
node.key() = newName;
|
||||||
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_cols[aCol].m_fieldName = newName;
|
m_cols[aCol].m_fieldName = newName;
|
||||||
m_cols[aCol].m_label = newName;
|
m_cols[aCol].m_label = newName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user