Eeschema: Fix incorrect parsing of old schematic files (version 2) for HLabels and GLabels
This commit is contained in:
parent
9eec296b0a
commit
b7b125d83c
|
@ -1363,13 +1363,17 @@ SCH_TEXT* SCH_LEGACY_PLUGIN::loadText( FILE_LINE_READER& aReader )
|
||||||
|
|
||||||
int thickness = 0;
|
int thickness = 0;
|
||||||
|
|
||||||
// The following tokens do not exist in version 1 schematic files.
|
// The following tokens do not exist in version 1 schematic files,
|
||||||
|
// and not always in version 2 for HLabels and GLabels
|
||||||
if( m_version > 1 )
|
if( m_version > 1 )
|
||||||
{
|
{
|
||||||
if( strCompare( "Italic", line, &line ) )
|
if( m_version > 2 || *line >= ' ' )
|
||||||
text->SetItalic( true );
|
{
|
||||||
else if( !strCompare( "~", line, &line ) )
|
if( strCompare( "Italic", line, &line ) )
|
||||||
SCH_PARSE_ERROR( _( "expected 'Italics' or '~'" ), aReader, line );
|
text->SetItalic( true );
|
||||||
|
else if( !strCompare( "~", line, &line ) )
|
||||||
|
SCH_PARSE_ERROR( _( "expected 'Italics' or '~'" ), aReader, line );
|
||||||
|
}
|
||||||
|
|
||||||
// The thickness token does not exist in older versions of the schematic file format
|
// The thickness token does not exist in older versions of the schematic file format
|
||||||
// so calling parseInt will be made only if the EOL is not reached.
|
// so calling parseInt will be made only if the EOL is not reached.
|
||||||
|
|
Loading…
Reference in New Issue