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
59f7b889
Commit
59f7b889
authored
Mar 03, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Link dom attribute with parent interface pointer.
parent
d04fd1d0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
6 deletions
+35
-6
element.c
dlls/msxml3/element.c
+16
-0
msxml_private.h
dlls/msxml3/msxml_private.h
+1
-0
node.c
dlls/msxml3/node.c
+1
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+17
-6
No files found.
dlls/msxml3/element.c
View file @
59f7b889
...
...
@@ -1182,6 +1182,7 @@ static HRESULT WINAPI domelem_setAttributeNode(
static
const
WCHAR
xmlnsW
[]
=
{
'x'
,
'm'
,
'l'
,
'n'
,
's'
,
0
};
xmlChar
*
name
,
*
value
;
BSTR
nameW
,
prefix
;
xmlnode
*
attr_node
;
xmlAttrPtr
attr
;
VARIANT
valueW
;
HRESULT
hr
;
...
...
@@ -1190,6 +1191,19 @@ static HRESULT WINAPI domelem_setAttributeNode(
if
(
!
attribute
)
return
E_INVALIDARG
;
attr_node
=
get_node_obj
((
IXMLDOMNode
*
)
attribute
);
if
(
!
attr_node
)
{
FIXME
(
"att_node is not our node implementation
\n
"
);
return
E_FAIL
;
}
if
(
attr_node
->
parent
)
{
WARN
(
"attempt to add already used attribute
\n
"
);
return
E_FAIL
;
}
hr
=
IXMLDOMAttribute_get_nodeName
(
attribute
,
&
nameW
);
if
(
hr
!=
S_OK
)
return
hr
;
...
...
@@ -1231,6 +1245,8 @@ static HRESULT WINAPI domelem_setAttributeNode(
}
attr
=
xmlSetNsProp
(
get_element
(
This
),
NULL
,
name
,
value
);
if
(
attr
)
attr_node
->
parent
=
(
IXMLDOMNode
*
)
iface
;
SysFreeString
(
nameW
);
VariantClear
(
&
valueW
);
...
...
dlls/msxml3/msxml_private.h
View file @
59f7b889
...
...
@@ -235,6 +235,7 @@ typedef struct _xmlnode
{
DispatchEx
dispex
;
IXMLDOMNode
*
iface
;
IXMLDOMNode
*
parent
;
xmlNodePtr
node
;
}
xmlnode
;
...
...
dlls/msxml3/node.c
View file @
59f7b889
...
...
@@ -1106,6 +1106,7 @@ void init_xmlnode(xmlnode *This, xmlNodePtr node, IXMLDOMNode *node_iface, dispe
This
->
node
=
node
;
This
->
iface
=
node_iface
;
This
->
parent
=
NULL
;
if
(
dispex_data
)
init_dispex
(
&
This
->
dispex
,
(
IUnknown
*
)
This
->
iface
,
dispex_data
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
59f7b889
...
...
@@ -7213,7 +7213,7 @@ static void test_get_ownerDocument(void)
static
void
test_setAttributeNode
(
void
)
{
IXMLDOMDocument
*
doc
,
*
doc2
;
IXMLDOMElement
*
elem
;
IXMLDOMElement
*
elem
,
*
elem2
;
IXMLDOMAttribute
*
attr
,
*
attr2
,
*
ret_attr
;
VARIANT_BOOL
b
;
HRESULT
hr
;
...
...
@@ -7233,6 +7233,10 @@ static void test_setAttributeNode(void)
hr
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
elem2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
elem2
!=
elem
,
"got same instance
\n
"
);
ret_attr
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_setAttributeNode
(
elem
,
NULL
,
&
ret_attr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -7259,16 +7263,23 @@ static void test_setAttributeNode(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
b
==
VARIANT_TRUE
,
"got %d
\n
"
,
b
);
b
=
VARIANT_FALSE
;
hr
=
IXMLDOMElement_hasChildNodes
(
elem2
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
b
==
VARIANT_TRUE
,
"got %d
\n
"
,
b
);
IXMLDOMElement_Release
(
elem2
);
attr2
=
NULL
;
hr
=
IXMLDOMElement_getAttributeNode
(
elem
,
_bstr_
(
"attr"
),
&
attr2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
attr2
!=
attr
,
"got same instance %p
\n
"
,
attr2
);
IXMLDOMAttribute_Release
(
attr2
);
/* try to add it another time */
ret_attr
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_setAttributeNode
(
elem
,
attr
,
&
ret_attr
);
todo_wine
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
IXMLDOMElement_Release
(
elem
);
...
...
@@ -7277,8 +7288,8 @@ static void test_setAttributeNode(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ret_attr
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_setAttributeNode
(
elem
,
attr
,
&
ret_attr
);
todo_wine
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
IXMLDOMElement_Release
(
elem
);
/* add attribute already attached to another document */
...
...
@@ -7293,7 +7304,7 @@ static void test_setAttributeNode(void)
hr
=
IXMLDOMDocument_get_documentElement
(
doc2
,
&
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMElement_setAttributeNode
(
elem
,
attr
,
NULL
);
todo_wine
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMElement_Release
(
elem
);
IXMLDOMAttribute_Release
(
attr
);
...
...
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