Nikolay Sivov : msxml3: Fix a ::get_xml() for libxml2 without xmlSaveToBuffer.
Alexandre Julliard
julliard at winehq.org
Fri Nov 12 11:22:32 CST 2010
Module: wine
Branch: master
Commit: 9ec17a841d9a1116f658d24fadae1ba8e4a28beb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ec17a841d9a1116f658d24fadae1ba8e4a28beb
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Nov 11 23:08:33 2010 +0300
msxml3: Fix a ::get_xml() for libxml2 without xmlSaveToBuffer.
---
dlls/msxml3/domdoc.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index e7c15e3..a7e7342 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -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);
More information about the wine-cvs
mailing list