Browse Source

Clean up items which weren't pasted from clipboard.

Fixes https://gitlab.com/kicad/code/kicad/issues/14335
newinvert
Jeff Young 3 years ago
parent
commit
ad5d3d4eba
  1. 15
      pcbnew/tools/pcb_control.cpp

15
pcbnew/tools/pcb_control.cpp

@ -944,6 +944,21 @@ int PCB_CONTROL::Paste( const TOOL_EVENT& aEvent )
}
}
clipBoard->Visit(
[&]( EDA_ITEM* item, void* testData )
{
// Anything still on the clipboard didn't get copied and needs to be
// removed from the pasted groups.
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
PCB_GROUP* parentGroup = boardItem->GetParentGroup();
if( parentGroup )
parentGroup->RemoveItem( boardItem );
return INSPECT_RESULT::CONTINUE;
},
nullptr, GENERAL_COLLECTOR::AllBoardItems );
delete clipBoard;
pruneItemLayers( pastedItems );

Loading…
Cancel
Save