From 466536d509ac2d9f35d9a841c44ca0b57d8cb79e Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Tue, 22 Jun 2021 21:41:50 +0100 Subject: [PATCH] Make sure hierarchy is up to date before checking duplicate sheet names Fixes https://gitlab.com/kicad/code/kicad/-/issues/8654 --- eeschema/tools/sch_editor_control.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index d0f1137450..69b6c0c710 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1623,6 +1623,9 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) number = baseName.Last() + number; baseName.RemoveLast(); } + // Update hierarchy to include any other sheets we already added, avoiding + // duplicate sheet names + hierarchy = m_frame->Schematic().GetSheets(); //@todo: it might be better to just iterate through the sheet names // in this screen instead of the whole hierarchy.