Use get_default_col_size() to get pixel size for string.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31062
f5534014-38df-0310-8fa8-
9805f1628bb7
void new_packet_list_resize_column(gint col)
{
void new_packet_list_resize_column(gint col)
{
GtkTreeViewColumn *column;
gint col_width;
const gchar *long_str;
long_str = packet_list_get_widest_column_string(packetlist, col);
GtkTreeViewColumn *column;
gint col_width;
const gchar *long_str;
long_str = packet_list_get_widest_column_string(packetlist, col);
- if(strcmp("",long_str)==0)
- /* If we get an empty string levae the width unchanged */
+ if(!long_str || strcmp("",long_str)==0)
+ /* If we get an empty string leave the width unchanged */
return;
column = gtk_tree_view_get_column (GTK_TREE_VIEW(packetlist->view), col);
return;
column = gtk_tree_view_get_column (GTK_TREE_VIEW(packetlist->view), col);
- layout = gtk_widget_create_pango_layout(packetlist->view, long_str );
- pango_layout_get_pixel_size(layout, &col_width, NULL);
+ col_width = get_default_col_size (packetlist->view, long_str);
gtk_tree_view_column_set_fixed_width(column, col_width);
gtk_tree_view_column_set_fixed_width(column, col_width);
- g_object_unref(G_OBJECT(layout));