Browse Source

Ignore empty field-name-templates.

Fixes https://gitlab.com/kicad/code/kicad/issues/14552
newinvert
Jeff Young 3 years ago
parent
commit
2c34a08bf1
  1. 8
      common/template_fieldnames.cpp
  2. 5
      eeschema/dialogs/panel_template_fieldnames.cpp

8
common/template_fieldnames.cpp

@ -134,7 +134,10 @@ void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel, bool aGlobal ) cons
const TEMPLATE_FIELDNAMES& source = aGlobal ? m_globals : m_project;
for( const TEMPLATE_FIELDNAME& temp : source )
temp.Format( out, nestLevel+1 );
{
if( !temp.m_Name.IsEmpty() )
temp.Format( out, nestLevel+1 );
}
out->Print( 0, ")\n" );
}
@ -167,7 +170,8 @@ void TEMPLATES::parse( TEMPLATE_FIELDNAMES_LEXER* in, bool aGlobal )
field.Parse( in );
// add the field
AddTemplateFieldName( field, aGlobal );
if( !field.m_Name.IsEmpty() )
AddTemplateFieldName( field, aGlobal );
}
break;

5
eeschema/dialogs/panel_template_fieldnames.cpp

@ -185,7 +185,10 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow()
m_templateMgr->DeleteAllFieldNameTemplates( m_global );
for( const TEMPLATE_FIELDNAME& field : m_fields )
m_templateMgr->AddTemplateFieldName( field, m_global );
{
if( !field.m_Name.IsEmpty() )
m_templateMgr->AddTemplateFieldName( field, m_global );
}
if( m_global )
{

Loading…
Cancel
Save