Commit 9ec17a84 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Fix a ::get_xml() for libxml2 without xmlSaveToBuffer.

parent dc9b648f
......@@ -1281,6 +1281,10 @@ static HRESULT WINAPI domdoc_put_dataType(
return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(&This->node), dataTypeName );
}
static int XMLCALL domdoc_get_xml_writecallback(void *ctx, const char *data, int len)
{
return xmlBufferAdd((xmlBufferPtr)ctx, (xmlChar*)data, len) == 0 ? len : 0;
}
static HRESULT WINAPI domdoc_get_xml(
IXMLDOMDocument3 *iface,
......@@ -1305,7 +1309,8 @@ static HRESULT WINAPI domdoc_get_xml(
options = xmldoc_has_decl(get_doc(This)) ? XML_SAVE_NO_DECL : 0;
options |= XML_SAVE_FORMAT;
ctxt = xmlSaveToBuffer(buf, "UTF-8", options);
ctxt = xmlSaveToIO(domdoc_get_xml_writecallback, NULL, buf, "UTF-8", options);
if(!ctxt)
{
xmlBufferFree(buf);
......
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