From 5596790a6ea2b83977bc7e7c18a55343062978c8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 27 May 2023 10:13:43 +0200 Subject: [PATCH] Symbol editor: ensure a new derived symbol has the correct DeMorgan option displayed. Derived symbols use the same graphics as their parent, so ensure the parent is used to enable/disable the DeMorgan option and tool in toolbar Fixes #13739 https://gitlab.com/kicad/code/kicad/-/issues/13739 --- eeschema/symbol_editor/symbol_editor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 3c78bae196..50dc9ea973 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2008 Wayne Stambaugh - * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -457,7 +457,11 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol() // must be called after loadSymbol, that calls SetShowDeMorgan, but // because the symbol is empty,it looks like it has no alternate body - SetShowDeMorgan( dlg.GetAlternateBodyStyle() ); + // and a derived symbol inherits its parent body. + if( !new_symbol.GetParent().lock() ) + SetShowDeMorgan( dlg.GetAlternateBodyStyle() ); + else + SetShowDeMorgan( new_symbol.HasConversion() ); }