Skip to content
Snippets Groups Projects
Commit eb13dec2 authored by Jeff Young's avatar Jeff Young :flag_ua:
Browse files

pruneItemLayers() is not the right place to filter refdes & value.

(And we already filter all mandatory fields in
pasteFootprintItemsToFootprintEditor() anyway.)

Also, don't nuke a footprint which contains only fields
during a paste.

Fixes #17937
parent e3d2f338
No related branches found
No related tags found
No related merge requests found
Pipeline #1277860077 passed
......@@ -852,14 +852,7 @@ void PCB_CONTROL::pruneItemLayers( std::vector<BOARD_ITEM*>& aItems )
// NOTE: all traversals from the back as processFPItem() might delete the item
for( int ii = static_cast<int>( fp->Fields().size() ) - 1; ii >= 0; ii-- )
{
PCB_FIELD* field = fp->Fields()[ii];
if( field->GetId() == REFERENCE_FIELD || field->GetId() == VALUE_FIELD )
continue;
processFPItem( fp, field );
}
processFPItem( fp, fp->Fields()[ii] );
for( int ii = static_cast<int>( fp->Pads().size() ) - 1; ii >= 0; ii-- )
processFPItem( fp, fp->Pads()[ii] );
......@@ -870,7 +863,10 @@ void PCB_CONTROL::pruneItemLayers( std::vector<BOARD_ITEM*>& aItems )
for( int ii = static_cast<int>( fp->GraphicalItems().size() ) - 1; ii >= 0; ii-- )
processFPItem( fp, fp->GraphicalItems()[ii] );
if( fp->GraphicalItems().size() || fp->Pads().size() || fp->Zones().size() )
if( fp->Fields().size()
|| fp->GraphicalItems().size()
|| fp->Pads().size()
|| fp->Zones().size() )
{
returnItems.push_back( fp );
}
......@@ -1040,7 +1036,7 @@ int PCB_CONTROL::Paste( const TOOL_EVENT& aEvent )
cancelled = !placeBoardItems( &commit, pastedItems, true, true,
mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
}
else
else // isBoardEditor
{
if( mode == PASTE_MODE::REMOVE_ANNOTATIONS )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment