Make sure copied SCH_PINs get their LIB_PIN pointers set.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15536
This commit is contained in:
Jeff Young 2023-08-29 12:29:30 +01:00
parent d7a3c35f56
commit 9fae110031
1 changed files with 5 additions and 1 deletions

View File

@ -190,8 +190,12 @@ SCH_SYMBOL::SCH_SYMBOL( const SCH_SYMBOL& aSymbol ) :
m_pins.clear();
// Copy (and re-parent) the pins
for( const std::unique_ptr<SCH_PIN>& pin : aSymbol.m_pins )
m_pins.emplace_back( std::make_unique<SCH_PIN>( this, pin->GetNumber(), pin->GetAlt() ) );
{
m_pins.emplace_back( std::make_unique<SCH_PIN>( *pin ) );
m_pins.back()->SetParent( this );
}
m_fieldsAutoplaced = aSymbol.m_fieldsAutoplaced;
m_schLibSymbolName = aSymbol.m_schLibSymbolName;