Handle hierarchical symbols when performing "lib symbol changed" check.

Fixes https://gitlab.com/kicad/code/kicad/issues/6002
This commit is contained in:
Jeff Young 2020-10-19 15:34:59 +01:00
parent 3100273db1
commit d0ddc909dc
1 changed files with 12 additions and 7 deletions

View File

@ -632,15 +632,20 @@ int ERC_TESTER::TestLibSymbolIssues()
markers.emplace_back( new SCH_MARKER( ercItem, symbol->GetPosition() ) );
}
else if( *libSymbol != *libSymbolInSchematic )
else
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_LIB_SYMBOL_ISSUES );
ercItem->SetItems( symbol );
msg.Printf( "Library symbol \"%s\" has been modified",
symbol->GetLibId().GetUniStringLibId() );
ercItem->SetErrorMessage( msg );
std::unique_ptr<LIB_PART> flattenedSymbol = libSymbol->Flatten();
markers.emplace_back( new SCH_MARKER( ercItem, symbol->GetPosition() ) );
if( *flattenedSymbol != *libSymbolInSchematic )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_LIB_SYMBOL_ISSUES );
ercItem->SetItems( symbol );
msg.Printf( "Library symbol \"%s\" has been modified",
symbol->GetLibId().GetUniStringLibId() );
ercItem->SetErrorMessage( msg );
markers.emplace_back( new SCH_MARKER( ercItem, symbol->GetPosition() ) );
}
}
}