Dirty symbols when modified.

Also show changes in library tree and canvas when
"Apply" button is clicked.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21659
This commit is contained in:
Jeff Young
2025-09-07 13:49:59 +01:00
parent 963ec84587
commit fef84a2c6a
2 changed files with 30 additions and 19 deletions
+4 -2
View File
@@ -931,8 +931,6 @@ void LIB_FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData( std::function<void( LIB_SYMBO
{
for( LIB_SYMBOL* symbol : m_symbolsList )
{
symbolChangeHandler( symbol );
std::map<wxString, LIB_DATA_ELEMENT>& fieldStore = m_dataStore[symbol->m_Uuid];
for( auto& srcData : fieldStore )
@@ -942,6 +940,9 @@ void LIB_FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData( std::function<void( LIB_SYMBO
const wxString& srcValue = dataElement.m_currentData;
int col = GetFieldNameCol( srcName );
if( dataElement.m_isModified )
symbolChangeHandler( symbol );
// Attributes bypass the field logic, so handle them first
if( col != -1 && ColIsCheck( col ) )
{
@@ -1022,6 +1023,7 @@ void LIB_FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData( std::function<void( LIB_SYMBO
// Remove any fields that are not in the fieldStore
if( !fieldStore.contains( field->GetName() ) )
{
symbolChangeHandler( symbol );
symbol->RemoveField( field );
delete field;
}