From 618182dcd6565645757618e4f259ca990e45c904 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 19 Sep 2018 22:22:31 +0100 Subject: [PATCH] Use pin number sorting algorithm in pin table. Fixes: lp:1793180 * https://bugs.launchpad.net/kicad/+bug/1793180 --- eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index 49977cf2fc..66a0085baf 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -32,7 +32,7 @@ #include #include #include - +#include #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 )