From 1bd72903093c074e95e447654741c3ef082f5b3d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 29 Aug 2020 18:17:57 +0100 Subject: [PATCH] Repair broken logic in ForceKeepAnnotations. Fixes https://gitlab.com/kicad/code/kicad/issues/5382 --- eeschema/tools/sch_editor_control.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 925833a4d3..e69a93d6a1 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1330,7 +1330,6 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) } bool forceKeepAnnotations = false; - bool dropAnnotations = true; if( aEvent.IsAction( &ACTIONS::pasteSpecial ) ) { @@ -1356,21 +1355,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) { loadedItems.push_back( item ); - if( item->Type() == SCH_COMPONENT_T ) - { - if( !dropAnnotations && !forceKeepAnnotations ) - { - for( SCH_ITEM* existingItem : m_frame->GetScreen()->Items() ) - { - if( item->m_Uuid == existingItem->m_Uuid ) - { - dropAnnotations = true; - break; - } - } - } - } - else if( item->Type() == SCH_SHEET_T ) + if( item->Type() == SCH_SHEET_T ) { SCH_SHEET* sheet = static_cast( item ); wxFileName srcFn = sheet->GetFileName(); @@ -1416,7 +1401,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) if( it != currentScreen->GetLibSymbols().end() ) component->SetLibSymbol( new LIB_PART( *it->second ) ); - if( dropAnnotations ) + if( !forceKeepAnnotations ) { const_cast( component->m_Uuid ) = KIID();