Resolve un-set template fieldnames to empty string.

Fixes https://gitlab.com/kicad/code/kicad/issues/8699
This commit is contained in:
Jeff Young 2021-06-30 12:23:01 +01:00
parent 5cac8afe1d
commit 2aa2493472
1 changed files with 13 additions and 0 deletions

View File

@ -961,6 +961,19 @@ bool SCH_SYMBOL::ResolveTextVar( wxString* token, int aDepth ) const
}
}
for( const TEMPLATE_FIELDNAME& templateFieldname :
schematic->Settings().m_TemplateFieldNames.GetTemplateFieldNames() )
{
if( token->IsSameAs( templateFieldname.m_Name )
|| token->IsSameAs( templateFieldname.m_Name.Upper() ) )
{
// If we didn't find it in the fields list then it isn't set on this symbol.
// Just return an empty string.
*token = wxEmptyString;
return true;
}
}
if( token->IsSameAs( wxT( "FOOTPRINT_LIBRARY" ) ) )
{
wxString footprint;