Trim before sorting.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17046
This commit is contained in:
Jeff Young 2024-05-26 19:28:02 +01:00
parent e400d49af6
commit df3eaf0e03
1 changed files with 2 additions and 2 deletions

View File

@ -317,8 +317,8 @@ bool FIELDS_EDITOR_GRID_DATA_MODEL::cmp( const DATA_MODEL_ROW& lhGroup,
// Primary sort key is sortCol; secondary is always REFERENCE (column 0) // Primary sort key is sortCol; secondary is always REFERENCE (column 0)
wxString lhs = dataModel->GetValue( (DATA_MODEL_ROW&) lhGroup, sortCol ); wxString lhs = dataModel->GetValue( lhGroup, sortCol ).Trim( true ).Trim( false );
wxString rhs = dataModel->GetValue( (DATA_MODEL_ROW&) rhGroup, sortCol ); wxString rhs = dataModel->GetValue( rhGroup, sortCol ).Trim( true ).Trim( false );
if( lhs == rhs || sortCol == REFERENCE_FIELD ) if( lhs == rhs || sortCol == REFERENCE_FIELD )
{ {