Don't overwrite titleblock and pageinfo when appending board.

Fixes https://gitlab.com/kicad/code/kicad/issues/11650
This commit is contained in:
Jeff Young 2022-09-13 16:01:51 +01:00
parent e4c5bc6c66
commit f91487aa36
1 changed files with 6 additions and 0 deletions

View File

@ -1168,6 +1168,9 @@ int PCB_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
std::map<wxString, wxString> oldProperties = brd->GetProperties();
std::map<wxString, wxString> newProperties;
PAGE_INFO oldPageInfo = brd->GetPageSettings();
TITLE_BLOCK oldTitleBlock = brd->GetTitleBlock();
// Keep also the count of copper layers, to adjust if necessary
int initialCopperLayerCount = brd->GetCopperLayerCount();
LSET initialEnabledLayers = brd->GetEnabledLayers();
@ -1219,6 +1222,9 @@ int PCB_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
brd->SetProperties( newProperties );
brd->SetPageSettings( oldPageInfo );
brd->SetTitleBlock( oldTitleBlock );
// rebuild nets and ratsnest before any use of nets
brd->BuildListOfNets();
brd->SynchronizeNetsAndNetClasses();