diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-22 22:47:19 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-22 22:47:19 +0000 |
commit | 51b26f95f3cb88a528f089096d8afeb2d81c2004 (patch) | |
tree | f4bed2fedbbbf26138ec196abe668d41572904f5 /epan/column.c | |
parent | 396d5b4c4c02ea062a144a65c1c644e624063f89 (diff) |
Improved custom columns with custom title.
Fixed a crash when adding an empty custom field.
svn path=/trunk/; revision=24438
Diffstat (limited to 'epan/column.c')
-rw-r--r-- | epan/column.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/epan/column.c b/epan/column.c index a50bcbd93d..a549a3b979 100644 --- a/epan/column.c +++ b/epan/column.c @@ -647,6 +647,16 @@ get_column_title(gint col) { return(cfmt->title); } +gchar * +get_column_custom_field(gint col) { + GList *clp = g_list_nth(prefs.col_list, col); + fmt_data *cfmt; + + cfmt = (fmt_data *) clp->data; + + return(cfmt->custom_field); +} + void build_column_format_array(capture_file *cfile, gboolean reset_fences) { @@ -657,6 +667,11 @@ build_column_format_array(capture_file *cfile, gboolean reset_fences) for (i = 0; i < cfile->cinfo.num_cols; i++) { cfile->cinfo.col_fmt[i] = get_column_format(i); cfile->cinfo.col_title[i] = g_strdup(get_column_title(i)); + if (cfile->cinfo.col_fmt[i] == COL_CUSTOM) { + cfile->cinfo.col_custom_field[i] = g_strdup(get_column_custom_field(i)); + } else { + cfile->cinfo.col_custom_field[i] = NULL; + } cfile->cinfo.fmt_matx[i] = (gboolean *) g_malloc0(sizeof(gboolean) * NUM_COL_FMTS); get_column_format_matches(cfile->cinfo.fmt_matx[i], |