From 0ab8b9a2d91a3142d5f3cad789716978a7360594 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 15 Jul 2020 20:57:17 -0400 Subject: [PATCH] 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 --- eeschema/libedit/libedit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eeschema/libedit/libedit.cpp b/eeschema/libedit/libedit.cpp index aee1505f05..b02a0c87fa 100644 --- a/eeschema/libedit/libedit.cpp +++ b/eeschema/libedit/libedit.cpp @@ -595,8 +595,9 @@ void LIB_EDIT_FRAME::CopyPartToClipboard() if( !part ) return; + std::unique_ptr< LIB_PART> tmp = part->Flatten(); STRING_FORMATTER formatter; - SCH_SEXPR_PLUGIN::FormatPart( part, formatter ); + SCH_SEXPR_PLUGIN::FormatPart( tmp.get(), formatter ); auto clipboard = wxTheClipboard; wxClipboardLocker clipboardLock( clipboard );