From bbdb5eb6e38663c72fadcefc15d4ef52ed86e561 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 3 Mar 2023 17:22:29 +0000 Subject: [PATCH] Use resolved fields when generating LIB_TREE info. Fixes https://gitlab.com/kicad/code/kicad/issues/13737 (cherry picked from commit 2fb24347ad6e6ed7960564874f105886e08ed50d) --- eeschema/generate_alias_info.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eeschema/generate_alias_info.cpp b/eeschema/generate_alias_info.cpp index 66f671739f..10c3235f40 100644 --- a/eeschema/generate_alias_info.cpp +++ b/eeschema/generate_alias_info.cpp @@ -158,7 +158,7 @@ protected: wxString GetHtmlFieldRow( const LIB_FIELD& aField ) const { wxString name = aField.GetCanonicalName(); - wxString text = aField.GetFullText( m_unit > 0 ? m_unit : 1 ); + wxString text; wxString fieldhtml = FieldFormat; fieldhtml.Replace( wxS( "__NAME__" ), EscapeHTML( name ) ); @@ -166,7 +166,7 @@ protected: switch( aField.GetId() ) { case DATASHEET_FIELD: - text = m_symbol->GetDatasheetField().GetText(); + text = m_symbol->GetDatasheetField().GetShownText( 0, false ); if( text.IsEmpty() || text == wxT( "~" ) ) { @@ -191,7 +191,13 @@ protected: // showing the value just repeats the name, so that's not much use... return wxEmptyString; + case REFERENCE_FIELD: + text = aField.GetFullText( m_unit > 0 ? m_unit : 1 ); + fieldhtml.Replace( wxS( "__VALUE__" ), EscapeHTML( text ) ); + break; + default: + text = aField.GetShownText( 0, false ); fieldhtml.Replace( wxS( "__VALUE__" ), EscapeHTML( text ) ); }