From bc8cc826cc20bdbe5943337cf6a2086fae8ca1cf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 5 Jul 2023 11:08:25 +0200 Subject: [PATCH] Eeschema, PlotInteractiveLayer(): do not print useless info in a PDF plot. It makes this info more easily readable. - Remove duplicate properties/fields - Do not plot empty properties/fields --- eeschema/sch_symbol.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 49d2987a21..1831791c4e 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -2266,18 +2266,21 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const for( const SCH_FIELD& field : GetFields() ) { + wxString text_field = field.GetShownText( sheet, false); + + if( text_field.IsEmpty() ) + continue; + properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), - field.GetName(), - field.GetShownText( sheet, false) ) ); + field.GetName(), text_field ) ); } - properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), - _( "Description" ), - m_part->GetDescription() ) ); - - properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), - _( "Keywords" ), - m_part->GetKeyWords() ) ); + if( !m_part->GetKeyWords().IsEmpty() ) + { + properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), + _( "Keywords" ), + m_part->GetKeyWords() ) ); + } aPlotter->HyperlinkMenu( GetBoundingBox(), properties );