Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dfc5a00c
Commit
dfc5a00c
authored
Oct 11, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Oct 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implementation of IXMLDOMNamedNodeMap::removeNamedItem.
parent
c08ec04d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
2 deletions
+120
-2
nodemap.c
dlls/msxml3/nodemap.c
+34
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+86
-0
No files found.
dlls/msxml3/nodemap.c
View file @
dfc5a00c
...
...
@@ -283,8 +283,40 @@ static HRESULT WINAPI xmlnodemap_removeNamedItem(
BSTR
name
,
IXMLDOMNode
**
namedItem
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
xmlnodemap
*
This
=
impl_from_IXMLDOMNamedNodeMap
(
iface
);
xmlChar
*
element_name
;
xmlAttrPtr
attr
,
attr_copy
;
xmlNodePtr
node
;
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_w
(
name
),
namedItem
);
if
(
!
name
)
return
E_INVALIDARG
;
node
=
xmlNodePtr_from_domnode
(
This
->
node
,
0
);
if
(
!
node
)
return
E_FAIL
;
element_name
=
xmlChar_from_wchar
(
name
);
attr
=
xmlHasNsProp
(
node
,
element_name
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
element_name
);
if
(
!
attr
)
{
if
(
namedItem
)
*
namedItem
=
NULL
;
return
S_FALSE
;
}
if
(
namedItem
)
{
attr_copy
=
xmlCopyProp
(
NULL
,
attr
);
attr_copy
->
doc
=
node
->
doc
;
*
namedItem
=
create_node
(
(
xmlNodePtr
)
attr_copy
);
}
xmlRemoveProp
(
attr
);
return
S_OK
;
}
static
HRESULT
WINAPI
xmlnodemap_get_item
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
dfc5a00c
...
...
@@ -1985,6 +1985,91 @@ static void test_replaceChild(void)
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_removeNamedItem
(
void
)
{
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
IXMLDOMNode
*
pr_node
,
*
removed_node
,
*
removed_node2
;
IXMLDOMNodeList
*
root_list
;
IXMLDOMNamedNodeMap
*
pr_attrs
;
VARIANT_BOOL
b
;
BSTR
str
;
long
len
;
HRESULT
r
;
r
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
if
(
r
!=
S_OK
)
return
;
str
=
SysAllocString
(
szComplete4
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMElement_get_childNodes
(
element
,
&
root_list
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_item
(
root_list
,
1
,
&
pr_node
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMNode_get_attributes
(
pr_node
,
&
pr_attrs
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMNamedNodeMap_get_length
(
pr_attrs
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
len
==
3
,
"length %ld
\n
"
,
len
);
removed_node
=
(
void
*
)
0xdeadbeef
;
r
=
IXMLDOMNamedNodeMap_removeNamedItem
(
pr_attrs
,
NULL
,
&
removed_node
);
ok
(
r
==
E_INVALIDARG
,
"ret %08x
\n
"
,
r
);
ok
(
removed_node
==
(
void
*
)
0xdeadbeef
,
"removed_node == %p
\n
"
,
removed_node
);
removed_node
=
(
void
*
)
0xdeadbeef
;
str
=
SysAllocString
(
szvr
);
r
=
IXMLDOMNamedNodeMap_removeNamedItem
(
pr_attrs
,
str
,
&
removed_node
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
removed_node2
=
(
void
*
)
0xdeadbeef
;
r
=
IXMLDOMNamedNodeMap_removeNamedItem
(
pr_attrs
,
str
,
&
removed_node2
);
ok
(
r
==
S_FALSE
,
"ret %08x
\n
"
,
r
);
ok
(
removed_node2
==
NULL
,
"removed_node == %p
\n
"
,
removed_node2
);
r
=
IXMLDOMNamedNodeMap_get_length
(
pr_attrs
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
len
==
2
,
"length %ld
\n
"
,
len
);
r
=
IXMLDOMNamedNodeMap_setNamedItem
(
pr_attrs
,
removed_node
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
IXMLDOMNode_Release
(
removed_node
);
r
=
IXMLDOMNamedNodeMap_get_length
(
pr_attrs
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
len
==
3
,
"length %ld
\n
"
,
len
);
r
=
IXMLDOMNamedNodeMap_removeNamedItem
(
pr_attrs
,
str
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMNamedNodeMap_get_length
(
pr_attrs
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
ok
(
len
==
2
,
"length %ld
\n
"
,
len
);
r
=
IXMLDOMNamedNodeMap_removeNamedItem
(
pr_attrs
,
str
,
NULL
);
ok
(
r
==
S_FALSE
,
"ret %08x
\n
"
,
r
);
SysFreeString
(
str
);
IXMLDOMNamedNodeMap_Release
(
pr_attrs
);
IXMLDOMNode_Release
(
pr_node
);
IXMLDOMNodeList_Release
(
root_list
);
IXMLDOMElement_Release
(
element
);
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_XMLHTTP
(
void
)
{
static
const
WCHAR
wszBody
[]
=
{
'm'
,
'o'
,
'd'
,
'e'
,
'='
,
'T'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -3686,6 +3771,7 @@ START_TEST(domdoc)
test_get_childNodes
();
test_removeChild
();
test_replaceChild
();
test_removeNamedItem
();
test_XMLHTTP
();
test_IXMLDOMDocument2
();
test_XPath
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment