Schematic: sheet pins need to use their parent to resolve text variables

Otherwise the current sheet will be searched, which is one layer too far
down the hierarchy.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13998
This commit is contained in:
Mike Williams 2023-03-08 11:28:32 -05:00
parent 1bc4fc256a
commit e738750dff
1 changed files with 4 additions and 5 deletions

View File

@ -290,13 +290,12 @@ wxString CONNECTION_SUBGRAPH::driverName( SCH_ITEM* aItem ) const
case SCH_LABEL_T: case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T: case SCH_GLOBAL_LABEL_T:
case SCH_HIER_LABEL_T: case SCH_HIER_LABEL_T:
case SCH_SHEET_PIN_T:
{
return EscapeString( static_cast<SCH_TEXT*>( aItem )->GetShownText( &m_sheet ), return EscapeString( static_cast<SCH_TEXT*>( aItem )->GetShownText( &m_sheet ),
CTX_NETNAME ); CTX_NETNAME );
break; case SCH_SHEET_PIN_T:
} // Sheet pins need to use their parent sheet as their starting sheet or they will
// resolve variables on the current sheet first
return EscapeString( static_cast<SCH_TEXT*>( aItem )->GetShownText(), CTX_NETNAME );
default: default:
wxFAIL_MSG( wxS( "Unhandled item type in GetNameForDriver" ) ); wxFAIL_MSG( wxS( "Unhandled item type in GetNameForDriver" ) );
break; break;