[goffice] GogObject: also check that would-be property type isn't abstract.



commit 02e8449e162c441b6001fb9f5cf070ea63cba7ef
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 19 11:13:29 2015 -0400

    GogObject: also check that would-be property type isn't abstract.

 goffice/graph/gog-object-xml.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/goffice/graph/gog-object-xml.c b/goffice/graph/gog-object-xml.c
index 308c281..a2274d5 100644
--- a/goffice/graph/gog-object-xml.c
+++ b/goffice/graph/gog-object-xml.c
@@ -290,7 +290,7 @@ gogo_dim_start (GsfXMLIn *xin, xmlChar const **attrs)
                g_warning ("unknown type '%s' for dimension `%s' of class `%s'",
                           type_str, dim_str, G_OBJECT_TYPE_NAME (state->obj));
                return;
-       } else if (!g_type_is_a (type, GO_TYPE_DATA)) {
+       } else if (!g_type_is_a (type, GO_TYPE_DATA) || G_TYPE_IS_ABSTRACT (type)) {
                g_warning ("type '%s' is invalid as dimension `%s' of class `%s'",
                           type_str, dim_str, G_OBJECT_TYPE_NAME (state->obj));
                return;
@@ -370,7 +370,7 @@ gogo_prop_start (GsfXMLIn *xin, xmlChar const **attrs)
                        g_warning ("unknown type '%s' for property `%s' of class `%s'",
                                   type_str, prop_str, G_OBJECT_TYPE_NAME (state->obj));
                        return;
-               } else if (!g_type_is_a (type, prop_type)) {
+               } else if (!g_type_is_a (type, prop_type) || G_TYPE_IS_ABSTRACT (type)) {
                        g_warning ("invalid type '%s' for property `%s' of class `%s'",
                                   type_str, prop_str, G_OBJECT_TYPE_NAME (state->obj));
                        return;
@@ -452,7 +452,7 @@ gogo_start (GsfXMLIn *xin, xmlChar const **attrs)
                        res = (GogObject *)gog_plot_new_by_name (type);
                        if (NULL == res)
                                res = (GogObject *)gog_trend_line_new_by_name (type);
-               } else if (g_type_is_a (t, GOG_TYPE_OBJECT))
+               } else if (g_type_is_a (t, GOG_TYPE_OBJECT) && !G_TYPE_IS_ABSTRACT (t))
                        res = g_object_new (t, NULL);
                else
                        res = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]