Eeschema: fix new symbol library file format parser bug.

LIB_FIELD objects require a LIB_PART as a parent.  Add missing parent on
symbol library load.

Fixes https://gitlab.com/kicad/code/kicad/issues/4360
This commit is contained in:
Wayne Stambaugh 2020-05-08 13:33:41 -04:00
parent 302646cb3c
commit 62d72ae081
2 changed files with 5 additions and 2 deletions

View File

@ -303,7 +303,9 @@ wxString LIB_FIELD::GetFullText( int unit ) const
wxString text = GetText();
text << wxT( "?" );
if( GetParent() && GetParent()->IsMulti() )
wxCHECK( GetParent(), text );
if( GetParent()->IsMulti() )
text << LIB_PART::SubReference( unit );
return text;

View File

@ -690,11 +690,12 @@ void SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_PART>& aSymbol )
wxCHECK_RET( CurTok() == T_property,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) +
wxT( " as a property token." ) );
wxCHECK( aSymbol, /* void */ );
wxString error;
wxString name;
wxString value;
std::unique_ptr<LIB_FIELD> field( new LIB_FIELD( MANDATORY_FIELDS ) );
std::unique_ptr<LIB_FIELD> field( new LIB_FIELD( aSymbol.get(), MANDATORY_FIELDS ) );
T token = NextTok();