Fix same parsing issue in PCBNew.

Fixes https://gitlab.com/kicad/code/kicad/issues/4416
This commit is contained in:
Jeff Young 2020-05-12 20:38:29 +01:00
parent ed57c3464d
commit a632e5fbdb
3 changed files with 9 additions and 4 deletions

View File

@ -177,6 +177,7 @@ pad_prop_testpoint
pad_prop_heatsink pad_prop_heatsink
property property
page page
paper
path path
pcb_text_size pcb_text_size
pcb_text_width pcb_text_width

View File

@ -66,7 +66,8 @@ class TEXTE_PCB;
//#define SEXPR_BOARD_FILE_VERSION 20190907 // Keepout areas in footprints //#define SEXPR_BOARD_FILE_VERSION 20190907 // Keepout areas in footprints
//#define SEXPR_BOARD_FILE_VERSION 20191123 // pin function in pads //#define SEXPR_BOARD_FILE_VERSION 20191123 // pin function in pads
//#define SEXPR_BOARD_FILE_VERSION 20200104 // pad property for fabrication //#define SEXPR_BOARD_FILE_VERSION 20200104 // pad property for fabrication
#define SEXPR_BOARD_FILE_VERSION 20200119 // arcs in tracks //#define SEXPR_BOARD_FILE_VERSION 20200119 // arcs in tracks
#define SEXPR_BOARD_FILE_VERSION 20200512 // page -> paper
#define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names #define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names
#define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library) #define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library)

View File

@ -546,13 +546,16 @@ BOARD* PCB_PARSER::parseBOARD_unchecked()
token = NextTok(); token = NextTok();
if( token == T_page && m_requiredVersion <= 20200119 )
token = T_paper;
switch( token ) switch( token )
{ {
case T_general: case T_general:
parseGeneralSection(); parseGeneralSection();
break; break;
case T_page: case T_paper:
parsePAGE_INFO(); parsePAGE_INFO();
break; break;
@ -790,7 +793,7 @@ void PCB_PARSER::parseGeneralSection()
void PCB_PARSER::parsePAGE_INFO() void PCB_PARSER::parsePAGE_INFO()
{ {
wxCHECK_RET( CurTok() == T_page, wxCHECK_RET( ( CurTok() == T_page && m_requiredVersion <= 20200119 ) || CurTok() == T_paper,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a PAGE_INFO." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a PAGE_INFO." ) );
T token; T token;