Commit d7e7d16b authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

* plugins/gtk+/glade-attributes.c: Fixed mismatching PangoAttributeType with GType,

	closes bug 597045.
parent ffd323a7
......@@ -6,6 +6,9 @@
* gladeui/glade-signal-editor.c: Left align the warning icon and expand the first
row of the signal tree when loading a widget.
* plugins/gtk+/glade-attributes.c: Fixed mismatching PangoAttributeType with GType,
closes bug 597045.
2011-01-12 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-palette.c: Fixed leaking project (set_project NULL when
......
......@@ -148,7 +148,8 @@ GLADE_MAKE_EPROP (GladeEPropAttrs, glade_eprop_attrs)
(type) == EDIT_SPIN ? COLUMN_SPIN_ACTIVE : \
(type) == EDIT_COMBO ? COLUMN_COMBO_ACTIVE: COLUMN_BUTTON_ACTIVE)
static GtkListStore *get_enum_model_for_combo (PangoAttrType type)
static GtkListStore *get_enum_model_for_combo (PangoAttrType type)
{
static GtkListStore *style_store = NULL,
*weight_store = NULL, *variant_store = NULL,
......@@ -521,25 +522,6 @@ glade_gtk_string_from_attr (GladeAttribute * gattr)
return ret;
}
static gint
enum_value_from_string (PangoAttrType type, const gchar * strval)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
gint value = 0;
enum_class = g_type_class_ref (type_from_attr_type (type));
if ((enum_value = g_enum_get_value_by_nick (enum_class, strval)) != NULL)
value = enum_value->value;
else
g_critical ("Couldnt find enum value for %s, type %s",
strval, g_type_name (type_from_attr_type (type)));
g_type_class_unref (enum_class);
return value;
}
GladeAttribute *
glade_gtk_attribute_from_string (PangoAttrType type, const gchar * strval)
{
......@@ -570,10 +552,9 @@ glade_gtk_attribute_from_string (PangoAttrType type, const gchar * strval)
/* Enums ... */
g_value_init (&(gattr->value), type_from_attr_type (type));
g_value_set_enum (&(gattr->value),
enum_value_from_string (type, strval));
glade_utils_enum_value_from_string (type_from_attr_type (type), strval));
break;
case PANGO_ATTR_UNDERLINE:
case PANGO_ATTR_STRIKETHROUGH:
/* Booleans */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment