From c9aebb8529e8c155deef74f4dcc070f3470eeafe Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 25 Sep 2021 21:14:42 +0100 Subject: [PATCH] Fix symbol fields sorting. In the symbol fields table the reference contains only the letter, so the number must be appended. Conversely, we don't want the unit suffix as all units are folded into a single symbol. Fixes https://gitlab.com/kicad/code/kicad/issues/9238 --- eeschema/dialogs/dialog_symbol_fields_table.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 2b1fcad341..bd50c18a1b 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -301,8 +301,8 @@ public: std::sort( references.begin(), references.end(), []( const SCH_REFERENCE& l, const SCH_REFERENCE& r ) -> bool { - wxString l_ref( l.GetFullRef() ); - wxString r_ref( r.GetFullRef() ); + wxString l_ref( l.GetRef() << l.GetRefNumber() ); + wxString r_ref( r.GetRef() << r.GetRefNumber() ); return StrNumCmp( l_ref, r_ref, true ) < 0; } ); @@ -371,8 +371,8 @@ public: if( lhs == rhs || sortCol == REFERENCE_FIELD ) { - wxString lhRef = lhGroup.m_Refs[ 0 ].GetFullRef(); - wxString rhRef = rhGroup.m_Refs[ 0 ].GetFullRef(); + wxString lhRef = lhGroup.m_Refs[ 0 ].GetRef() + lhGroup.m_Refs[ 0 ].GetRefNumber(); + wxString rhRef = rhGroup.m_Refs[ 0 ].GetRef() + rhGroup.m_Refs[ 0 ].GetRefNumber(); return local_cmp( StrNumCmp( lhRef, rhRef, true ), 0 ); } else