Resolve un-set template fieldnames to empty string.
Fixes https://gitlab.com/kicad/code/kicad/issues/8699
This commit is contained in:
parent
5cac8afe1d
commit
2aa2493472
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue