static void sax_information (GsfXMLIn *xin, xmlChar const **attrs) { GnmFT *ft = (GnmFT *)xin->user_state; for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) { if (attr_eq (attrs[0], "author")) gnm_ft_set_author (ft, CXML2C (attrs[1])); else if (attr_eq (attrs[0], "name")) gnm_ft_set_name (ft, CXML2C (attrs[1])); else if (attr_eq (attrs[0], "description")) gnm_ft_set_description (ft, CXML2C (attrs[1])); } }
static void content_start (GsfXMLIn *xin, xmlChar const **attrs) { SheetObject *so = gnm_xml_in_cur_obj (xin); SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so); char const *image_type = NULL, *image_name = NULL; for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) if (attr_eq (attrs[0], "image-type")) image_type = CXML2C (attrs[1]); else if (attr_eq (attrs[0], "name")) image_name = CXML2C (attrs[1]); soi->type = g_strdup (image_type); if (image_name) soi->name = g_strdup (image_name); }
static void gnm_so_path_prep_sax_parser (SheetObject *so, GsfXMLIn *xin, xmlChar const **attrs, G_GNUC_UNUSED GnmConventions const *convs) { static GsfXMLInNode const dtd[] = { GSF_XML_IN_NODE (SOPATH, SOPATH, -1, "SheetObjectPath", GSF_XML_NO_CONTENT, NULL, NULL), GSF_XML_IN_NODE (SOPATH, PATH, -1, "Path", GSF_XML_NO_CONTENT, &sop_sax_path, NULL), GSF_XML_IN_NODE (SOPATH, STYLE, -1, "Style", GSF_XML_NO_CONTENT, &sop_sax_style, NULL), GSF_XML_IN_NODE_END }; static GsfXMLInDoc *doc = NULL; GnmSOPath *sop = GNM_SO_PATH(so); if (NULL == doc) { doc = gsf_xml_in_doc_new (dtd, NULL); gnm_xml_in_doc_dispose_on_exit (&doc); } gsf_xml_in_push_state (xin, doc, NULL, NULL, attrs); for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) if (attr_eq (attrs[0], "Label")) g_object_set (G_OBJECT (sop), "text", attrs[1], NULL); else if (attr_eq (attrs[0], "LabelFormat")) { GOFormat * fmt = go_format_new_from_XL (attrs[1]); if (go_format_is_markup (fmt)) g_object_set (G_OBJECT (sop), "markup", go_format_get_markup (fmt), NULL); go_format_unref (fmt); } else if (attr_eq (attrs[0], "Path")) { GOPath *path = go_path_new_from_svg (attrs[1]); if (path) { g_object_set (G_OBJECT (sop), "path", path, NULL); go_path_free (path); } } }
static void sop_sax_path (GsfXMLIn *xin, xmlChar const **attrs) { SheetObject *so = gnm_xml_in_cur_obj (xin); GnmSOPath *sop = GNM_SO_PATH (so); GOPath *path; g_return_if_fail (sop->path == NULL); if (sop->paths == NULL) sop->paths = g_ptr_array_new_with_free_func ((GDestroyNotify) go_path_free); for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) if (attr_eq (attrs[0], "Path")) { path = go_path_new_from_svg (attrs[1]); if (path) g_ptr_array_add (sop->paths, path); /* we need to update the extents, not optimal */ g_ptr_array_ref (sop->paths); g_object_set (G_OBJECT (sop), "paths", sop->paths, NULL); g_ptr_array_unref (sop->paths); return; } }
void testTortureExecute (void) { attr_eq (arg0, arg1); return; }