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
88adaa06
Commit
88adaa06
authored
Oct 21, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Partially implement ::setAttributeNode().
parent
27c01617
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
11 deletions
+65
-11
element.c
dlls/msxml3/element.c
+51
-6
domdoc.c
dlls/msxml3/tests/domdoc.c
+14
-5
No files found.
dlls/msxml3/element.c
View file @
88adaa06
...
...
@@ -50,7 +50,7 @@ static inline domelem *impl_from_IXMLDOMElement( IXMLDOMElement *iface )
return
(
domelem
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
domelem
,
lpVtbl
));
}
static
inline
xmlNodePtr
get_element
(
domelem
*
This
)
static
inline
xmlNodePtr
get_element
(
const
domelem
*
This
)
{
return
This
->
node
.
node
;
}
...
...
@@ -705,16 +705,61 @@ static HRESULT WINAPI domelem_getAttributeNode(
static
HRESULT
WINAPI
domelem_setAttributeNode
(
IXMLDOMElement
*
iface
,
IXMLDOMAttribute
*
domA
ttribute
,
IXMLDOMAttribute
**
attributeNode
)
IXMLDOMAttribute
*
a
ttribute
,
IXMLDOMAttribute
**
old
)
{
domelem
*
This
=
impl_from_IXMLDOMElement
(
iface
);
xmlChar
*
name
,
*
value
;
BSTR
nameW
,
prefix
;
xmlAttrPtr
attr
;
VARIANT
valueW
;
HRESULT
hr
;
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
domAttribute
,
attributeNode
);
FIXME
(
"(%p)->(%p %p)
: semi-stub
\n
"
,
This
,
attribute
,
old
);
if
(
!
domA
ttribute
)
return
E_INVALIDARG
;
if
(
!
a
ttribute
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
if
(
old
)
*
old
=
NULL
;
hr
=
IXMLDOMAttribute_get_nodeName
(
attribute
,
&
nameW
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
IXMLDOMAttribute_get_nodeValue
(
attribute
,
&
valueW
);
if
(
hr
!=
S_OK
)
{
SysFreeString
(
nameW
);
return
hr
;
}
TRACE
(
"attribute: %s=%s
\n
"
,
debugstr_w
(
nameW
),
debugstr_w
(
V_BSTR
(
&
valueW
)));
hr
=
IXMLDOMAttribute_get_prefix
(
attribute
,
&
prefix
);
if
(
hr
==
S_OK
)
{
FIXME
(
"namespaces not supported: %s
\n
"
,
debugstr_w
(
prefix
));
SysFreeString
(
prefix
);
}
name
=
xmlChar_from_wchar
(
nameW
);
value
=
xmlChar_from_wchar
(
V_BSTR
(
&
valueW
));
if
(
!
name
||
!
value
)
{
SysFreeString
(
nameW
);
VariantClear
(
&
valueW
);
heap_free
(
name
);
heap_free
(
value
);
return
E_OUTOFMEMORY
;
}
attr
=
xmlSetNsProp
(
get_element
(
This
),
NULL
,
name
,
value
);
SysFreeString
(
nameW
);
VariantClear
(
&
valueW
);
heap_free
(
name
);
heap_free
(
value
);
return
attr
?
S_OK
:
E_FAIL
;
}
static
HRESULT
WINAPI
domelem_removeAttributeNode
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
88adaa06
...
...
@@ -6853,20 +6853,29 @@ static void test_setAttributeNode(void)
ret_attr
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_setAttributeNode
(
elem
,
attr
,
&
ret_attr
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
ret_attr
==
NULL
,
"got %p
\n
"
,
ret_attr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
ret_attr
==
NULL
,
"got %p
\n
"
,
ret_attr
);
attr2
=
NULL
;
hr
=
IXMLDOMElement_getAttributeNode
(
elem
,
_bstr_
(
"attr"
),
&
attr2
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
attr2
)
IXMLDOMAttribute_Release
(
attr2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
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
);
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
todo_wine
ok
(
ret_attr
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
ret_attr
);
IXMLDOMElement_Release
(
elem
);
/* initialy used element is released, attribute still 'has' a container */
hr
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
elem
);
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
);
IXMLDOMElement_Release
(
elem
);
/* add attribute already attached to another document */
...
...
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