Skip to content
Snippets Groups Projects
Commit 128ec782 authored by Seth Hillbrand's avatar Seth Hillbrand :flag_il:
Browse files

Eeschema: Add bit that was missing from commit 7ac83ac6

This part of the check removes recursive sheets from the schematic when
loading and notifies the user that their schematic has been repaired.
parent 7ac83ac6
No related branches found
No related tags found
2 merge requests!2!WIP Geographic reannotation,!1WIP: Geographic Reannotation
......@@ -373,6 +373,8 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
{
wxCHECK_RET( aSheet != NULL, wxT( "Cannot build sheet list from undefined sheet." ) );
std::vector<SCH_SHEET*> badSheets;
if( aSheet == g_RootSheet )
m_isRootSheet = true;
......@@ -389,7 +391,21 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
if( m_currentSheetPath.LastScreen() )
{
for( auto item : m_currentSheetPath.LastScreen()->Items().OfType( SCH_SHEET_T ) )
BuildSheetList( static_cast<SCH_SHEET*>( item ) );
{
auto sheet = static_cast<SCH_SHEET*>( item );
if( !m_currentSheetPath.TestForRecursion(
sheet->GetFileName(), aSheet->GetFileName() ) )
BuildSheetList( sheet );
else
badSheets.push_back( sheet );
}
}
for( auto sheet : badSheets )
{
m_currentSheetPath.LastScreen()->Remove( sheet );
m_currentSheetPath.LastScreen()->SetModify();
}
m_currentSheetPath.pop_back();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment