From f8f29b55cbf35f1b10517df2201cfe1d5c76cc4f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 11 Jul 2023 14:51:33 +0100 Subject: [PATCH] Don't promote to sheet parent when the item itself is a sheet. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15167 --- eeschema/sch_commit.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index e3412b66e1..1af999097a 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -73,9 +73,10 @@ COMMIT& SCH_COMMIT::Stage( EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN // If aItem belongs a symbol, sheet or label, the full parent will be saved because undo/redo // does not handle "sub items" modifications. - if( aItem->GetParent() && aItem->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T, - SCH_SHEET_T, - SCH_LABEL_LOCATE_ANY_T } ) ) + if( aItem->Type() != SCH_SHEET_T + && aItem->GetParent() && aItem->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T, + SCH_SHEET_T, + SCH_LABEL_LOCATE_ANY_T } ) ) { aItem->SetFlags( IS_MODIFIED_CHILD ); aItem = aItem->GetParent();