Default to target lib when no lib tree sel exists.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17808
This commit is contained in:
parent
e8be782687
commit
f51d227dc7
|
@ -192,8 +192,8 @@ int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
SYMBOL_EDIT_FRAME* editFrame = static_cast<SYMBOL_EDIT_FRAME*>( 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() )
|
||||
|
@ -216,7 +216,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 ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue