mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 00:21:25 +00:00
Jobsets: Fix a few issues with BOM exporter
Correctly handle hidden fields Avoid taking reference to temporary Fixes https://gitlab.com/kicad/code/kicad/-/issues/19961
This commit is contained in:
parent
0ca9791577
commit
9930911de6
@ -655,7 +655,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
|
||||
struct BOM_FIELD field;
|
||||
|
||||
field.name = fieldName;
|
||||
field.show = true;
|
||||
field.show = !fieldName.StartsWith( wxT( "__" ), &field.name );
|
||||
field.groupBy = std::find( aBomJob->m_fieldsGroupBy.begin(),
|
||||
aBomJob->m_fieldsGroupBy.end(), field.name )
|
||||
!= aBomJob->m_fieldsGroupBy.end();
|
||||
@ -714,13 +714,13 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
|
||||
if( !aBomJob->m_bomFmtPresetName.IsEmpty() )
|
||||
{
|
||||
// Find the preset
|
||||
const BOM_FMT_PRESET* schFmtPreset = nullptr;
|
||||
std::optional<BOM_FMT_PRESET> schFmtPreset;
|
||||
|
||||
for( const BOM_FMT_PRESET& p : BOM_FMT_PRESET::BuiltInPresets() )
|
||||
{
|
||||
if( p.name == aBomJob->m_bomFmtPresetName )
|
||||
{
|
||||
schFmtPreset = &p;
|
||||
schFmtPreset = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -729,7 +729,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportBom( JOB* aJob )
|
||||
{
|
||||
if( p.name == aBomJob->m_bomFmtPresetName )
|
||||
{
|
||||
schFmtPreset = &p;
|
||||
schFmtPreset = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user