Sort pins by number when grouping by name.

Fixes: lp:1828648
* https://bugs.launchpad.net/kicad/+bug/1828648
This commit is contained in:
Jeff Young 2019-08-21 20:16:21 +01:00
parent a6b7d4f7f6
commit 97212acecb
1 changed files with 16 additions and 2 deletions

View File

@ -310,6 +310,9 @@ public:
ascending = GetView()->IsSortOrderAscending();
}
for( LIB_PINS& row : m_rows )
SortPins( row );
SortRows( sortCol, ascending );
if ( GetView() )
@ -322,8 +325,19 @@ public:
void SortRows( int aSortCol, bool ascending )
{
std::sort( m_rows.begin(), m_rows.end(),
[ aSortCol, ascending, this ]( LIB_PINS lhs, LIB_PINS rhs ) -> bool
{ return compare( lhs, rhs, aSortCol, ascending, m_userUnits ); } );
[ aSortCol, ascending, this ]( LIB_PINS& lhs, LIB_PINS& rhs ) -> bool
{
return compare( lhs, rhs, aSortCol, ascending, m_userUnits );
} );
}
void SortPins( LIB_PINS& aRow )
{
std::sort( aRow.begin(), aRow.end(),
[]( LIB_PIN* lhs, LIB_PIN* rhs ) -> bool
{
return PinNumbers::Compare( lhs->GetNumber(), rhs->GetNumber() ) < 0;
} );
}
void AppendRow( LIB_PIN* aPin )