SCH_EDIT_FRAME::FixupJunctions(): do not change the opened sheet after running the code.

This commit is contained in:
jean-pierre charras 2019-06-25 17:26:01 +02:00
parent 288982b15d
commit 1cc05f19b5
1 changed files with 8 additions and 1 deletions

View File

@ -1150,8 +1150,10 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents() const
void SCH_EDIT_FRAME::FixupJunctions()
{
SCH_SHEET_LIST sheetList;
// Save the current sheet, to retrieve it later
auto currSheet = GetCurrentSheet();
SCH_SHEET_LIST sheetList;
sheetList.BuildSheetList( g_RootSheet );
for( unsigned i = 0; i < sheetList.size(); i++ )
@ -1181,4 +1183,9 @@ void SCH_EDIT_FRAME::FixupJunctions()
}
}
}
// Reselect the initial sheet:
SetCurrentSheet( currSheet );
GetCurrentSheet().UpdateAllScreenReferences();
SetScreen( GetCurrentSheet().LastScreen() );
}