Commit 678517bb authored by Dom Lachowicz's avatar Dom Lachowicz Committed by Dom Lachowicz

Have libxml2 replace entities for us. This fixes a bug where style

2006-08-22  Dom Lachowicz <cinamod@hotmail.com>

	* rsvg-base.c (rsvg_handle_write_impl): Have libxml2 replace entities
	for us. This fixes a bug where style definitions don't get properly
	expanded, but causes a (2.15.x-only feature) regression when importing
	external ENTITIES.
parent d3fafede
2006-08-22 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-base.c (rsvg_handle_write_impl): Have libxml2 replace entities
for us. This fixes a bug where style definitions don't get properly
expanded, but causes a (2.15.x-only feature) regression when importing
external ENTITIES.
2006-07-27 Dom Lachowicz <cinamod@hotmail.com>
* configure.in: 2.15.90
......
......@@ -795,9 +795,10 @@ rsvg_entity_decl (void *data, const xmlChar *name, int type,
xmlEntityPtr entity;
xmlChar *dupname;
entity = g_new0 (xmlEntity, 1);
entity = xmlMalloc (sizeof(xmlEntity));
memset(entity, 0, sizeof(xmlEntity));
entity->type = XML_ENTITY_DECL;
dupname = (xmlChar *) g_strdup ((const char *)name);
dupname = (xmlChar *) xmlMemStrdup ((const char *)name);
entity->name = dupname;
entity->etype = type;
......@@ -816,8 +817,8 @@ rsvg_entity_decl (void *data, const xmlChar *name, int type,
data = _rsvg_acquire_xlink_href_resource ((const char *)publicId, rsvg_handle_get_base_uri (ctx), NULL);
if (data) {
entity->SystemID = (xmlChar *) g_strdup ((const char *)systemId);
entity->ExternalID = (xmlChar *) g_strdup ((const char *)publicId);
entity->SystemID = (xmlChar *) xmlMemStrdup ((const char *)systemId);
entity->ExternalID = (xmlChar *) xmlMemStrdup ((const char *)publicId);
entity->content = (xmlChar *) xmlMemStrdup ((const char *)data->data);
entity->length = data->len;
......@@ -1009,7 +1010,11 @@ rsvg_handle_write_impl (RsvgHandle *handle,
{
handle->priv->ctxt = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, handle, NULL, 0,
rsvg_handle_get_base_uri (handle));
/* handle->priv->ctxt->replaceEntities = TRUE; */
/* if false, external entities work, but internal ones don't. if true, internal entities
work, but external ones don't. favor internal entities, in order to not cause a
regression */
handle->priv->ctxt->replaceEntities = TRUE;
}
result = xmlParseChunk (handle->priv->ctxt, (char*)buf, count, 0);
......
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