From 36c9923227720f45b614c9eb0e6fc5fd532ccc96 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 23 Nov 2015 09:11:20 +0000 Subject: [PATCH 1/1] [MSXML3] Sync with Wine Staging 1.7.55. CORE-10536 svn path=/trunk/; revision=70049 --- reactos/dll/win32/msxml3/domdoc.c | 4 ++-- reactos/dll/win32/msxml3/element.c | 25 ++++++++++++++++++++++++- reactos/dll/win32/msxml3/node.c | 6 ++++-- reactos/dll/win32/msxml3/saxreader.c | 3 ++- reactos/dll/win32/msxml3/xmlparser.idl | 2 +- reactos/media/doc/README.WINE | 2 +- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/msxml3/domdoc.c b/reactos/dll/win32/msxml3/domdoc.c index 6c32bb5a982..670741ec933 100644 --- a/reactos/dll/win32/msxml3/domdoc.c +++ b/reactos/dll/win32/msxml3/domdoc.c @@ -1945,7 +1945,7 @@ static HRESULT WINAPI domdoc_createNode( } xml_name = xmlchar_from_wchar(name); - /* prevent empty href to be allocated */ + /* prevent empty href from being allocated */ href = namespaceURI ? xmlchar_from_wchar(namespaceURI) : NULL; switch(node_type) @@ -1958,7 +1958,7 @@ static HRESULT WINAPI domdoc_createNode( xmlnode = xmlNewDocNode(get_doc(This), NULL, local ? local : xml_name, NULL); - /* allow to create default namespace xmlns= */ + /* allow creating the default namespace xmlns= */ if (local || (href && *href)) { xmlNsPtr ns = xmlNewNs(xmlnode, href, prefix); diff --git a/reactos/dll/win32/msxml3/element.c b/reactos/dll/win32/msxml3/element.c index 84a23a5a7a7..5addf338353 100644 --- a/reactos/dll/win32/msxml3/element.c +++ b/reactos/dll/win32/msxml3/element.c @@ -1182,7 +1182,9 @@ static HRESULT WINAPI domelem_getAttribute( domelem *This = impl_from_IXMLDOMElement( iface ); xmlNodePtr element; xmlChar *xml_name, *xml_value = NULL; + xmlChar *local, *prefix; HRESULT hr = S_FALSE; + xmlNsPtr ns; TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value); @@ -1201,7 +1203,28 @@ static HRESULT WINAPI domelem_getAttribute( if(!xmlValidateNameValue(xml_name)) hr = E_FAIL; else - xml_value = xmlGetNsProp(element, xml_name, NULL); + { + if ((local = xmlSplitQName2(xml_name, &prefix))) + { + if (xmlStrEqual(prefix, BAD_CAST "xmlns")) + { + ns = xmlSearchNs(element->doc, element, local); + if (ns) + xml_value = xmlStrdup(ns->href); + } + else + { + ns = xmlSearchNs(element->doc, element, prefix); + if (ns) + xml_value = xmlGetNsProp(element, local, ns->href); + } + + xmlFree(prefix); + xmlFree(local); + } + else + xml_value = xmlGetNsProp(element, xml_name, NULL); + } heap_free(xml_name); if(xml_value) diff --git a/reactos/dll/win32/msxml3/node.c b/reactos/dll/win32/msxml3/node.c index e4a8ad84784..37bd57b7750 100644 --- a/reactos/dll/win32/msxml3/node.c +++ b/reactos/dll/win32/msxml3/node.c @@ -477,7 +477,7 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT refcount = xmlnode_get_inst_cnt(node_obj); if (refcount) xmldoc_add_refs(before_node_obj->node->doc, refcount); - xmlAddPrevSibling(before_node_obj->node, node_obj->node); + node_obj->node = xmlAddPrevSibling(before_node_obj->node, node_obj->node); if (refcount) xmldoc_release_refs(doc, refcount); node_obj->parent = This->parent; } @@ -489,7 +489,7 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT if (refcount) xmldoc_add_refs(This->node->doc, refcount); /* xmlAddChild doesn't unlink node from previous parent */ xmlUnlinkNode(node_obj->node); - xmlAddChild(This->node, node_obj->node); + node_obj->node = xmlAddChild(This->node, node_obj->node); if (refcount) xmldoc_release_refs(doc, refcount); node_obj->parent = This->iface; } @@ -635,6 +635,8 @@ HRESULT node_has_childnodes(const xmlnode *This, VARIANT_BOOL *ret) HRESULT node_get_owner_doc(const xmlnode *This, IXMLDOMDocument **doc) { + if(!doc) + return E_INVALIDARG; return get_domdoc_from_xmldoc(This->node->doc, (IXMLDOMDocument3**)doc); } diff --git a/reactos/dll/win32/msxml3/saxreader.c b/reactos/dll/win32/msxml3/saxreader.c index ddaba1cfeed..faaf27a7ea3 100644 --- a/reactos/dll/win32/msxml3/saxreader.c +++ b/reactos/dll/win32/msxml3/saxreader.c @@ -668,12 +668,13 @@ static void format_error_message_from_id(saxlocator *This, HRESULT hr) static void update_position(saxlocator *This, BOOL fix_column) { const xmlChar *p = This->pParserCtxt->input->cur-1; + const xmlChar *baseP = This->pParserCtxt->input->base; This->line = xmlSAX2GetLineNumber(This->pParserCtxt); if(fix_column) { This->column = 1; - for(; *p!='\n' && *p!='\r' && p>=This->pParserCtxt->input->base; p--) + for(;p>=baseP && *p!='\n' && *p!='\r'; p--) This->column++; } else diff --git a/reactos/dll/win32/msxml3/xmlparser.idl b/reactos/dll/win32/msxml3/xmlparser.idl index 7f02b149b24..5ede3145db7 100644 --- a/reactos/dll/win32/msxml3/xmlparser.idl +++ b/reactos/dll/win32/msxml3/xmlparser.idl @@ -256,7 +256,7 @@ typedef struct _XML_NODE_INFO ] library XMLPSR { -importlib("stdole32.tlb"); +/* importlib("stdole32.tlb"); */ importlib("stdole2.tlb"); [ diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 93978c6fa54..9ae2572ed93 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -132,7 +132,7 @@ reactos/dll/win32/msvfw32 # Synced to WineStaging-1.7.55 reactos/dll/win32/msvidc32 # Synced to WineStaging-1.7.55 reactos/dll/win32/msxml # Synced to WineStaging-1.7.47 reactos/dll/win32/msxml2 # Synced to WineStaging-1.7.47 -reactos/dll/win32/msxml3 # Synced to WineStaging-1.7.47 +reactos/dll/win32/msxml3 # Synced to WineStaging-1.7.55 reactos/dll/win32/msxml4 # Synced to WineStaging-1.7.47 reactos/dll/win32/msxml6 # Synced to WineStaging-1.7.47 reactos/dll/win32/nddeapi # Synced to WineStaging-1.7.47 -- 2.17.1