SCH_SHEET::GetContextualTextVars() will return Project text vars.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15123
This commit is contained in:
Jeff Young 2023-07-10 12:33:38 +01:00
parent 6a47fe1e3c
commit d2f9994fc5
1 changed files with 7 additions and 3 deletions

View File

@ -229,12 +229,16 @@ void DIALOG_TEXT_PROPERTIES::getContextualTextVars( const wxString& aCrossRef,
SCHEMATIC* schematic = m_currentItem->Schematic(); SCHEMATIC* schematic = m_currentItem->Schematic();
if( schematic && schematic->CurrentSheet().Last() ) if( schematic && schematic->CurrentSheet().Last() )
{
schematic->CurrentSheet().Last()->GetContextualTextVars( aTokens ); schematic->CurrentSheet().Last()->GetContextualTextVars( aTokens );
}
else
{
for( std::pair<wxString, wxString> entry : Prj().GetTextVars() ) for( std::pair<wxString, wxString> entry : Prj().GetTextVars() )
aTokens->push_back( entry.first ); aTokens->push_back( entry.first );
} }
} }
}
bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow() bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()