sch legacy plugin: fix a compatibility issue with old schematic files

This commit is contained in:
jean-pierre charras 2016-12-29 19:38:31 +01:00
parent 6078ca85e5
commit a5178c70db
1 changed files with 16 additions and 13 deletions

View File

@ -1358,6 +1358,8 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( FILE_LINE_READER& aReader )
"B, T, or C" ), aReader, line );
// Newer file formats include the bold and italics text attribute.
if( textAttrs.Length() > 1 )
{
if( textAttrs.Length() != 3 )
SCH_PARSE_ERROR( _( "component field text attributes must be 3 characters wide" ),
aReader, line );
@ -1374,6 +1376,7 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( FILE_LINE_READER& aReader )
SCH_PARSE_ERROR( _( "component field text bold indicator must be B or N" ),
aReader, line );
}
}
component->GetField( index )->SetText( text );
component->GetField( index )->SetTextPosition( pos );