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
187ab1c0
Commit
187ab1c0
authored
Jul 10, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Jul 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement removeChild.
parent
dfd22085
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
6 deletions
+95
-6
node.c
dlls/msxml3/node.c
+32
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+63
-4
No files found.
dlls/msxml3/node.c
View file @
187ab1c0
...
@@ -444,8 +444,38 @@ static HRESULT WINAPI xmlnode_removeChild(
...
@@ -444,8 +444,38 @@ static HRESULT WINAPI xmlnode_removeChild(
IXMLDOMNode
*
childNode
,
IXMLDOMNode
*
childNode
,
IXMLDOMNode
**
oldChild
)
IXMLDOMNode
**
oldChild
)
{
{
FIXME
(
"
\n
"
);
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
return
E_NOTIMPL
;
xmlNode
*
ancestor
,
*
child_node_ptr
;
HRESULT
hr
;
IXMLDOMNode
*
child
;
TRACE
(
"%p->(%p, %p)
\n
"
,
This
,
childNode
,
oldChild
);
*
oldChild
=
NULL
;
hr
=
IXMLDOMNode_QueryInterface
(
childNode
,
&
IID_IXMLDOMNode
,
(
LPVOID
)
&
child
);
if
(
FAILED
(
hr
))
return
hr
;
child_node_ptr
=
ancestor
=
impl_from_IXMLDOMNode
(
child
)
->
node
;
while
(
ancestor
->
parent
)
{
if
(
ancestor
->
parent
==
This
->
node
)
break
;
ancestor
=
ancestor
->
parent
;
}
if
(
!
ancestor
->
parent
)
{
WARN
(
"childNode %p is not a child of %p
\n
"
,
childNode
,
iface
);
IXMLDOMNode_Release
(
child
);
return
E_INVALIDARG
;
}
xmlUnlinkNode
(
child_node_ptr
);
IXMLDOMNode_Release
(
child
);
IXMLDOMNode_AddRef
(
childNode
);
*
oldChild
=
childNode
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
xmlnode_appendChild
(
static
HRESULT
WINAPI
xmlnode_appendChild
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
187ab1c0
...
@@ -59,6 +59,11 @@ static const WCHAR szComplete4[] = {
...
@@ -59,6 +59,11 @@ static const WCHAR szComplete4[] = {
'f'
,
'n'
,
'2'
,
'.'
,
't'
,
'x'
,
't'
,
'\n'
,
'f'
,
'n'
,
'2'
,
'.'
,
't'
,
'x'
,
't'
,
'\n'
,
'<'
,
'/'
,
'p'
,
'r'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'p'
,
'r'
,
'>'
,
'\n'
,
'<'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'<'
,
'/'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'\n'
,
'<'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'<'
,
'/'
,
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
'>'
,
'\n'
,
'<'
,
'f'
,
'o'
,
'>'
,
'\n'
,
'<'
,
'b'
,
'a'
,
'>'
,
'\n'
,
'f'
,
'1'
,
'\n'
,
'<'
,
'/'
,
'b'
,
'a'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'f'
,
'o'
,
'>'
,
'\n'
,
'<'
,
'/'
,
'l'
,
'c'
,
'>'
,
'\n'
,
0
'<'
,
'/'
,
'l'
,
'c'
,
'>'
,
'\n'
,
0
};
};
static
const
WCHAR
szComplete5
[]
=
{
static
const
WCHAR
szComplete5
[]
=
{
...
@@ -517,7 +522,7 @@ todo_wine
...
@@ -517,7 +522,7 @@ todo_wine
{
{
r
=
IXMLDOMNodeList_get_length
(
list
,
&
count
);
r
=
IXMLDOMNodeList_get_length
(
list
,
&
count
);
ok
(
r
==
S_OK
,
"get_length returns %08lx
\n
"
,
r
);
ok
(
r
==
S_OK
,
"get_length returns %08lx
\n
"
,
r
);
ok
(
count
==
3
,
"get_length got %ld
\n
"
,
count
);
ok
(
count
==
4
,
"get_length got %ld
\n
"
,
count
);
r
=
IXMLDOMNodeList_nextNode
(
list
,
&
node
);
r
=
IXMLDOMNodeList_nextNode
(
list
,
&
node
);
ok
(
r
==
S_OK
,
"nextNode returned wrong code
\n
"
);
ok
(
r
==
S_OK
,
"nextNode returned wrong code
\n
"
);
...
@@ -858,7 +863,7 @@ static void test_getElementsByTagName(void)
...
@@ -858,7 +863,7 @@ static void test_getElementsByTagName(void)
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
len
==
4
,
"len %ld
\n
"
,
len
);
ok
(
len
==
6
,
"len %ld
\n
"
,
len
);
IXMLDOMNodeList_Release
(
node_list
);
IXMLDOMNodeList_Release
(
node_list
);
SysFreeString
(
str
);
SysFreeString
(
str
);
...
@@ -989,7 +994,7 @@ static void test_get_childNodes(void)
...
@@ -989,7 +994,7 @@ static void test_get_childNodes(void)
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
r
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
len
==
3
,
"len %ld
\n
"
,
len
);
ok
(
len
==
4
,
"len %ld
\n
"
,
len
);
r
=
IXMLDOMNodeList_get_item
(
node_list
,
2
,
&
node
);
r
=
IXMLDOMNodeList_get_item
(
node_list
,
2
,
&
node
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
...
@@ -1010,7 +1015,60 @@ static void test_get_childNodes(void)
...
@@ -1010,7 +1015,60 @@ static void test_get_childNodes(void)
IXMLDOMElement_Release
(
element
);
IXMLDOMElement_Release
(
element
);
IXMLDOMDocument_Release
(
doc
);
IXMLDOMDocument_Release
(
doc
);
}
}
static
void
test_removeChild
(
void
)
{
HRESULT
r
;
BSTR
str
;
VARIANT_BOOL
b
;
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
IXMLDOMNode
*
node
,
*
node2
,
*
node3
,
*
node4
;
IXMLDOMNodeList
*
node_list
,
*
node_list2
;
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 %08lx
\n
"
,
r
);
r
=
IXMLDOMElement_get_childNodes
(
element
,
&
node_list
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_item
(
node_list
,
3
,
&
node
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNode_get_childNodes
(
node
,
&
node_list2
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMNodeList_get_item
(
node_list
,
0
,
&
node4
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
r
=
IXMLDOMElement_removeChild
(
element
,
node4
,
&
node2
);
ok
(
r
==
S_OK
,
"ret %08lx
\n
"
,
r
);
ok
(
node4
==
node2
,
"node %p node2 %p
\n
"
,
node4
,
node2
);
r
=
IXMLDOMNode_get_parentNode
(
node4
,
&
node3
);
ok
(
r
==
S_FALSE
,
"ret %08lx
\n
"
,
r
);
ok
(
node3
==
NULL
,
"%p
\n
"
,
node3
);
IXMLDOMNode_Release
(
node2
);
IXMLDOMNode_Release
(
node4
);
IXMLDOMNodeList_Release
(
node_list2
);
IXMLDOMNode_Release
(
node
);
IXMLDOMNodeList_Release
(
node_list
);
IXMLDOMElement_Release
(
element
);
IXMLDOMDocument_Release
(
doc
);
}
START_TEST
(
domdoc
)
START_TEST
(
domdoc
)
{
{
HRESULT
r
;
HRESULT
r
;
...
@@ -1025,6 +1083,7 @@ START_TEST(domdoc)
...
@@ -1025,6 +1083,7 @@ START_TEST(domdoc)
test_getElementsByTagName
();
test_getElementsByTagName
();
test_get_text
();
test_get_text
();
test_get_childNodes
();
test_get_childNodes
();
test_removeChild
();
CoUninitialize
();
CoUninitialize
();
}
}
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