Commit ede820b4 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: Fix crash when a netlist is created, if format is not Spice.

parent 8f2f2668
...@@ -100,6 +100,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -100,6 +100,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
m_CommandStringCtrl = NULL; m_CommandStringCtrl = NULL;
m_TitleStringCtrl = NULL; m_TitleStringCtrl = NULL;
m_IsCurrentFormat = NULL; m_IsCurrentFormat = NULL;
m_AddSubPrefix = NULL;
m_ButtonCancel = NULL; m_ButtonCancel = NULL;
parent->AddPage( this, title, selected ); parent->AddPage( this, title, selected );
...@@ -411,7 +412,9 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event ) ...@@ -411,7 +412,9 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
} }
/* Called when the check box "default format" is clicked /* Called when the check box m_AddSubPrefix
* "default format" is clicked
* ( Spice format only )
*/ */
void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event ) void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event )
{ {
...@@ -420,7 +423,7 @@ void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event ) ...@@ -420,7 +423,7 @@ void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event )
CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
if( CurrPage == NULL ) if( CurrPage == NULL || CurrPage->m_AddSubPrefix == NULL )
return; return;
if( CurrPage->m_AddSubPrefix->IsChecked() ) if( CurrPage->m_AddSubPrefix->IsChecked() )
...@@ -513,8 +516,11 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) ...@@ -513,8 +516,11 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
else else
g_NetListerCommandLine.Empty(); g_NetListerCommandLine.Empty();
bool addSubPrefix = false;
if( CurrPage->m_AddSubPrefix )
addSubPrefix = CurrPage->m_AddSubPrefix->GetValue();
m_Parent->CreateNetlist( CurrPage->m_IdNetType, dlg.GetPath(), g_OptNetListUseNames, m_Parent->CreateNetlist( CurrPage->m_IdNetType, dlg.GetPath(), g_OptNetListUseNames,
CurrPage->m_AddSubPrefix->GetValue() ); addSubPrefix );
WriteCurrentNetlistSetup(); WriteCurrentNetlistSetup();
...@@ -602,8 +608,11 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) ...@@ -602,8 +608,11 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
NETLIST_PAGE_DIALOG* CurrPage; NETLIST_PAGE_DIALOG* CurrPage;
CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); CurrPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage();
bool addSubPrefix = false;
if( CurrPage->m_AddSubPrefix )
addSubPrefix = CurrPage->m_AddSubPrefix->GetValue();
if( ! m_Parent->CreateNetlist( CurrPage->m_IdNetType, fn.GetFullPath(), if( ! m_Parent->CreateNetlist( CurrPage->m_IdNetType, fn.GetFullPath(),
g_OptNetListUseNames,CurrPage->m_AddSubPrefix->GetValue() ) ) g_OptNetListUseNames,addSubPrefix ) )
return; return;
ExecuteFile( this, ExecFile, CommandLine ); ExecuteFile( this, ExecFile, CommandLine );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment