Correctly resolve textVar refs in worksheet items in ERC.

Also fixes a null-ptr bug in DRC.

Fixes https://gitlab.com/kicad/code/kicad/issues/5506
This commit is contained in:
Jeff Young 2020-09-04 21:37:23 +01:00
parent 08dee31d9e
commit 5e9ec82642
2 changed files with 10 additions and 1 deletions

View File

@ -157,6 +157,12 @@ void ERC_TESTER::TestTextVars( KIGFX::WS_PROXY_VIEW_ITEM* aWorksheet )
if( aWorksheet )
{
wsItems.SetMilsToIUfactor( IU_PER_MILS );
wsItems.SetSheetNumber( 1 );
wsItems.SetSheetCount( 1 );
wsItems.SetFileName( "dummyFilename" );
wsItems.SetSheetName( "dummySheet" );
wsItems.SetSheetLayer( "dummyLayer" );
wsItems.SetProject( &m_schematic->Prj() );
wsItems.BuildWorkSheetGraphicList( aWorksheet->GetPageInfo(), aWorksheet->GetTitleBlock() );
}

View File

@ -250,7 +250,10 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
BOARD_ITEM* c = board->GetItem( rc_item->GetAuxItem2ID() );
BOARD_ITEM* d = board->GetItem( rc_item->GetAuxItem3ID() );
LSET violationLayers = a->GetLayerSet();
LSET violationLayers;
if( a )
violationLayers &= a->GetLayerSet();
if( b )
violationLayers &= b->GetLayerSet();