From 3622a296be456d6cf4aab3d3776fa623ff852c37 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 15 May 2024 10:54:41 +0100 Subject: [PATCH] Use consistent sorting for footprint libs. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17731 (cherry picked from commit 02bc093b55f15c8765c9a426630c9a228b228f28) --- cvpcb/cvpcb_mainframe.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index f12b9d1757..1d12abe94e 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -991,8 +991,19 @@ void CVPCB_MAINFRAME::BuildLibrariesList() COMMON_SETTINGS* cfg = Pgm().GetCommonSettings(); PROJECT_FILE& project = Kiway().Prj().GetProjectFile(); FP_LIB_TABLE* tbl = PROJECT_PCB::PcbFootprintLibs( &Prj() ); - std::set pinnedMatches; - std::set 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 pinnedMatches; + std::set otherMatches; + m_librariesListBox->ClearList(); auto process =