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
588f27da
Commit
588f27da
authored
Nov 16, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Properly return node prefix from get_prefix().
parent
e0a0d611
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
35 deletions
+77
-35
entityref.c
dlls/msxml3/entityref.c
+2
-2
node.c
dlls/msxml3/node.c
+3
-6
domdoc.c
dlls/msxml3/tests/domdoc.c
+72
-27
No files found.
dlls/msxml3/entityref.c
View file @
588f27da
...
...
@@ -531,8 +531,8 @@ static HRESULT WINAPI entityref_get_prefix(
BSTR
*
prefix
)
{
entityref
*
This
=
impl_from_IXMLDOMEntityReference
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
prefix
);
return
node_get_prefix
(
&
This
->
node
,
prefix
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
prefix
);
return
return_null_bstr
(
prefix
);
}
static
HRESULT
WINAPI
entityref_get_baseName
(
...
...
dlls/msxml3/node.c
View file @
588f27da
...
...
@@ -1074,17 +1074,14 @@ HRESULT node_get_namespaceURI(xmlnode *This, BSTR *namespaceURI)
HRESULT
node_get_prefix
(
xmlnode
*
This
,
BSTR
*
prefix
)
{
xmlNsPtr
*
ns
;
xmlNsPtr
ns
=
This
->
node
->
ns
;
if
(
!
prefix
)
return
E_INVALIDARG
;
*
prefix
=
NULL
;
if
((
ns
=
xmlGetNsList
(
This
->
node
->
doc
,
This
->
node
)))
{
if
(
ns
[
0
]
->
prefix
)
*
prefix
=
bstr_from_xmlChar
(
ns
[
0
]
->
prefix
);
xmlFree
(
ns
);
}
if
(
ns
&&
ns
->
prefix
)
*
prefix
=
bstr_from_xmlChar
(
ns
->
prefix
);
TRACE
(
"prefix: %s
\n
"
,
debugstr_w
(
*
prefix
));
...
...
dlls/msxml3/tests/domdoc.c
View file @
588f27da
...
...
@@ -6960,21 +6960,21 @@ static void test_testTransforms(void)
free_bstrs
();
}
static
void
test_
N
amespaces
(
void
)
static
void
test_
n
amespaces
(
void
)
{
static
const
CHAR
szNamespacesXML
[]
=
static
const
CHAR
namespaces_xmlA
[]
=
"<?xml version=
\"
1.0
\"
?>
\n
"
"<XMI xmi.version=
\"
1.1
\"
xmlns:Model=
\"
http://omg.org/mof.Model/1.3
\"
>"
" <XMI.content>"
" <Model:Package name=
\"
WinePackage
\"
/>"
" <Model:Package name=
\"
WinePackage
\"
Model:name2=
\"
name2 attr
\"
/>"
" </XMI.content>"
"</XMI>"
;
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
elem
;
IXMLDOMNode
*
node
;
IXMLDOMNode
*
pNode2
=
NULL
;
VARIANT_BOOL
b
Succ
;
VARIANT_BOOL
b
;
VARIANT
var
;
HRESULT
hr
;
BSTR
str
;
...
...
@@ -6982,44 +6982,66 @@ static void test_Namespaces(void)
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
if
(
!
doc
)
return
;
hr
=
IXMLDOMDocument_loadXML
(
doc
,
_bstr_
(
szNamespacesXML
),
&
bSucc
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
b
Succ
==
VARIANT_TRUE
,
"Expected VARIANT_TRUE got VARIANT_FALSE
\n
"
);
hr
=
IXMLDOMDocument_loadXML
(
doc
,
_bstr_
(
namespaces_xmlA
),
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"got %d
\n
"
,
b
);
hr
=
IXMLDOMDocument_selectSingleNode
(
doc
,
_bstr_
(
"//XMI.content"
),
&
node
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
S_OK
);
if
(
hr
==
S_OK
)
{
hr
=
IXMLDOMNode_get_firstChild
(
node
,
&
pNode2
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
pNode2
!=
NULL
,
"pNode2 == NULL
\n
"
);
IXMLDOMAttribute
*
attr
;
IXMLDOMNode
*
node2
;
hr
=
IXMLDOMNode_get_firstChild
(
node
,
&
node2
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
node2
!=
NULL
,
"got %p
\n
"
,
node2
);
/* Test get_prefix */
hr
=
IXMLDOMNode_get_prefix
(
pN
ode2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMNode_get_prefix
(
n
ode2
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
/* NOTE: Need to test that arg2 gets cleared on Error. */
hr
=
IXMLDOMNode_get_prefix
(
pN
ode2
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model"
)),
"
incorrect prefix string
\n
"
);
hr
=
IXMLDOMNode_get_prefix
(
n
ode2
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model"
)),
"
got %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
hr
=
IXMLDOMNode_get_nodeName
(
pN
ode2
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
todo_wine
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model:Package"
)),
"incorrect nodeName string
\n
"
);
hr
=
IXMLDOMNode_get_nodeName
(
n
ode2
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
todo_wine
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model:Package"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
/* Test get_namespaceURI */
hr
=
IXMLDOMNode_get_namespaceURI
(
pN
ode2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMNode_get_namespaceURI
(
n
ode2
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
/* NOTE: Need to test that arg2 gets cleared on Error. */
hr
=
IXMLDOMNode_get_namespaceURI
(
pNode2
,
&
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"http://omg.org/mof.Model/1.3"
)),
"incorrect namespaceURI string
\n
"
);
hr
=
IXMLDOMNode_get_namespaceURI
(
node2
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"http://omg.org/mof.Model/1.3"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
hr
=
IXMLDOMNode_QueryInterface
(
node2
,
&
IID_IXMLDOMElement
,
(
void
**
)
&
elem
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMElement_getAttributeNode
(
elem
,
_bstr_
(
"Model:name2"
),
&
attr
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMAttribute_get_nodeName
(
attr
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
todo_wine
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model:name2"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
IXMLDOMNode_Release
(
pNode2
);
hr
=
IXMLDOMAttribute_get_prefix
(
attr
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"Model"
)),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
IXMLDOMAttribute_Release
(
attr
);
IXMLDOMElement_Release
(
elem
);
IXMLDOMNode_Release
(
node2
);
IXMLDOMNode_Release
(
node
);
}
...
...
@@ -8579,6 +8601,10 @@ todo_wine {
free_bstrs
();
}
static
const
char
get_prefix_doc
[]
=
"<?xml version=
\"
1.0
\"
?>"
"<a xmlns:ns1=
\"
ns1 href
\"
/>"
;
static
void
test_get_prefix
(
void
)
{
IXMLDOMDocumentFragment
*
fragment
;
...
...
@@ -8586,6 +8612,7 @@ static void test_get_prefix(void)
IXMLDOMElement
*
element
;
IXMLDOMComment
*
comment
;
IXMLDOMDocument
*
doc
;
VARIANT_BOOL
b
;
HRESULT
hr
;
BSTR
str
;
...
...
@@ -8672,6 +8699,24 @@ static void test_get_prefix(void)
IXMLDOMElement_Release
(
element
);
hr
=
IXMLDOMDocument_loadXML
(
doc
,
_bstr_
(
get_prefix_doc
),
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
EXPECT_HR
(
hr
,
S_OK
);
str
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_get_prefix
(
element
,
&
str
);
EXPECT_HR
(
hr
,
S_FALSE
);
ok
(
str
==
NULL
,
"got %p
\n
"
,
str
);
str
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMElement_get_namespaceURI
(
element
,
&
str
);
todo_wine
{
EXPECT_HR
(
hr
,
S_FALSE
);
ok
(
str
==
NULL
,
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
}
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
...
...
@@ -10741,7 +10786,7 @@ START_TEST(domdoc)
test_nodeTypeTests
();
test_save
();
test_testTransforms
();
test_
N
amespaces
();
test_
n
amespaces
();
test_FormattingXML
();
test_nodeTypedValue
();
test_TransformWithLoadingLocalFile
();
...
...
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