From 2deee015926ce2444b51f0671f2a3ff537afea7c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 5 Nov 2023 11:41:02 +0100 Subject: [PATCH] Eeschema, print schematic: resolve text variables in symbol graphic text. Variables in graphic text (body item) were resolved in plot, but not in print function. Fixes #16026 https://gitlab.com/kicad/code/kicad/-/issues/16026 --- eeschema/sch_symbol.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 4e4cd00045..e90affb0f6 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -547,6 +547,17 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse tempPin->SetShape( symbolPin->GetShape() ); } + for( LIB_ITEM& item : tempSymbol.GetDrawItems() ) + { + if( EDA_TEXT* text = dynamic_cast( &item ) ) + { + // Use SCH_FIELD's text resolver + SCH_FIELD dummy( (SCH_ITEM*) this, -1 ); + dummy.SetText( text->GetText() ); + text->SetText( dummy.GetShownText( false ) ); + } + } + tempSymbol.Print( aSettings, m_pos + aOffset, m_unit, m_convert, opts, GetDNP() ); } else // Use dummy() part if the actual cannot be found.