From 30928796bd0f3e1a09accef20ee930651e673aa3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 16 Jul 2023 20:19:09 +0100 Subject: [PATCH] Repair new switch-based Global Update Text & Graphics. We were forgetting to handle wire and bus labels. --- .../dialog_global_edit_text_and_graphics.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index ab2bc6b8ea..9639fb0a29 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -494,23 +494,25 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( SCH_COMMIT* aCommit, } case SCH_LINE_T: - { - SCH_LINE* line = static_cast( aItem ); - - if( m_schTextAndGraphics->GetValue() && line->GetLayer() == LAYER_NOTES ) + if( m_schTextAndGraphics->GetValue() && aItem->GetLayer() == LAYER_NOTES ) processItem( aCommit, aSheetPath, aItem ); - else if( m_wires->GetValue() && line->GetLayer() == LAYER_WIRE ) + else if( m_wires->GetValue() && aItem->GetLayer() == LAYER_WIRE ) processItem( aCommit, aSheetPath, aItem ); - else if( m_buses->GetValue() && line->GetLayer() == LAYER_BUS ) + else if( m_buses->GetValue() && aItem->GetLayer() == LAYER_BUS ) processItem( aCommit, aSheetPath, aItem ); break; - } case SCH_LABEL_T: case SCH_GLOBAL_LABEL_T: case SCH_HIER_LABEL_T: case SCH_DIRECTIVE_LABEL_T: + if( m_wires->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_WIRE_T } ) ) + processItem( aCommit, aSheetPath, aItem ); + + if( m_buses->GetValue() && aItem->IsType( { SCH_LABEL_LOCATE_BUS_T } ) ) + processItem( aCommit, aSheetPath, aItem ); + if( m_globalLabels->GetValue() && aItem->Type() == SCH_GLOBAL_LABEL_T ) processItem( aCommit, aSheetPath, aItem );