Don't promote to sheet parent when the item itself is a sheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15167
This commit is contained in:
Jeff Young 2023-07-11 14:51:33 +01:00
parent c3d10084b9
commit f8f29b55cb
1 changed files with 4 additions and 3 deletions

View File

@ -73,7 +73,8 @@ 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,
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 } ) )
{