diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 7779f258b7..3bfa28b29a 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -471,6 +471,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in sheetList.UpdateSymbolInstances( Schematic().RootScreen()->m_symbolInstances ); } + SCH_SHEET_PATH root; + root.push_back( &Schematic().Root() ); + SetCurrentSheet( root ); + Schematic().ConnectionGraph()->Reset(); SetScreen( GetCurrentSheet().LastScreen() ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 257f9af0a2..90c9cc8e3f 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1093,7 +1093,7 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents() const void SCH_EDIT_FRAME::FixupJunctions() { // Save the current sheet, to retrieve it later - auto currSheet = GetCurrentSheet(); + SCH_SHEET_PATH oldsheetpath = GetCurrentSheet(); bool modified = false; @@ -1134,7 +1134,7 @@ void SCH_EDIT_FRAME::FixupJunctions() OnModify(); // Reselect the initial sheet: - SetCurrentSheet( currSheet ); + SetCurrentSheet( oldsheetpath ); GetCurrentSheet().UpdateAllScreenReferences(); SetScreen( GetCurrentSheet().LastScreen() ); }