diff --git a/eeschema/dialogs/dialog_text_properties.cpp b/eeschema/dialogs/dialog_text_properties.cpp index 39ab85f8db..3acd0bd6d6 100644 --- a/eeschema/dialogs/dialog_text_properties.cpp +++ b/eeschema/dialogs/dialog_text_properties.cpp @@ -229,10 +229,14 @@ void DIALOG_TEXT_PROPERTIES::getContextualTextVars( const wxString& aCrossRef, SCHEMATIC* schematic = m_currentItem->Schematic(); if( schematic && schematic->CurrentSheet().Last() ) + { schematic->CurrentSheet().Last()->GetContextualTextVars( aTokens ); - - for( std::pair entry : Prj().GetTextVars() ) - aTokens->push_back( entry.first ); + } + else + { + for( std::pair entry : Prj().GetTextVars() ) + aTokens->push_back( entry.first ); + } } }