Repair broken logic in ForceKeepAnnotations.
Fixes https://gitlab.com/kicad/code/kicad/issues/5382
This commit is contained in:
parent
c241b0716a
commit
1bd7290309
|
@ -1330,7 +1330,6 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
bool forceKeepAnnotations = false;
|
bool forceKeepAnnotations = false;
|
||||||
bool dropAnnotations = true;
|
|
||||||
|
|
||||||
if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
|
if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
|
||||||
{
|
{
|
||||||
|
@ -1356,21 +1355,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
loadedItems.push_back( item );
|
loadedItems.push_back( item );
|
||||||
|
|
||||||
if( item->Type() == SCH_COMPONENT_T )
|
if( item->Type() == SCH_SHEET_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 )
|
|
||||||
{
|
{
|
||||||
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
|
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
|
||||||
wxFileName srcFn = sheet->GetFileName();
|
wxFileName srcFn = sheet->GetFileName();
|
||||||
|
@ -1416,7 +1401,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
||||||
if( it != currentScreen->GetLibSymbols().end() )
|
if( it != currentScreen->GetLibSymbols().end() )
|
||||||
component->SetLibSymbol( new LIB_PART( *it->second ) );
|
component->SetLibSymbol( new LIB_PART( *it->second ) );
|
||||||
|
|
||||||
if( dropAnnotations )
|
if( !forceKeepAnnotations )
|
||||||
{
|
{
|
||||||
const_cast<KIID&>( component->m_Uuid ) = KIID();
|
const_cast<KIID&>( component->m_Uuid ) = KIID();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue