From 1aff677562ee3ee537a187e3a5d55c2a5d5c95ce Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 23 Nov 2017 12:09:35 +0100 Subject: [PATCH] Eeschema, getpart.cpp: fix incorrect call to lib browser (was not called if a symbol was not previously selected) --- eeschema/getpart.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 4ece3354b8..099b8ce13b 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -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(