eeschema: fix in populating DC sim settings tab

When filling drop-down list with sources, previous selection should be
saved in local variable and restored if it is still available.
This commit is contained in:
Sylwester Kocjan 2021-08-20 12:10:35 +02:00 committed by Seth Hillbrand
parent 691b53d125
commit eefac5cc59
1 changed files with 2 additions and 2 deletions

View File

@ -392,8 +392,8 @@ void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource )
{
wxString prevSelection;
if( aSource->GetCount() )
aSource->GetString( aSource->GetSelection() );
if( !aSource->IsEmpty() )
prevSelection = aSource->GetString( aSource->GetSelection() );
std::vector<wxString> sourcesList;
bool enableSrcSelection = true;