Use consistent sorting for footprint libs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17731

(cherry picked from commit 02bc093b55)
This commit is contained in:
Jeff Young 2024-05-15 10:54:41 +01:00
parent 0b48913876
commit 3622a296be
1 changed files with 13 additions and 2 deletions

View File

@ -991,8 +991,19 @@ void CVPCB_MAINFRAME::BuildLibrariesList()
COMMON_SETTINGS* cfg = Pgm().GetCommonSettings(); COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
PROJECT_FILE& project = Kiway().Prj().GetProjectFile(); PROJECT_FILE& project = Kiway().Prj().GetProjectFile();
FP_LIB_TABLE* tbl = PROJECT_PCB::PcbFootprintLibs( &Prj() ); FP_LIB_TABLE* tbl = PROJECT_PCB::PcbFootprintLibs( &Prj() );
std::set<wxString> pinnedMatches;
std::set<wxString> otherMatches; // Use same sorting algorithm as LIB_TREE_NODE::AssignIntrinsicRanks
struct library_sort
{
bool operator()( const wxString& lhs, const wxString& rhs ) const
{
return StrNumCmp( lhs, rhs, true ) < 0;
}
};
std::set<wxString, library_sort> pinnedMatches;
std::set<wxString, library_sort> otherMatches;
m_librariesListBox->ClearList(); m_librariesListBox->ClearList();
auto process = auto process =