Remove special-case processing of ${REFERENCE} and ${VALUE}.

Fixes https://gitlab.com/kicad/code/kicad/issues/11476

(cherry picked from commit 6b557d8631)
This commit is contained in:
Jeff Young 2022-04-30 23:00:58 +01:00
parent 362eec7ee3
commit 71ea56dea4
1 changed files with 5 additions and 11 deletions

View File

@ -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<EDA_TEXT*>( 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 );