From 25445d9fe07828f42969794511c493d46341d27e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 8 Jul 2023 20:36:00 +0100 Subject: [PATCH] Make sure all items managed by their parent get correct handling in SCH_COMMIT. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15129 --- eeschema/sch_commit.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index c7a09689d0..e3412b66e1 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -71,16 +71,11 @@ COMMIT& SCH_COMMIT::Stage( EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN aItem->ClearFlags( IS_MODIFIED_CHILD ); - // If aItem belongs a symbol, the full symbol will be saved because undo/redo does - // not handle "sub items" modifications. - if( aItem->GetParent() && aItem->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T } ) ) - { - aItem->SetFlags( IS_MODIFIED_CHILD ); - aItem = aItem->GetParent(); - aChangeType = CHT_MODIFY; - } - // Same for fields of a sheet or label - else if( aItem->Type() == SCH_FIELD_T && aItem->GetParent() ) + // 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 } ) ) { aItem->SetFlags( IS_MODIFIED_CHILD ); aItem = aItem->GetParent();