Fix eeschema crashes when a library has a component where the name under "DEF" does not agree with the name under "F1"
(now "F1" is forced to name given by "DEF", like in stable version) Fix also an incorrect parsing of .dcm file, if a component was not found in corresponding symbol lib. (Can happen for not updated .dcm files)
This commit is contained in:
parent
a0df0f7f06
commit
94037f4d3d
|
@ -2266,8 +2266,9 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
|||
else
|
||||
alias = it->second;
|
||||
|
||||
if( alias )
|
||||
{
|
||||
// Read the curent alias associated doc.
|
||||
// if the alias does not exist, just skip the description
|
||||
// (Can happen if a .dcm is not synchronized with the corresponding .lib file)
|
||||
while( reader.ReadLine() )
|
||||
{
|
||||
line = reader.Line();
|
||||
|
@ -2284,14 +2285,17 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
|||
switch( line[0] )
|
||||
{
|
||||
case 'D':
|
||||
if( alias )
|
||||
alias->SetDescription( text );
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
if( alias )
|
||||
alias->SetKeyWords( text );
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
if( alias )
|
||||
alias->SetDocFileName( text );
|
||||
break;
|
||||
|
||||
|
@ -2304,7 +2308,6 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN_CACHE::loadHeader( FILE_LINE_READER& aReader )
|
||||
|
@ -2647,8 +2650,10 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr< LIB_PART >& aPart,
|
|||
|
||||
*fixedField = *field;
|
||||
|
||||
if( field->GetId() == VALUE )
|
||||
aPart->m_name = field->GetText();
|
||||
// Ensure the VALUE field = the part name (can be not the case
|
||||
// with malformed libraries: edited by hand, or converted from other tools)
|
||||
if( fixedField->GetId() == VALUE )
|
||||
fixedField->m_Text = aPart->m_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue