Use hash (not page no) to determine when we've found the current sheet.
Also enforces strict ordering in another page number sorter, although this has nothing to do with the bug below. Fixes https://gitlab.com/kicad/code/kicad/issues/12043
This commit is contained in:
parent
3747cae7dc
commit
2919490e92
|
@ -735,7 +735,14 @@ void SCH_SHEET_LIST::SortByPageNumbers( bool aUpdateVirtualPageNums )
|
|||
std::sort( begin(), end(),
|
||||
[]( SCH_SHEET_PATH a, SCH_SHEET_PATH b ) -> bool
|
||||
{
|
||||
return a.ComparePageNum( b ) < 0;
|
||||
int retval = a.ComparePageNum( b );
|
||||
|
||||
if( retval < 0 )
|
||||
return true;
|
||||
else if( retval > 0 )
|
||||
return false;
|
||||
else /// Enforce strict ordering. If the page numbers are the same, use UUIDs
|
||||
return a.GetCurrentHash() < b.GetCurrentHash();
|
||||
} );
|
||||
|
||||
if( aUpdateVirtualPageNums )
|
||||
|
|
|
@ -531,7 +531,7 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
if( afterSheet )
|
||||
{
|
||||
if( afterSheet->GetPageNumber() == sheet->GetPageNumber() )
|
||||
if( afterSheet->GetCurrentHash() == sheet->GetCurrentHash() )
|
||||
afterSheet = nullptr;
|
||||
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue