Browse Source

Don't attempt to rename field more than once.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18330

(cherry picked from commit e9d376c912)
8.0
Jeff Young 1 year ago
parent
commit
24c234fd93
  1. 9
      eeschema/fields_data_model.cpp

9
eeschema/fields_data_model.cpp

@ -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…
Cancel
Save