Eeschema, getpart.cpp: fix incorrect call to lib browser
(was not called if a symbol was not previously selected)
This commit is contained in:
parent
fea9d121b7
commit
1aff677562
|
@ -165,9 +165,19 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibrary(
|
|||
return COMPONENT_SELECTION();
|
||||
|
||||
COMPONENT_SELECTION sel;
|
||||
LIB_ID id = dlg.GetSelectedLibId( &sel.Unit );
|
||||
LIB_ID id;
|
||||
|
||||
if( !id.IsValid() ) // Dialog closed by OK button, but no symbol selected
|
||||
if( dlg.IsExternalBrowserSelected() ) // User requested component browser.
|
||||
{
|
||||
sel = SelectComponentFromLibBrowser( aFilter, id, sel.Unit, sel.Convert );
|
||||
id = sel.LibId;
|
||||
}
|
||||
else
|
||||
id = dlg.GetSelectedLibId( &sel.Unit );
|
||||
|
||||
if( !id.IsValid() ) // Dialog closed by OK button,
|
||||
// or the selection by lib browser was requested,
|
||||
// but no symbol selected
|
||||
return COMPONENT_SELECTION();
|
||||
|
||||
if( sel.Unit == 0 )
|
||||
|
@ -176,9 +186,6 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibrary(
|
|||
sel.Fields = dlg.GetFields();
|
||||
sel.LibId = id;
|
||||
|
||||
if( dlg.IsExternalBrowserSelected() ) // User requested component browser.
|
||||
sel = SelectComponentFromLibBrowser( aFilter, id, sel.Unit, sel.Convert );
|
||||
|
||||
if( sel.LibId.IsValid() )
|
||||
{
|
||||
aHistoryList.erase(
|
||||
|
|
Loading…
Reference in New Issue