DbLib: Map multiple footprints to footprint filter list

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13587
This commit is contained in:
Jon Evans 2023-08-23 19:16:49 -04:00
parent 72daeddca3
commit e118d2fca0
2 changed files with 12 additions and 3 deletions

View File

@ -447,10 +447,19 @@ LIB_SYMBOL* SCH_DATABASE_PLUGIN::loadSymbolFromRow( const wxString& aSymbolName,
if( aRow.count( aTable.footprints_col ) )
{
// TODO: Support multiple footprint choices
std::string footprints = std::any_cast<std::string>( aRow.at( aTable.footprints_col ) );
wxString footprint = wxString( footprints.c_str(), wxConvUTF8 ).BeforeFirst( ';' );
symbol->GetFootprintField().SetText( footprint );
wxString footprintsStr = wxString( footprints.c_str(), wxConvUTF8 );
wxArrayString footprintsList;
wxStringTokenizer tokenizer( footprintsStr, ';' );
while( tokenizer.HasMoreTokens() )
footprintsList.Add( tokenizer.GetNextToken() );
if( footprintsList.size() > 0 )
symbol->GetFootprintField().SetText( footprintsList[0] );
symbol->SetFPFilters( footprintsList );
}
else
{

Binary file not shown.