Check env vars when testing for unresolved variables.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17174
This commit is contained in:
Jeff Young 2024-02-28 16:12:07 +00:00
parent 9508b79cc3
commit 04440d8506
1 changed files with 7 additions and 3 deletions

View File

@ -316,11 +316,15 @@ void DRC_TEST_PROVIDER_MISC::testTextVars()
return false;
BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( item );
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( boardItem );
EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( boardItem );
wxCHECK( boardItem, false );
if( !textItem )
return true;
if( text && text->GetShownText( true ).Matches( wxT( "*${*}*" ) ) )
wxString resolved = ExpandEnvVarSubstitutions( textItem->GetShownText( true ),
nullptr /*project already done*/ );
if( resolved.Matches( wxT( "*${*}*" ) ) )
{
std::shared_ptr<DRC_ITEM>drcItem = DRC_ITEM::Create( DRCE_UNRESOLVED_VARIABLE );
drcItem->SetItems( item );