Symbol Fields Table: make sure power symbols don't get added by commits

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17544
This commit is contained in:
Mike Williams 2024-05-20 14:11:38 -04:00
parent a81891053e
commit 52f9060b3b
1 changed files with 8 additions and 0 deletions

View File

@ -2220,6 +2220,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSchItemsAdded( SCHEMATIC& aSch,
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
// Don't add power symbols
if( !symbol->IsMissingLibSymbol() && symbol->IsPower() )
continue;
// Add all fields again in case this symbol has a new one
for( SCH_FIELD& field : symbol->GetFields() )
AddField( field.GetCanonicalName(), field.GetName(), true, false, true );
@ -2287,6 +2291,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSchItemsChanged( SCHEMATIC& aSch
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
// Don't add power symbols
if( !symbol->IsMissingLibSymbol() && symbol->IsPower() )
continue;
// Add all fields again in case this symbol has a new one
for( SCH_FIELD& field : symbol->GetFields() )
AddField( field.GetCanonicalName(), field.GetName(), true, false, true );