Updated msxml3-element_props patchset

Add missing patch.
This commit is contained in:
Alistair Leslie-Hughes
2025-07-08 15:54:52 +10:00
parent 3e94d12465
commit 784382204b

View File

@@ -0,0 +1,97 @@
From 2135156d666a6a7a779326b7f1fdcbd2a8d58c8a Mon Sep 17 00:00:00 2001
From: Spencer Wallace <spencerwallace@esri.com>
Date: Mon, 24 Feb 2025 13:33:18 -0800
Subject: [PATCH] msxml3: Correct looping of Document Element properties.
---
dlls/msxml3/element.c | 2 ++
dlls/msxml3/tests/domdoc.c | 53 ++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c
index 0fe72dcef9c..3e3c2d06169 100644
--- a/dlls/msxml3/element.c
+++ b/dlls/msxml3/element.c
@@ -1812,6 +1812,8 @@ static HRESULT domelem_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode *
*item = create_node( (xmlNodePtr) curr );
return S_OK;
}
+
+ ++attrIndex;
}
if (!node->nsDef)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index dcb83f781ba..84a1f330582 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -10224,6 +10224,15 @@ static void test_get_attributes(void)
L"xmlns:dcterms",
L"xmlns:foaf"
};
+ const WCHAR *attributes[] =
+ {
+ L"rdf:about",
+ L"dcterms:created",
+ L"xmlns:oslc_am",
+ L"xmlns:rdf",
+ L"xmlns:dcterms",
+ L"xmlns:foaf"
+ };
const get_attributes_t *entry = get_attributes;
IXMLDOMNamedNodeMap *map;
IXMLDOMDocument *doc, *doc2;
@@ -10505,6 +10514,50 @@ static void test_get_attributes(void)
IXMLDOMDocument_Release(doc);
+ str = SysAllocString(L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ L"<rdf:RDF rdf:about=\"foo\""
+ L" dcterms:created=\"2025\""
+ L" xmlns:oslc_am=\"http://open-services.net/ns/am#\""
+ L" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\""
+ L" xmlns:dcterms=\"http://purl.org/dc/terms/\""
+ L" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" >"
+ L"</rdf:RDF>");
+
+ doc = create_document(&IID_IXMLDOMDocument2);
+
+ hr = IXMLDOMDocument_loadXML(doc, str, &b);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(b == VARIANT_TRUE, "got %d\n", b);
+
+ hr = IXMLDOMDocument_get_documentElement(doc, &elem);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+
+ hr = IXMLDOMElement_get_attributes(elem, &map);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+
+ length = -1;
+ hr = IXMLDOMNamedNodeMap_get_length(map, &length);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(length == 6, "length %#lx.\n", length);
+
+ for(i=0; i < length; i++)
+ {
+ hr = IXMLDOMNamedNodeMap_get_item(map, i, &node2);
+ ok( hr == S_OK, "Unexpected hr %#lx (%ld).\n", hr, i);
+
+ hr = IXMLDOMNode_get_nodeName(node2, &str);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!lstrcmpW(str, attributes[i]), "got %s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
+
+ IXMLDOMNode_Release(node2);
+ }
+
+ IXMLDOMNamedNodeMap_Release(map);
+ IXMLDOMElement_Release(elem);
+
+ IXMLDOMDocument_Release(doc);
+
free_bstrs();
}
--
2.47.2