Sort pins in pin-table.

Fixes: lp:1744509
* https://bugs.launchpad.net/kicad/+bug/1744509
This commit is contained in:
Jeff Young 2018-01-20 23:41:25 +00:00 committed by jean-pierre charras
parent 6dd398bd6f
commit 6b9866de8b
1 changed files with 7 additions and 0 deletions

View File

@ -154,6 +154,11 @@ public:
void SetGroup( Group* aGroup ) { m_Group = aGroup; }
static bool Compare( const Pin& lhs, const Pin& rhs )
{
return PinNumbers::Compare( lhs.m_Backing->GetNumber(), rhs.m_Backing->GetNumber() ) < 0;
}
private:
DataViewModel& m_Model;
LIB_PIN* m_Backing;
@ -245,6 +250,8 @@ DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::DataViewModel( LIB_PART& aPart ) :
for( LIB_PINS::const_iterator i = m_Backing.begin(); i != m_Backing.end(); ++i )
m_Pins.push_back( Pin( *this, *i ) );
m_Pins.sort(Pin::Compare);
CalculateGrouping();
}