diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 1c46d8d07b..819e04e266 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -967,36 +967,10 @@ void SCH_SCREEN::GetSheets( std::vector* aItems ) std::sort( aItems->begin(), aItems->end(), []( EDA_ITEM* a, EDA_ITEM* b ) -> bool { - long a_order = 0; - long b_order = 0; - - for( const SCH_FIELD& field : static_cast( a )->GetFields() ) - { - if( field.GetName().CmpNoCase( wxT( "Order" ) ) == 0 ) - { - field.GetText().ToLong( &a_order ); - break; - } - } - - for( const SCH_FIELD& field : static_cast( b )->GetFields() ) - { - if( field.GetName().CmpNoCase( wxT( "Order" ) ) == 0 ) - { - field.GetText().ToLong( &b_order ); - break; - } - } - - if( a_order == b_order ) - { - if( a->GetPosition().x == b->GetPosition().x ) - return a->GetPosition().y < b->GetPosition().y; - + if( a->GetPosition().x == b->GetPosition().x ) + return a->GetPosition().y < b->GetPosition().y; + else return a->GetPosition().x < b->GetPosition().x; - } - - return a_order < b_order; } ); } diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index 10d2267927..366b3ffb5a 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -412,7 +412,7 @@ public: void GetHierarchicalItems( std::vector* aItems ); /** - * Similar to GetItems().OfType( SCH_SHEET_T ), but return the sheets in a + * Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a * deterministic order (L-R, T-B) for sheet numbering. * @param aItems */