Browse Source

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
7.0
Jeff Young 3 years ago
parent
commit
2919490e92
  1. 9
      eeschema/sch_sheet_path.cpp
  2. 2
      eeschema/tools/sch_editor_control.cpp

9
eeschema/sch_sheet_path.cpp

@ -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 )

2
eeschema/tools/sch_editor_control.cpp

@ -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…
Cancel
Save