From 362eec7ee3f11d57b2bb19f7c38f4e434513f253 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 26 Apr 2022 20:20:48 +0100 Subject: [PATCH] Update findnext to handle new instance data architecture. Fixes https://gitlab.com/kicad/code/kicad/issues/11424 (cherry picked from commit e0f2a5f07cf2be0a7393b162748b9bfc37104b4e) --- eeschema/tools/sch_editor_control.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index a6ac247ad4..c5f9b5d87e 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -499,18 +499,17 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent ) continue; } - SCH_SCREEN* screen = sheet->LastScreen(); + sheet->UpdateAllScreenReferences(); - item = nextMatch( screen, sheet, nullptr, data ); + item = nextMatch( sheet->LastScreen(), sheet, nullptr, data ); if( item ) { m_frame->Schematic().SetCurrentSheet( *sheet ); - m_frame->GetCurrentSheet().UpdateAllScreenReferences(); - screen->TestDanglingEnds(); + sheet->LastScreen()->TestDanglingEnds(); - m_frame->SetScreen( screen ); + m_frame->SetScreen( sheet->LastScreen() ); m_frame->UpdateHierarchyNavigator(); UpdateFind( ACTIONS::updateFind.MakeEvent() );