sch legacy plugin: fix compatibility with old and very old library and symbol files

This commit is contained in:
jean-pierre charras 2016-11-21 09:56:44 +01:00
parent 64c892ee23
commit 308dc0e46a
1 changed files with 11 additions and 2 deletions

View File

@ -2117,7 +2117,12 @@ void SCH_LEGACY_PLUGIN_CACHE::Load()
const char* line = reader.Line();
if( !strCompare( "EESchema-LIBRARY Version", line, &line ) )
{
// Old .sym files (which are libraries with only one symbol, used to store and reuse shapes)
// EESchema-LIB Version x.x SYMBOL. They are valid files.
if( !strCompare( "EESchema-LIB Version", line, &line ) )
SCH_PARSE_ERROR( "file is not a valid component or symbol library file", reader, line );
}
m_versionMajor = parseInt( reader, line, &line );
@ -2735,6 +2740,10 @@ LIB_ARC* SCH_LEGACY_PLUGIN_CACHE::loadArc( std::unique_ptr< LIB_PART >& aPart,
arc->SetUnit( parseInt( aReader, line, &line ) );
arc->SetConvert( parseInt( aReader, line, &line ) );
arc->SetWidth( parseInt( aReader, line, &line ) );
// Old libraries (version <= 2.2) do not have always this FILL MODE param
// when fill mode is no fill (default mode).
if( *line != 0 )
arc->SetFillMode( parseFillMode( aReader, line, &line ) );
// Actual Coordinates of arc ends are read from file