diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index b31a40c3a7..02200b3a00 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -589,8 +589,10 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( const std::mapGetValue() ) { - symbol->SetIncludeInBom( libSymbol->GetIncludeInBom() ); - symbol->SetIncludeOnBoard( libSymbol->GetIncludeOnBoard() ); + // Fetch the attributes from the *flattened* library symbol. They are not supported + // in derived symbols. + symbol->SetIncludeInBom( symbol->GetLibSymbolRef()->GetIncludeInBom() ); + symbol->SetIncludeOnBoard( symbol->GetLibSymbolRef()->GetIncludeOnBoard() ); } bool removeExtras = m_removeExtraBox->GetValue(); diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index 33cc8112f4..1e2562d018 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -647,6 +647,10 @@ std::unique_ptr< LIB_SYMBOL > LIB_SYMBOL::Flatten() const retv->SetKeyWords( m_keyWords.IsEmpty() ? parent->GetKeyWords() : m_keyWords ); retv->SetDescription( m_description.IsEmpty() ? parent->GetDescription() : m_description ); retv->SetFPFilters( m_fpFilters.IsEmpty() ? parent->GetFPFilters() : m_fpFilters ); + + retv->SetIncludeInBom( parent->GetIncludeInBom() ); + retv->SetIncludeOnBoard( parent->GetIncludeOnBoard() ); + retv->UpdateFieldOrdinals(); } else diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 5a8e375632..3aa2ca8ae8 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -141,13 +141,12 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId, m_prefix = UTIL::GetRefDesPrefix( m_part->GetReferenceField().GetText() ); if( aSheet ) - { SetRef( aSheet, UTIL::GetRefDesUnannotated( m_prefix ) ); - } - // Inherit the include in bill of materials and board netlist settings from library symbol. - m_inBom = aSymbol.GetIncludeInBom(); - m_onBoard = aSymbol.GetIncludeOnBoard(); + // Inherit the include in bill of materials and board netlist settings from flattened + // library symbol. + m_inBom = m_part->GetIncludeInBom(); + m_onBoard = m_part->GetIncludeOnBoard(); m_DNP = false; }