From ec6c1b80b7328e5b015b74411f6568518fe7a5de Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 5 Jul 2020 19:25:38 +0100 Subject: [PATCH] Fix a couple of bugs in the CurrentSheet architecture. --- eeschema/files-io.cpp | 4 ++++ eeschema/sch_edit_frame.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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() ); }