Pick up root sheet KIID from sheet instances.
Fixes https://gitlab.com/kicad/code/kicad/issues/6725
This commit is contained in:
parent
b68b1692ec
commit
bf632ad771
|
@ -1799,7 +1799,7 @@ SCH_SHEET_PIN* SCH_SEXPR_PARSER::parseSchSheetPin( SCH_SHEET* aSheet )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SCREEN* aScreen )
|
||||
void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN* aScreen )
|
||||
{
|
||||
wxCHECK_RET( CurTok() == T_sheet_instances,
|
||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) +
|
||||
|
@ -1853,6 +1853,17 @@ void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SCREEN* aScreen )
|
|||
Expecting( "path" );
|
||||
}
|
||||
}
|
||||
|
||||
// We don't store the root sheet's KIID, so pick it up from any sheet instance paths so
|
||||
// that it doesn't change on every round-trip.
|
||||
for( const SCH_SHEET_INSTANCE& instance : aScreen->m_sheetInstances )
|
||||
{
|
||||
if( instance.m_Path.size() > 0 )
|
||||
{
|
||||
const_cast<KIID&>( aRootSheet->m_Uuid ) = instance.m_Path[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2081,7 +2092,7 @@ void SCH_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly,
|
|||
if( aIsCopyableOnly )
|
||||
Unexpected( T_sheet_instances );
|
||||
|
||||
parseSchSheetInstances( screen );
|
||||
parseSchSheetInstances( aSheet, screen );
|
||||
break;
|
||||
|
||||
case T_symbol_instances:
|
||||
|
|
|
@ -186,7 +186,7 @@ class SCH_SEXPR_PARSER : public SCHEMATIC_LEXER
|
|||
void parsePAGE_INFO( PAGE_INFO& aPageInfo );
|
||||
void parseTITLE_BLOCK( TITLE_BLOCK& aTitleBlock );
|
||||
void parseSchSymbolInstances( SCH_SCREEN* aScreen );
|
||||
void parseSchSheetInstances( SCH_SCREEN* aScreen );
|
||||
void parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN* aScreen );
|
||||
|
||||
SCH_SHEET_PIN* parseSchSheetPin( SCH_SHEET* aSheet );
|
||||
SCH_FIELD* parseSchField( SCH_ITEM* aParent );
|
||||
|
|
Loading…
Reference in New Issue