diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2006-12-11 20:09:04 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2006-12-11 20:09:04 +0000 |
commit | 41c5011f5bdc89c097b5026bd3e46dfe2bb60282 (patch) | |
tree | 9acc071303468be7ca7b6775d41afdcb1ef3ed85 /epan/column.c | |
parent | fdfd0be5bdb28eea8765e354e9d6b0d9015bc160 (diff) |
Add a new function to build column widths based not only on the max
width that is hard-coded in get_column_longest_string(), but also on the
width of the user specified title of the column (in case it is wider.)
svn path=/trunk/; revision=20117
Diffstat (limited to 'epan/column.c')
-rw-r--r-- | epan/column.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/column.c b/epan/column.c index 789f3ecc54..85fe8212a5 100644 --- a/epan/column.c +++ b/epan/column.c @@ -415,6 +415,18 @@ get_timestamp_column_longest_string(gint type, gint precision) return ""; } +/* Returns the longer string of the column title or the hard-coded width of + * its contents for building the packet list layout. */ +const gchar * +get_column_width_string(gint format, gint col) +{ + if(strlen(get_column_longest_string(format)) > + strlen(get_column_title(col))) + return get_column_longest_string(format); + else + return get_column_title(col); +} + /* Returns a string representing the longest possible value for a particular column type. |