Make sure sheet field parents are up to date

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7251
This commit is contained in:
Jon Evans 2021-01-24 12:12:13 -05:00
parent f353fc448b
commit 09bd66477d
1 changed files with 6 additions and 0 deletions

View File

@ -273,6 +273,12 @@ void SCH_SHEET::SwapData( SCH_ITEM* aItem )
for( SCH_SHEET_PIN* sheetPin : sheet->m_pins )
sheetPin->SetParent( sheet );
for( SCH_FIELD& field : m_fields )
field.SetParent( this );
for( SCH_FIELD& field : sheet->m_fields )
field.SetParent( sheet );
std::swap( m_borderWidth, sheet->m_borderWidth );
std::swap( m_borderColor, sheet->m_borderColor );
std::swap( m_backgroundColor, sheet->m_backgroundColor );