Try to store the actual sheet #, but don't store 1 for non-root sheet.

Fixes https://gitlab.com/kicad/code/kicad/issues/5021
This commit is contained in:
Jeff Young 2020-07-31 22:03:25 +01:00
parent 5c479e150d
commit 173493b1a8
1 changed files with 7 additions and 0 deletions

View File

@ -716,6 +716,13 @@ bool SCH_EDIT_FRAME::SaveProject()
screen->SetFileName( tmpFn.GetFullPath() );
}
std::vector<SCH_SHEET_PATH>& sheets = screen->GetClientSheetPaths();
if( sheets.size() == 1 )
screen->m_ScreenNumber = sheets[0].GetPageNumber();
else
screen->m_ScreenNumber = 0; // multiple uses; no way to store the real sheet #
success &= SaveEEFile( screens.GetSheet( i ) );
}