Clear UUID and path when pasting board items.

Fixes https://gitlab.com/kicad/code/kicad/issues/4992

Fixes https://gitlab.com/kicad/code/kicad/issues/4041
This commit is contained in:
Jeff Young 2020-07-30 18:05:15 +01:00
parent 577c1be391
commit b2dc592bf1
1 changed files with 8 additions and 0 deletions

View File

@ -837,6 +837,14 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsN
for( BOARD_ITEM* item : aItems )
{
if( aIsNew )
{
const_cast<KIID&>( item->m_Uuid ) = KIID();
if( item->Type() == PCB_MODULE_T )
static_cast<MODULE*>( item )->SetPath( KIID_PATH() );
}
item->SetSelected();
selection.Add( item );