Fix a couple of bugs in the CurrentSheet architecture.

This commit is contained in:
Jeff Young 2020-07-05 19:25:38 +01:00
parent 5bc6389477
commit ec6c1b80b7
2 changed files with 6 additions and 2 deletions

View File

@ -471,6 +471,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
sheetList.UpdateSymbolInstances( Schematic().RootScreen()->m_symbolInstances ); sheetList.UpdateSymbolInstances( Schematic().RootScreen()->m_symbolInstances );
} }
SCH_SHEET_PATH root;
root.push_back( &Schematic().Root() );
SetCurrentSheet( root );
Schematic().ConnectionGraph()->Reset(); Schematic().ConnectionGraph()->Reset();
SetScreen( GetCurrentSheet().LastScreen() ); SetScreen( GetCurrentSheet().LastScreen() );

View File

@ -1093,7 +1093,7 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents() const
void SCH_EDIT_FRAME::FixupJunctions() void SCH_EDIT_FRAME::FixupJunctions()
{ {
// Save the current sheet, to retrieve it later // Save the current sheet, to retrieve it later
auto currSheet = GetCurrentSheet(); SCH_SHEET_PATH oldsheetpath = GetCurrentSheet();
bool modified = false; bool modified = false;
@ -1134,7 +1134,7 @@ void SCH_EDIT_FRAME::FixupJunctions()
OnModify(); OnModify();
// Reselect the initial sheet: // Reselect the initial sheet:
SetCurrentSheet( currSheet ); SetCurrentSheet( oldsheetpath );
GetCurrentSheet().UpdateAllScreenReferences(); GetCurrentSheet().UpdateAllScreenReferences();
SetScreen( GetCurrentSheet().LastScreen() ); SetScreen( GetCurrentSheet().LastScreen() );
} }