From 71ea56dea4fab5e67a2197fb90f2057d32bd2422 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 30 Apr 2022 23:00:58 +0100 Subject: [PATCH] Remove special-case processing of ${REFERENCE} and ${VALUE}. Fixes https://gitlab.com/kicad/code/kicad/issues/11476 (cherry picked from commit 6b557d863191ac3e5a9af451b5b46190227a7a90) --- .../dialog_global_edit_text_and_graphics.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index 9281f275ed..977ce52d9b 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -427,20 +427,14 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() // Go through all other footprint items for( BOARD_ITEM* boardItem : fp->GraphicalItems() ) { - if( boardItem->Type() == PCB_FP_TEXT_T ) - { - // We are guaranteed to always get an EDA_TEXT in this statement, but we must - // use the dynamic_cast to move through the type tree anyway. - const wxString text = dynamic_cast( boardItem )->GetText(); + KICAD_T itemType = boardItem->Type(); - if( m_references->GetValue() && text == wxT( "${REFERENCE}" ) ) - visitItem( commit, boardItem ); - else if( m_values->GetValue() && text == wxT( "${VALUE}" ) ) - visitItem( commit, boardItem ); - else if( m_otherFields->GetValue() ) + if( itemType == PCB_FP_TEXT_T ) + { + if( m_otherFields->GetValue() ) visitItem( commit, boardItem ); } - else if( boardItem->Type() == PCB_FP_SHAPE_T ) + else if( itemType == PCB_FP_SHAPE_T ) { if( m_footprintGraphics->GetValue() ) visitItem( commit, boardItem );