From 396e531e7c4646a9e91c28e4c2cf74caf161f3ef Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 23 Jul 2024 11:36:30 +0100 Subject: [PATCH] Cleanup. --- pcbnew/footprint.cpp | 2 -- pcbnew/pcb_edit_frame.cpp | 19 +++---------------- pcbnew/undo_redo.cpp | 8 +++----- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index f31985af46..1fe68644a5 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -789,8 +789,6 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode ) { case PCB_FIELD_T: { - PCB_FIELD* field = static_cast( aBoardItem ); - for( auto it = m_fields.begin(); it != m_fields.end(); ++it ) { if( *it == aBoardItem ) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 0922e93a4c..c51c8e0bbe 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -2354,22 +2354,9 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, if( reset3DModels ) { // We've replaced the existing footprint with the library one, so the 3D models are - // already reset. Just set the aUpdated flag if appropriate. - if( aNew->Models().size() != aExisting->Models().size() ) - { - *aUpdated = true; - } - else - { - for( size_t ii = 0; ii < aNew->Models().size(); ++ii ) - { - if( aNew->Models()[ii] != aExisting->Models()[ii] ) - { - *aUpdated = true; - break; - } - } - } + // already reset. + // + // We only have to do anything if reset3DModels is *not* set.... } else { diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index cb355607d1..4a1606bfdb 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -432,15 +432,13 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) { case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */ { - BOARD_ITEM* item = (BOARD_ITEM*) eda_item; - BOARD_ITEM_CONTAINER* parent = GetBoard(); + BOARD_ITEM* item = (BOARD_ITEM*) eda_item; if( item->GetParentFootprint() ) { - // We need the current item and it's parent, which may be different from what - // was stored if we're multiple frames up the undo stack. + // We need the current item, which may be different from what was stored if + // we're multiple frames up the undo stack. item = GetBoard()->GetItem( item->m_Uuid ); - parent = item->GetParentFootprint(); } BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );