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
This commit is contained in:
jean-pierre charras 2023-05-27 10:13:43 +02:00
parent 4ed267394a
commit f2f014a27c
1 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* 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
@ -486,7 +486,11 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol( const wxString& inheritFromSymbolName )
// 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() );
}