diff options
Diffstat (limited to 'widgets/table/e-table-header-utils.c')
-rw-r--r-- | widgets/table/e-table-header-utils.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index d5000a9800..9668250961 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -27,10 +27,12 @@ #include <config.h> #endif +#include "e-table-header-utils.h" + #include <string.h> /* strlen() */ #include <glib.h> #include "e-table-defines.h" -#include "e-table-header-utils.h" +#include <gal/widgets/e-unicode.h> @@ -225,6 +227,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, int inner_x, inner_y; int inner_width, inner_height; GdkGC *gc; + char *text; g_return_if_fail (drawable != NULL); g_return_if_fail (ecol != NULL); @@ -302,6 +305,8 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, /* Pixbuf or label */ + text = e_utf8_to_gtk_string (widget, ecol->text); + if (ecol->is_pixbuf) { int pwidth, pheight; int clip_width, clip_height; @@ -323,7 +328,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, int width; int ypos; - gdk_string_extents (font, ecol->text, NULL, &rbearing, &width, NULL, NULL); + gdk_string_extents (font, text, NULL, &rbearing, &width, NULL, NULL); if (rbearing < inner_width - (pwidth + 1)) { xpos = inner_x + (inner_width - width - (pwidth + 1)) / 2; } @@ -332,7 +337,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, e_table_draw_elided_string (drawable, font, gc, xpos + pwidth + 1, ypos, - ecol->text, inner_width - (xpos - inner_x), FALSE); + text, inner_width - (xpos - inner_x), FALSE); } pixmap = make_composite_pixmap (drawable, gc, @@ -355,8 +360,9 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, e_table_draw_elided_string (drawable, font, gc, inner_x, ypos, - ecol->text, inner_width, TRUE); + text, inner_width, TRUE); } + g_free (text); } /* Computes the length of a string that needs to be trimmed for elision */ |