From ebba15fe67682d4e970e592b76993375975b0b06 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 18 Aug 2019 21:21:46 -0700 Subject: [PATCH] Alphabetize Library Table returns KiCad is case sensitive but we need to be consistent in displaying sort order as case insensitive (same as file systems) Fixes: lp:1836911 * https://bugs.launchpad.net/kicad/+bug/1836911 --- common/lib_table_base.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/lib_table_base.cpp b/common/lib_table_base.cpp index 8c53009a48..fb8a8f2fc5 100644 --- a/common/lib_table_base.cpp +++ b/common/lib_table_base.cpp @@ -398,6 +398,12 @@ std::vector LIB_TABLE::GetLogicalLibs() ret.push_back( *it ); } + // We want to allow case-sensitive duplicates but sort by case-insensitive ordering + std::sort( ret.begin(), ret.end(), []( const wxString& lhs, const wxString& rhs ) + { + return lhs.CmpNoCase( rhs ) < 0; + } ); + return ret; }