CADSTAR Sch: Clear symbol of all elements before overwriting with new one
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11378
This commit is contained in:
parent
306dfef7e5
commit
85f6ff48e7
|
@ -1300,6 +1300,13 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
|
||||||
SYMDEF_SCM symbol = Library.SymbolDefinitions.at( aSymdefID );
|
SYMDEF_SCM symbol = Library.SymbolDefinitions.at( aSymdefID );
|
||||||
int gateNumber = getKiCadUnitNumberFromGate( aGateID );
|
int gateNumber = getKiCadUnitNumberFromGate( aGateID );
|
||||||
|
|
||||||
|
// Ensure there are no items on this unit (e.g. if we already previously loaded the symbol from
|
||||||
|
// the part definition)
|
||||||
|
std::vector<LIB_ITEM*> drawItems = aSymbol->GetUnitDrawItems( gateNumber, 0 );
|
||||||
|
|
||||||
|
for( LIB_ITEM* item : drawItems )
|
||||||
|
aSymbol->RemoveDrawItem( item );
|
||||||
|
|
||||||
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
|
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
|
||||||
{
|
{
|
||||||
FIGURE fig = figPair.second;
|
FIGURE fig = figPair.second;
|
||||||
|
|
Loading…
Reference in New Issue