Cache full schematic sheet list sorted by sheet page number.
The sheet list is returned as a copy of the cached list rather than a reference to prevent external code from changing the list. While not as performant, it eliminates the risk of the sheet list being altered in ways that could break the schematic. The sheet list should only be updated by calling SCHEMATIC::RefreshHierarchy() when any appropriate sheet changes are made. Note to developers: there is something inherently different about how the QA tests are loading and handling schematics versus the schematic editor. Using the cached sheet list for the SCHEMATIC object will cause some QA test to fail. This is why SCHEMATIC::Hierarchy() has not replaced SCHEMATIC::BuildSheetListSortedByPageNumbers() everywhere.
This commit is contained in:
@@ -297,7 +297,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in
|
||||
}
|
||||
else if( token->IsSameAs( wxT( "##" ) ) )
|
||||
{
|
||||
*token = wxString::Format( wxT( "%d" ), (int) schematic->BuildUnorderedSheetList().size() );
|
||||
*token = wxString::Format( wxT( "%d" ), (int) schematic->Hierarchy().size() );
|
||||
return true;
|
||||
}
|
||||
else if( token->IsSameAs( wxT( "SHEETPATH" ) ) )
|
||||
|
||||
Reference in New Issue
Block a user