Merge board properties when appending board.
Fixes https://gitlab.com/kicad/code/kicad/issues/5255
This commit is contained in:
parent
27b047ab3f
commit
95591669f1
|
@ -940,6 +940,9 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
|
||||||
for( auto zone : brd->Zones() )
|
for( auto zone : brd->Zones() )
|
||||||
zone->SetFlags( SKIP_STRUCT );
|
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
|
// Keep also the count of copper layers, to adjust if necessary
|
||||||
int initialCopperLayerCount = brd->GetCopperLayerCount();
|
int initialCopperLayerCount = brd->GetCopperLayerCount();
|
||||||
LSET initialEnabledLayers = brd->GetEnabledLayers();
|
LSET initialEnabledLayers = brd->GetEnabledLayers();
|
||||||
|
@ -969,6 +972,13 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
|
||||||
return 0;
|
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
|
// rebuild nets and ratsnest before any use of nets
|
||||||
brd->BuildListOfNets();
|
brd->BuildListOfNets();
|
||||||
brd->SynchronizeNetsAndNetClasses();
|
brd->SynchronizeNetsAndNetClasses();
|
||||||
|
|
Loading…
Reference in New Issue