diff options
author | Kalev Lember <kalevlember@gmail.com> | 2013-06-07 14:12:14 +0200 |
---|---|---|
committer | Kalev Lember <kalevlember@gmail.com> | 2013-06-08 10:54:25 +0200 |
commit | a37450110b74605041318a76dac51838953d406d (patch) | |
tree | 38f6926405adc3cc6e43dcff386b5391a0d0df35 /gtk/gtkcomboboxtext.c | |
parent | 6b6334803785cc658709a1ff419d2dcb38d0c27f (diff) | |
download | gtk+-a37450110b74605041318a76dac51838953d406d.tar.gz |
Fix string allocation handling with GtkBuilder translations
Use g_string_assign to avoid issues with assigning GString's internal
buffer back to the same string. This can happen when no translations are
available and _gtk_builder_parser_translate returns back the same
pointer that was passed in.
This fixes a regression from commit e9f182e37a7f6e2dc339054841a3c9f930f
that caused GtkComboBoxText <items> from GtkBuilder to show up empty if
no translations are available.
https://bugzilla.gnome.org/show_bug.cgi?id=700629
Diffstat (limited to 'gtk/gtkcomboboxtext.c')
-rw-r--r-- | gtk/gtkcomboboxtext.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gtk/gtkcomboboxtext.c b/gtk/gtkcomboboxtext.c index a81c8441e8..0de9124b07 100644 --- a/gtk/gtkcomboboxtext.c +++ b/gtk/gtkcomboboxtext.c @@ -240,8 +240,7 @@ item_end_element (GMarkupParseContext *context, translated = _gtk_builder_parser_translate (data->domain, data->context, data->string->str); - g_string_set_size (data->string, 0); - g_string_append (data->string, translated); + g_string_assign (data->string, translated); } gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (data->object), data->id, data->string->str); |