Eeeschema: Fixed logic to display unamed pins properly
CHANGED: This code previously checked "m_name.IsEmpty()" to choose the correct formatting path, but that check fails if the pin is called "~" which is the default for an empty pin name. Instead we get the final display string that will be shown and check if it's empty. Fixes https://gitlab.com/kicad/code/kicad/issues/13332
This commit is contained in:
parent
a206f6717d
commit
76a0d4c4c0
|
@ -1340,13 +1340,20 @@ BITMAPS LIB_PIN::GetMenuImage() const
|
|||
|
||||
wxString LIB_PIN::GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const
|
||||
{
|
||||
// This code previously checked "m_name.IsEmpty()" to choose the correct
|
||||
// formatting path, but that check fails if the pin is called "~" which is
|
||||
// the default for an empty pin name. Instead we get the final display string
|
||||
// that will be shown and check if it's empty.
|
||||
|
||||
wxString shownName = UnescapeString( GetShownName() );
|
||||
|
||||
if( IsVisible() )
|
||||
{
|
||||
if( !m_name.IsEmpty() )
|
||||
if ( !shownName.IsEmpty() )
|
||||
{
|
||||
return wxString::Format( _( "Pin %s [%s, %s, %s]" ),
|
||||
GetShownNumber(),
|
||||
UnescapeString( GetShownName() ),
|
||||
shownName,
|
||||
GetElectricalTypeName(),
|
||||
PinShapeGetText( m_shape ) );
|
||||
}
|
||||
|
@ -1360,11 +1367,11 @@ wxString LIB_PIN::GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const
|
|||
}
|
||||
else
|
||||
{
|
||||
if( !m_name.IsEmpty() )
|
||||
if( !shownName.IsEmpty() )
|
||||
{
|
||||
return wxString::Format( _( "Hidden pin %s [%s, %s, %s]" ),
|
||||
GetShownNumber(),
|
||||
UnescapeString( GetShownName() ),
|
||||
shownName,
|
||||
GetElectricalTypeName(),
|
||||
PinShapeGetText( m_shape ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue