Don't allow empty page numbers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6698
This commit is contained in:
parent
320ca5a0d0
commit
42cbcf7ef4
|
@ -546,6 +546,13 @@ void SCH_EDIT_FRAME::CreateScreens()
|
||||||
|
|
||||||
m_schematic->RootScreen()->SetFileName( wxEmptyString );
|
m_schematic->RootScreen()->SetFileName( wxEmptyString );
|
||||||
|
|
||||||
|
// Don't leave root page number empty
|
||||||
|
SCH_SHEET_PATH rootSheetPath;
|
||||||
|
rootSheetPath.push_back( &m_schematic->Root() );
|
||||||
|
m_schematic->RootScreen()->SetPageNumber( wxT( "1" ) );
|
||||||
|
m_schematic->Root().AddInstance( rootSheetPath.Path() );
|
||||||
|
m_schematic->Root().SetPageNumber( rootSheetPath, wxT( "1" ) );
|
||||||
|
|
||||||
if( GetScreen() == NULL )
|
if( GetScreen() == NULL )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = new SCH_SCREEN( m_schematic );
|
SCH_SCREEN* screen = new SCH_SCREEN( m_schematic );
|
||||||
|
|
|
@ -1837,6 +1837,17 @@ void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN
|
||||||
case T_page:
|
case T_page:
|
||||||
NeedSYMBOL();
|
NeedSYMBOL();
|
||||||
instance.m_PageNumber = FromUTF8();
|
instance.m_PageNumber = FromUTF8();
|
||||||
|
|
||||||
|
// Empty page numbers are not permitted
|
||||||
|
if( instance.m_PageNumber.IsEmpty() )
|
||||||
|
{
|
||||||
|
// Use space character instead
|
||||||
|
instance.m_PageNumber = wxT( " " );
|
||||||
|
|
||||||
|
// Set the file as modified so the user can be warned.
|
||||||
|
aScreen->SetModify();
|
||||||
|
}
|
||||||
|
|
||||||
NeedRIGHT();
|
NeedRIGHT();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue