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
76645c5e
Commit
76645c5e
authored
Mar 08, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Orphan a node removed with removeChild().
parent
0ecc9201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
node.c
dlls/msxml3/node.c
+19
-12
No files found.
dlls/msxml3/node.c
View file @
76645c5e
...
...
@@ -292,7 +292,6 @@ HRESULT node_get_next_sibling(xmlnode *This, IXMLDOMNode **ret)
HRESULT
node_insert_before
(
xmlnode
*
This
,
IXMLDOMNode
*
new_child
,
const
VARIANT
*
ref_child
,
IXMLDOMNode
**
ret
)
{
xmlNodePtr
new_child_node
;
IXMLDOMNode
*
before
=
NULL
;
xmlnode
*
node_obj
;
xmlDocPtr
doc
;
...
...
@@ -321,12 +320,11 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
return
E_FAIL
;
}
new_child_node
=
node_obj
->
node
;
TRACE
(
"new_child_node %p This->node %p
\n
"
,
new_child_node
,
This
->
node
);
TRACE
(
"new child %p, This->node %p
\n
"
,
node_obj
->
node
,
This
->
node
);
if
(
!
n
ew_child_
node
->
parent
)
if
(
xmldoc_remove_orphan
(
n
ew_child_node
->
doc
,
new_child_
node
)
!=
S_OK
)
WARN
(
"%p is not an orphan of %p
\n
"
,
n
ew_child_node
,
new_child_
node
->
doc
);
if
(
!
n
ode_obj
->
node
->
parent
)
if
(
xmldoc_remove_orphan
(
n
ode_obj
->
node
->
doc
,
node_obj
->
node
)
!=
S_OK
)
WARN
(
"%p is not an orphan of %p
\n
"
,
n
ode_obj
->
node
,
node_obj
->
node
->
doc
);
if
(
before
)
{
...
...
@@ -336,10 +334,13 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
/* unlink from current parent first */
if
(
node_obj
->
parent
)
IXMLDOMNode_removeChild
(
node_obj
->
parent
,
node_obj
->
iface
,
NULL
);
doc
=
new_child_node
->
doc
;
{
hr
=
IXMLDOMNode_removeChild
(
node_obj
->
parent
,
node_obj
->
iface
,
NULL
);
if
(
hr
==
S_OK
)
xmldoc_remove_orphan
(
node_obj
->
node
->
doc
,
node_obj
->
node
);
}
doc
=
node_obj
->
node
->
doc
;
xmldoc_add_ref
(
before_node_obj
->
node
->
doc
);
xmlAddPrevSibling
(
before_node_obj
->
node
,
n
ew_child_
node
);
xmlAddPrevSibling
(
before_node_obj
->
node
,
n
ode_obj
->
node
);
xmldoc_release
(
doc
);
node_obj
->
parent
=
This
->
parent
;
}
...
...
@@ -347,10 +348,13 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
{
/* unlink from current parent first */
if
(
node_obj
->
parent
)
IXMLDOMNode_removeChild
(
node_obj
->
parent
,
node_obj
->
iface
,
NULL
);
doc
=
new_child_node
->
doc
;
{
hr
=
IXMLDOMNode_removeChild
(
node_obj
->
parent
,
node_obj
->
iface
,
NULL
);
if
(
hr
==
S_OK
)
xmldoc_remove_orphan
(
node_obj
->
node
->
doc
,
node_obj
->
node
);
}
doc
=
node_obj
->
node
->
doc
;
xmldoc_add_ref
(
This
->
node
->
doc
);
xmlAddChild
(
This
->
node
,
n
ew_child_
node
);
xmlAddChild
(
This
->
node
,
n
ode_obj
->
node
);
xmldoc_release
(
doc
);
node_obj
->
parent
=
This
->
iface
;
}
...
...
@@ -445,6 +449,7 @@ HRESULT node_remove_child(xmlnode *This, IXMLDOMNode* child, IXMLDOMNode** oldCh
xmlUnlinkNode
(
child_node
->
node
);
child_node
->
parent
=
NULL
;
xmldoc_add_orphan
(
child_node
->
node
->
doc
,
child_node
->
node
);
if
(
oldChild
)
{
...
...
@@ -507,6 +512,8 @@ HRESULT node_clone(xmlnode *This, VARIANT_BOOL deep, IXMLDOMNode **cloneNode)
if
(
!
node
)
{
ERR
(
"Copy failed
\n
"
);
xmldoc_remove_orphan
(
clone
->
doc
,
clone
);
xmlFreeNode
(
clone
);
return
E_FAIL
;
}
...
...
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