Resolve text when requested

Getting resolved text for a symbol should always happen, even if we have
unresolved data in the instances

Fixes https://gitlab.com/kicad/code/kicad/issues/11003

(cherry picked from commit acb5ce7108)
This commit is contained in:
Seth Hillbrand 2022-03-01 15:09:50 -08:00
parent 495b42c39f
commit ac87d5e940
1 changed files with 9 additions and 2 deletions

View File

@ -583,8 +583,15 @@ const wxString SCH_SYMBOL::GetValue( const SCH_SHEET_PATH* sheet, bool aResolve
{
if( instance.m_Path == path && !instance.m_Value.IsEmpty() )
{
// This can only be an override from an Update Schematic from PCB, and therefore
// will always be fully resolved.
// This can only be overridden by a new value but if we are resolving,
// make sure that the symbol returns the fully resolved text
if( aResolve )
{
SCH_SYMBOL new_sym( *this );
new_sym.GetField( VALUE_FIELD )->SetText( instance.m_Value );
return new_sym.GetField( VALUE_FIELD )->GetShownText();
}
return instance.m_Value;
}
}