standard_element_end(): Extract this function from sax_end_element_cb()

This makes sax_end_element_cb() more symmetrical to sax_start_element_cb().
parent 2cecd9bd
......@@ -583,27 +583,10 @@ sax_start_element_cb (void *data, const xmlChar * name, const xmlChar ** atts)
}
static void
sax_end_element_cb (void *data, const xmlChar * xmlname)
standard_element_end (RsvgLoad *load, const char *name)
{
RsvgLoad *load = data;
const char *name = (const char *) xmlname;
if (load->xml.handler_nest > 0 && load->xml.handler != NULL) {
load->xml.handler->end_element (load->xml.handler, name);
load->xml.handler_nest--;
} else {
const char *tempname;
RsvgNode *current_node;
for (tempname = name; *tempname != '\0'; tempname++)
if (*tempname == ':')
name = tempname + 1;
if (load->xml.handler != NULL) {
load->xml.handler->free (load->xml.handler);
load->xml.handler = NULL;
}
current_node = rsvg_xml_state_get_current_node (load->xml.rust_state);
if (current_node) {
......@@ -621,6 +604,30 @@ sax_end_element_cb (void *data, const xmlChar * xmlname)
}
current_node = rsvg_node_unref (current_node);
}
static void
sax_end_element_cb (void *data, const xmlChar * xmlname)
{
RsvgLoad *load = data;
const char *name = (const char *) xmlname;
if (load->xml.handler_nest > 0 && load->xml.handler != NULL) {
load->xml.handler->end_element (load->xml.handler, name);
load->xml.handler_nest--;
} else {
const char *tempname;
for (tempname = name; *tempname != '\0'; tempname++)
if (*tempname == ':')
name = tempname + 1;
if (load->xml.handler != NULL) {
load->xml.handler->free (load->xml.handler);
load->xml.handler = NULL;
}
standard_element_end (load, name);
}
}
......
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