mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
bom export: don't break column order on mismatched column counts
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20520
This commit is contained in:
parent
46e6eb163b
commit
a7a7e963c9
@ -137,20 +137,21 @@ std::vector<BOM_FIELD> FIELDS_EDITOR_GRID_DATA_MODEL::GetFieldsOrdered()
|
||||
|
||||
|
||||
void FIELDS_EDITOR_GRID_DATA_MODEL::SetFieldsOrder( const std::vector<wxString>& aNewOrder )
|
||||
{
|
||||
if( aNewOrder.size() == m_cols.size() )
|
||||
{
|
||||
size_t foundCount = 0;
|
||||
|
||||
for( const wxString& newField : aNewOrder )
|
||||
{
|
||||
if( foundCount >= m_cols.size() )
|
||||
break;
|
||||
|
||||
for( DATA_MODEL_COL& col : m_cols )
|
||||
{
|
||||
if( col.m_fieldName == newField )
|
||||
{
|
||||
std::swap( m_cols[foundCount], col );
|
||||
foundCount++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user