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

Remember to set the root sheet before loading

This is done in the frame for GUI loading so we need to explicitly set
this when loading files in the cli

Fixes #17790

(cherry picked from commit f8a25d20)
parent fdc3806e
No related branches found
No related tags found
Loading
Pipeline #1259042422 passed
......@@ -126,6 +126,19 @@ SCHEMATIC* EESCHEMA_HELPERS::LoadSchematic( wxString& aFileName, SCH_IO_MGR::SCH
SCHEMATIC* schematic = new SCHEMATIC( project );
SCH_SHEET* rootSheet = new SCH_SHEET( schematic );
schematic->SetRoot( rootSheet );
SCH_SCREEN* rootScreen = new SCH_SCREEN( schematic );
const_cast<KIID&>( rootSheet->m_Uuid ) = rootScreen->GetUuid();
schematic->Root().SetScreen( rootScreen );
schematic->RootScreen()->SetFileName( wxEmptyString );
// Don't leave root page number empty
schematic->RootScreen()->SetPageNumber( wxT( "1" ) );
wxFileName schFile = aFileName;
schFile.MakeAbsolute();
......
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