Fix a warning in Debug build on Linux, when there is no wizard loaded.

This commit is contained in:
jean-pierre charras 2017-02-01 13:02:08 +01:00
parent fb6de689b9
commit 4d3054599b
1 changed files with 7 additions and 2 deletions

View File

@ -101,8 +101,12 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists()
m_footprintGeneratorsGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); m_footprintGeneratorsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
int curr_row_cnt = m_footprintGeneratorsGrid->GetNumberRows(); int curr_row_cnt = m_footprintGeneratorsGrid->GetNumberRows();
m_footprintGeneratorsGrid->DeleteRows( 0, curr_row_cnt );
m_footprintGeneratorsGrid->InsertRows( 0, n_wizards ); if( curr_row_cnt )
m_footprintGeneratorsGrid->DeleteRows( 0, curr_row_cnt );
if( n_wizards )
m_footprintGeneratorsGrid->InsertRows( 0, n_wizards );
// Put all wizards in the list // Put all wizards in the list
for( int ii = 0; ii < n_wizards; ii++ ) for( int ii = 0; ii < n_wizards; ii++ )
@ -139,6 +143,7 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists()
m_tcSearchPaths->SetValue( message ); m_tcSearchPaths->SetValue( message );
// Display info about scripts: unloadable scripts (due to syntax errors is python source) // Display info about scripts: unloadable scripts (due to syntax errors is python source)
pcbnewGetUnloadableScriptNames( message ); pcbnewGetUnloadableScriptNames( message );
if( message.IsEmpty() ) if( message.IsEmpty() )
{ {
m_tcNotLoaded->SetValue( _( "All footprint generator scripts were loaded" ) ); m_tcNotLoaded->SetValue( _( "All footprint generator scripts were loaded" ) );