From b2dc592bf137b2ce5fbd15ab7b6121bbc3c4ae25 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 30 Jul 2020 18:05:15 +0100 Subject: [PATCH] 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 --- pcbnew/tools/pcbnew_control.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 64dcc51b1b..5bbf36c56a 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -837,6 +837,14 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsN for( BOARD_ITEM* item : aItems ) { + if( aIsNew ) + { + const_cast( item->m_Uuid ) = KIID(); + + if( item->Type() == PCB_MODULE_T ) + static_cast( item )->SetPath( KIID_PATH() ); + } + item->SetSelected(); selection.Add( item );