Re: [PATCH] libgoffice should doesn't pass correct type to gsf_xml_gvalue_from_str()



On Fri, Aug 10, 2007 at 04:21:05PM +0200, Christian Neumair wrote:
gsf_xml_gvalue_from_str() must know the precise type for G_TYPE_ENUM-
and G_TYPE_FLAGS-derived types, and not just its fundamental type. Thus,
goffice shouldn't pass the fundamental type but the actual object type
to gsf_xml_gvalue_from_str(). Otherwise, libgsf can't read enums and
flags from XML files.

Proposed patch attached.

-- 
Christian Neumair <cneumair gnome org>

Index: goffice/graph/gog-object-xml.c
===================================================================
--- goffice/graph/gog-object-xml.c    (Revision 1789)
+++ goffice/graph/gog-object-xml.c    (Arbeitskopie)
@@ -539,7 +539,7 @@ gogo_prop_end (GsfXMLIn *xin, G_GNUC_UNU
                      return;
              }
 
-             if (!gsf_xml_gvalue_from_str (&val, prop_ftype, content)) {
+             if (!gsf_xml_gvalue_from_str (&val, prop_type, content)) {
                      g_warning ("could not convert string to type `%s' for property `%s'",
                                 g_type_name (prop_type), state->prop_spec->name);
                      return;

Please commit to trunk and the 0.4 branch.



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