@ -906,6 +906,7 @@ void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
{
{
if ( PART_SPTR part = m_part . lock ( ) )
if ( PART_SPTR part = m_part . lock ( ) )
{
{
wxString symbolName ;
LIB_FIELDS fields ;
LIB_FIELDS fields ;
part - > GetFields ( fields ) ;
part - > GetFields ( fields ) ;
@ -926,6 +927,7 @@ void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
if ( idx = = REFERENCE & & ! aResetRef )
if ( idx = = REFERENCE & & ! aResetRef )
continue ;
continue ;
if ( ( unsigned ) idx < MANDATORY_FIELDS )
if ( ( unsigned ) idx < MANDATORY_FIELDS )
schField = GetField ( idx ) ;
schField = GetField ( idx ) ;
else
else
@ -944,14 +946,27 @@ void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
}
}
if ( idx = = VALUE )
if ( idx = = VALUE )
{
schField - > SetText ( m_lib_id . GetLibItemName ( ) ) ; // fetch alias-specific value
schField - > SetText ( m_lib_id . GetLibItemName ( ) ) ; // fetch alias-specific value
symbolName = m_lib_id . GetLibItemName ( ) ;
}
else if ( idx = = DATASHEET )
else if ( idx = = DATASHEET )
{
schField - > SetText ( GetDatasheet ( ) ) ; // fetch alias-specific value
schField - > SetText ( GetDatasheet ( ) ) ; // fetch alias-specific value
// Some older libraries may be broken and the alias datasheet information
// in the document file for the root part may have been dropped. This only
// happens for the root part.
if ( schField - > GetText ( ) . IsEmpty ( ) & & symbolName = = part - > GetName ( ) )
schField - > SetText ( part - > GetField ( DATASHEET ) - > GetText ( ) ) ;
}
else
else
{
schField - > SetText ( field . GetText ( ) ) ;
schField - > SetText ( field . GetText ( ) ) ;
}
}
}
}
}
}
}
LIB_PIN * SCH_COMPONENT : : GetPin ( const wxString & number )
LIB_PIN * SCH_COMPONENT : : GetPin ( const wxString & number )