FIX: only invoke fp-lib-table options editor when table not empty.

This commit is contained in:
Dick Hollenbeck 2013-12-31 10:59:33 -06:00
parent bfc72b0183
commit f346727214
1 changed files with 20 additions and 17 deletions

View File

@ -583,28 +583,31 @@ private:
{ {
FP_TBL_MODEL* tbl = cur_model(); FP_TBL_MODEL* tbl = cur_model();
int curRow = getCursorRow(); if( tbl->GetNumberRows() )
ROW& row = tbl->rows[curRow];
wxString result;
const wxString& options = row.GetOptions();
InvokePluginOptionsEditor( this, row.GetNickName(), row.GetType(), options, &result );
if( options != result )
{ {
row.SetOptions( result ); int curRow = getCursorRow();
ROW& row = tbl->rows[curRow];
// all but options: wxString result;
m_cur_grid->AutoSizeColumn( COL_NICKNAME, false ); const wxString& options = row.GetOptions();
m_cur_grid->AutoSizeColumn( COL_URI, false );
m_cur_grid->AutoSizeColumn( COL_TYPE, false );
// On Windows, the grid is not refresh, InvokePluginOptionsEditor( this, row.GetNickName(), row.GetType(), options, &result );
// so force resfresh after a change
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__ #ifdef __WINDOWS__
Refresh(); Refresh();
#endif #endif
}
} }
} }