From 074a265166c7a43554c9945707233d98e38a5c5f Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Tue, 31 Dec 2013 10:59:33 -0600 Subject: [PATCH] FIX: only invoke fp-lib-table options editor when table not empty. --- pcbnew/dialogs/dialog_fp_lib_table.cpp | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index 57d33b6076..0a4d383ea2 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -583,28 +583,31 @@ private: { FP_TBL_MODEL* tbl = cur_model(); - int curRow = getCursorRow(); - ROW& row = tbl->rows[curRow]; - - wxString result; - const wxString& options = row.GetOptions(); - - InvokePluginOptionsEditor( this, row.GetNickName(), row.GetType(), options, &result ); - - if( options != result ) + if( tbl->GetNumberRows() ) { - row.SetOptions( result ); + int curRow = getCursorRow(); + ROW& row = tbl->rows[curRow]; - // all but options: - m_cur_grid->AutoSizeColumn( COL_NICKNAME, false ); - m_cur_grid->AutoSizeColumn( COL_URI, false ); - m_cur_grid->AutoSizeColumn( COL_TYPE, false ); + wxString result; + const wxString& options = row.GetOptions(); - // On Windows, the grid is not refresh, - // so force resfresh after a change + InvokePluginOptionsEditor( this, row.GetNickName(), row.GetType(), options, &result ); + + if( options != result ) + { + row.SetOptions( result ); + + // all but options: + m_cur_grid->AutoSizeColumn( COL_NICKNAME, false ); + m_cur_grid->AutoSizeColumn( COL_URI, false ); + m_cur_grid->AutoSizeColumn( COL_TYPE, false ); + + // On Windows, the grid is not refresh, + // so force resfresh after a change #ifdef __WINDOWS__ - Refresh(); + Refresh(); #endif + } } }