From a24a63e416f1848ddf5427345e944be51b8386a5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Apr 2023 23:21:15 +0100 Subject: [PATCH] Search in label fields. Fixes https://gitlab.com/kicad/code/kicad/issues/14075 --- eeschema/tools/sch_find_replace_tool.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/sch_find_replace_tool.cpp b/eeschema/tools/sch_find_replace_tool.cpp index 1ce783b7b6..bb0ee60162 100644 --- a/eeschema/tools/sch_find_replace_tool.cpp +++ b/eeschema/tools/sch_find_replace_tool.cpp @@ -142,8 +142,7 @@ SCH_ITEM* SCH_FIND_REPLACE_TOOL::nextMatch( SCH_SCREEN* aScreen, SCH_SHEET_PATH* for( SCH_PIN* pin : cmp->GetPins() ) sorted_items.push_back( pin ); } - - if( item->Type() == SCH_SHEET_T ) + else if( item->Type() == SCH_SHEET_T ) { SCH_SHEET* sheet = static_cast( item ); @@ -153,6 +152,13 @@ SCH_ITEM* SCH_FIND_REPLACE_TOOL::nextMatch( SCH_SCREEN* aScreen, SCH_SHEET_PATH* for( SCH_SHEET_PIN* pin : sheet->GetPins() ) sorted_items.push_back( pin ); } + else if( item->IsType( { SCH_LABEL_LOCATE_ANY_T } ) ) + { + SCH_LABEL_BASE* label = static_cast( item ); + + for( SCH_FIELD& field : label->GetFields() ) + sorted_items.push_back( &field ); + } }; if( selectedOnly )