Sort pins by number when grouping by name.
Fixes: lp:1828648
* https://bugs.launchpad.net/kicad/+bug/1828648
(cherry picked from commit 97212acecb
)
This commit is contained in:
parent
86691dabbf
commit
c879dcaf7d
|
@ -309,6 +309,9 @@ public:
|
|||
ascending = GetView()->IsSortOrderAscending();
|
||||
}
|
||||
|
||||
for( LIB_PINS& row : m_rows )
|
||||
SortPins( row );
|
||||
|
||||
SortRows( sortCol, ascending );
|
||||
|
||||
if ( GetView() )
|
||||
|
@ -321,8 +324,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 )
|
||||
|
|
Loading…
Reference in New Issue