Symbol editor: fix assertion attempting to copy an inherited symbol.
Copying or cutting an symbol to the clipboard using the context menu in the library tree requires a root symbol. Inherited symbols must be flattened in order to properly be added to a symbol library. Fixes https://gitlab.com/kicad/code/kicad/issues/4901
This commit is contained in:
parent
11ca21039a
commit
0ab8b9a2d9
|
@ -595,8 +595,9 @@ void LIB_EDIT_FRAME::CopyPartToClipboard()
|
||||||
if( !part )
|
if( !part )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::unique_ptr< LIB_PART> tmp = part->Flatten();
|
||||||
STRING_FORMATTER formatter;
|
STRING_FORMATTER formatter;
|
||||||
SCH_SEXPR_PLUGIN::FormatPart( part, formatter );
|
SCH_SEXPR_PLUGIN::FormatPart( tmp.get(), formatter );
|
||||||
|
|
||||||
auto clipboard = wxTheClipboard;
|
auto clipboard = wxTheClipboard;
|
||||||
wxClipboardLocker clipboardLock( clipboard );
|
wxClipboardLocker clipboardLock( clipboard );
|
||||||
|
|
Loading…
Reference in New Issue