diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 30e7d1d3db..38f4a7e5fe 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -241,6 +241,7 @@ void DRC_TEST_PROVIDER_MISC::testAssertions() drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " (" ) + c->GetName() + wxS( ")" ) ); drcItem->SetItems( item ); + drcItem->SetViolatingRule( c->GetParentRule() ); reportViolation( drcItem, item->GetPosition(), item->GetLayer() ); } ); diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 3d7822fcb8..314b24f837 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -127,13 +127,18 @@ LIBEVAL::VALUE* PCB_EXPR_VAR_REF::GetValue( LIBEVAL::CONTEXT* aCtx ) else { const wxAny& any = item->Get( it->second ); - bool valid = any.GetAs( &str ); + PCB_LAYER_ID layer; - if( valid ) + if( it->second->Name() == wxT( "Layer" ) ) { - if( it->second->Name() == wxT( "Layer" ) ) + if( any.GetAs( &layer ) ) + return new PCB_LAYER_VALUE( layer ); + else if( any.GetAs( &str ) ) return new PCB_LAYER_VALUE( context->GetBoard()->GetLayerID( str ) ); - else + } + else + { + if( any.GetAs( &str ) ) return new LIBEVAL::VALUE( str ); } }