Merge board properties when appending board.

Fixes https://gitlab.com/kicad/code/kicad/issues/5255
This commit is contained in:
Jeff Young 2020-08-19 19:29:09 +01:00
parent 27b047ab3f
commit 95591669f1
1 changed files with 10 additions and 0 deletions

View File

@ -940,6 +940,9 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
for( auto zone : brd->Zones() )
zone->SetFlags( SKIP_STRUCT );
std::map<wxString, wxString> oldProperties = brd->GetProperties();
std::map<wxString, wxString> newProperties;
// Keep also the count of copper layers, to adjust if necessary
int initialCopperLayerCount = brd->GetCopperLayerCount();
LSET initialEnabledLayers = brd->GetEnabledLayers();
@ -969,6 +972,13 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
return 0;
}
newProperties = brd->GetProperties();
for( const std::pair<const wxString, wxString>& prop : oldProperties )
newProperties[ prop.first ] = prop.second;
brd->SetProperties( newProperties );
// rebuild nets and ratsnest before any use of nets
brd->BuildListOfNets();
brd->SynchronizeNetsAndNetClasses();