[PATCH 1/2] Fix a ::get_xml() for libxml2 without xmlSaveToBuffer

Nikolay Sivov nsivov at codeweavers.com
Thu Nov 11 14:08:33 CST 2010


---
 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);
-- 
1.5.6.5



--------------070609060404020608030909--



More information about the wine-patches mailing list