From 67b5e86cc4a1cfe3276ad714408bd8c24afc1ff0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 22 Apr 2024 17:36:24 +0100 Subject: [PATCH] Default to target lib when no lib tree sel exists. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17808 (cherry picked from commit f51d227dc7352e8f05cc6daa5c72a2c7da775717) --- eeschema/tools/symbol_editor_control.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 078cddc9b6..71923a811a 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -172,8 +172,8 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) { SYMBOL_EDIT_FRAME* editFrame = static_cast( m_frame ); - LIB_ID sel = editFrame->GetTreeLIBID(); - const wxString& libName = sel.GetLibNickname(); + LIB_ID target = editFrame->GetTargetLibId(); + const wxString& libName = target.GetLibNickname(); wxString msg; if( libName.IsEmpty() ) @@ -196,7 +196,7 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) } else if( aEvent.IsAction( &EE_ACTIONS::deriveFromExistingSymbol ) ) { - editFrame->CreateNewSymbol( sel.GetLibItemName() ); + editFrame->CreateNewSymbol( target.GetLibItemName() ); } else if( aEvent.IsAction( &EE_ACTIONS::importSymbol ) ) {