Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
154c0828
Commit
154c0828
authored
Sep 14, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix IXMLDOMNode::get_prefix() for empty prefix.
parent
8d055c78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
11 deletions
+56
-11
node.c
dlls/msxml3/node.c
+7
-9
domdoc.c
dlls/msxml3/tests/domdoc.c
+49
-2
No files found.
dlls/msxml3/node.c
View file @
154c0828
...
...
@@ -1429,8 +1429,7 @@ static HRESULT WINAPI xmlnode_get_prefix(
BSTR
*
prefixString
)
{
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
HRESULT
hr
=
S_FALSE
;
xmlNsPtr
*
pNSList
;
xmlNsPtr
*
ns
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
prefixString
);
...
...
@@ -1439,16 +1438,15 @@ static HRESULT WINAPI xmlnode_get_prefix(
*
prefixString
=
NULL
;
pNSList
=
xmlGetNsList
(
This
->
node
->
doc
,
This
->
node
);
if
(
pNSList
)
if
((
ns
=
xmlGetNsList
(
This
->
node
->
doc
,
This
->
node
)))
{
*
prefixString
=
bstr_from_xmlChar
(
pNSList
[
0
]
->
prefix
);
xmlFree
(
pNSList
);
hr
=
S_OK
;
if
(
ns
[
0
]
->
prefix
)
*
prefixString
=
bstr_from_xmlChar
(
ns
[
0
]
->
prefix
);
xmlFree
(
ns
);
}
return
hr
;
TRACE
(
"prefix %s
\n
"
,
debugstr_w
(
*
prefixString
));
return
*
prefixString
?
S_OK
:
S_FALSE
;
}
static
HRESULT
WINAPI
xmlnode_get_baseName
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
154c0828
...
...
@@ -6103,8 +6103,8 @@ static void test_createNode(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
prefix
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMNode_get_prefix
(
node
,
&
prefix
);
todo_wine
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
prefix
==
0
,
"expected empty prefix, got %p
\n
"
,
prefix
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
prefix
==
0
,
"expected empty prefix, got %p
\n
"
,
prefix
);
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMElement
,
(
void
**
)
&
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -6118,6 +6118,7 @@ static void test_createNode(void)
hr
=
IXMLDOMElement_get_namespaceURI
(
elem
,
&
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
lstrcmpW
(
str
,
_bstr_
(
"http://winehq.org/default"
))
==
0
,
"expected default namespace
\n
"
);
SysFreeString
(
str
);
IXMLDOMElement_Release
(
elem
);
IXMLDOMNode_Release
(
node
);
...
...
@@ -6126,6 +6127,51 @@ static void test_createNode(void)
free_bstrs
();
}
static
void
test_get_prefix
(
void
)
{
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
HRESULT
hr
;
BSTR
str
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
if
(
!
doc
)
return
;
/* no prefix */
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"elem"
),
&
element
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMElement_get_prefix
(
element
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
str
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_get_prefix
(
element
,
&
str
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
str
==
0
,
"got %p
\n
"
,
str
);
IXMLDOMElement_Release
(
element
);
/* with prefix */
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"a:elem"
),
&
element
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
str
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_get_prefix
(
element
,
&
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
lstrcmpW
(
str
,
_bstr_
(
"a"
))
==
0
,
"expected prefix
\"
a
\"\n
"
);
SysFreeString
(
str
);
str
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_get_namespaceURI
(
element
,
&
str
);
todo_wine
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
str
==
0
,
"got %p
\n
"
,
str
);
IXMLDOMElement_Release
(
element
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
IXMLDOMDocument
*
doc
;
...
...
@@ -6182,6 +6228,7 @@ START_TEST(domdoc)
test_setAttributeNode
();
test_put_dataType
();
test_createNode
();
test_get_prefix
();
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