diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-10-19 14:38:30 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-10-20 06:14:57 -0400 |
commit | eec75ee9d6fef38667a325e40d50b735bb0593ae (patch) | |
tree | e79b8bb0f932beba205bf8a11e6a7b14ca248b2e /gtk/gtkbuilderparser.c | |
parent | 65aa367029188e91260ab27a1b75f716d734677c (diff) | |
download | gtk+-eec75ee9d6fef38667a325e40d50b735bb0593ae.tar.gz |
Cosmetic changes
Line up struct-filling code with the order in the declaration.
Diffstat (limited to 'gtk/gtkbuilderparser.c')
-rw-r--r-- | gtk/gtkbuilderparser.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c index 6b760055c2..417fae2828 100644 --- a/gtk/gtkbuilderparser.c +++ b/gtk/gtkbuilderparser.c @@ -279,7 +279,7 @@ parse_object (GMarkupParseContext *context, "Invalid object type '%s'", object_class); _gtk_builder_prefix_error (data->builder, context, error); return; - } + } } else if (type_func) { @@ -297,8 +297,7 @@ parse_object (GMarkupParseContext *context, return; } } - - if (object_type == G_TYPE_INVALID) + else { error_missing_attribute (data, element_name, "class", error); return; @@ -332,15 +331,13 @@ parse_object (GMarkupParseContext *context, } object_info = g_slice_new0 (ObjectInfo); + object_info->tag.name = element_name; object_info->type = object_type; object_info->oclass = g_type_class_ref (object_type); object_info->id = (internal_id) ? internal_id : g_strdup (object_id); object_info->constructor = g_strdup (constructor); + object_info->parent = (CommonInfo*)child_info; state_push (data, object_info); - object_info->tag.name = element_name; - - if (child_info) - object_info->parent = (CommonInfo*)child_info; line = GPOINTER_TO_INT (g_hash_table_lookup (data->object_ids, object_id)); if (line != 0) @@ -439,12 +436,12 @@ parse_template (GMarkupParseContext *context, ++data->cur_object_level; object_info = g_slice_new0 (ObjectInfo); + object_info->tag.name = element_name; object_info->type = parsed_type; object_info->oclass = g_type_class_ref (parsed_type); object_info->id = g_strdup (object_class); object_info->object = gtk_builder_get_object (data->builder, object_class); state_push (data, object_info); - object_info->tag.name = element_name; line = GPOINTER_TO_INT (g_hash_table_lookup (data->object_ids, object_class)); if (line != 0) @@ -515,11 +512,11 @@ parse_child (ParserData *data, } child_info = g_slice_new0 (ChildInfo); - state_push (data, child_info); child_info->tag.name = element_name; child_info->type = g_strdup (type); child_info->internal_child = g_strdup (internal_child); child_info->parent = (CommonInfo*)object_info; + state_push (data, child_info); object_info->object = builder_construct (data, object_info, error); } @@ -596,15 +593,20 @@ parse_property (ParserData *data, } } + g_markup_parse_context_get_position (data->ctx, &line, &col); + if (bind_source && bind_property) { - BindingInfo *binfo = g_slice_new0 (BindingInfo); + BindingInfo *binfo; + binfo = g_slice_new (BindingInfo); + binfo->target = NULL; binfo->target_pspec = pspec; binfo->source = g_strdup (bind_source); binfo->source_property = g_strdup (bind_property); binfo->flags = bind_flags; - g_markup_parse_context_get_position (data->ctx, &binfo->line, &binfo->col); + binfo->line = line; + binfo->col = col; object_info->bindings = g_slist_prepend (object_info->bindings, binfo); } @@ -616,8 +618,6 @@ parse_property (ParserData *data, return; } - g_markup_parse_context_get_position (data->ctx, &line, &col); - info = g_slice_new (PropertyInfo); info->tag.name = element_name; info->pspec = pspec; |