Use pin number sorting algorithm in pin table.

Fixes: lp:1793180
* https://bugs.launchpad.net/kicad/+bug/1793180
This commit is contained in:
Jeff Young 2018-09-19 22:22:31 +01:00
parent 6be2733285
commit 618182dcd6
1 changed files with 4 additions and 6 deletions

View File

@ -32,7 +32,7 @@
#include <bitmaps.h>
#include <wx/bmpcbox.h>
#include <kiface_i.h>
#include <kicad_string.h>
#define PinTableShownColumnsKey wxT( "PinTableShownColumns" )
@ -227,17 +227,15 @@ public:
{
wxString lhStr = GetValue( lhs, sortCol, units );
wxString rhStr = GetValue( rhs, sortCol, units );
bool retVal;
if( lhStr == rhStr )
{
// Secondary sort key is always COL_NUMBER
retVal = GetValue( lhs, COL_NUMBER, units ) < GetValue( rhs, COL_NUMBER, units );
lhStr = GetValue( lhs, COL_NUMBER, units );
rhStr = GetValue( rhs, COL_NUMBER, units );
}
else
retVal = lhStr < rhStr;
return ascending == retVal;
return ascending == ( PinNumbers::Compare( lhStr, rhStr ) < 0 );
}
void RebuildRows( LIB_PINS& aPins, bool groupByName )