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
5262c570
Commit
5262c570
authored
Feb 12, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Accept NODE_ENTITY_REFERENCE in ::createNode() and use it for ::createEntityReference().
parent
20a240fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
18 deletions
+41
-18
domdoc.c
dlls/msxml3/domdoc.c
+20
-18
domdoc.c
dlls/msxml3/tests/domdoc.c
+21
-0
No files found.
dlls/msxml3/domdoc.c
View file @
5262c570
...
@@ -1253,32 +1253,30 @@ static HRESULT WINAPI domdoc_createAttribute(
...
@@ -1253,32 +1253,30 @@ static HRESULT WINAPI domdoc_createAttribute(
static
HRESULT
WINAPI
domdoc_createEntityReference
(
static
HRESULT
WINAPI
domdoc_createEntityReference
(
IXMLDOMDocument2
*
iface
,
IXMLDOMDocument2
*
iface
,
BSTR
name
,
BSTR
name
,
IXMLDOMEntityReference
**
entity
R
ef
)
IXMLDOMEntityReference
**
entity
r
ef
)
{
{
domdoc
*
This
=
impl_from_IXMLDOMDocument2
(
iface
);
domdoc
*
This
=
impl_from_IXMLDOMDocument2
(
iface
);
xmlNodePtr
xmlnode
;
IXMLDOMNode
*
node
;
xmlChar
*
xml_name
;
VARIANT
type
;
HRESULT
hr
;
TRACE
(
"%p
\n
"
,
iface
);
if
(
!
entityRef
)
TRACE
(
"%p->(%s %p)
\n
"
,
This
,
debugstr_w
(
name
),
entityref
);
return
E_INVALIDARG
;
*
entityRef
=
NULL
;
if
(
!
entityref
)
return
E_INVALIDARG
;
xml_name
=
xmlChar_from_wchar
(
name
);
*
entityref
=
NULL
;
xmlnode
=
xmlNewReference
(
get_doc
(
This
),
xml_name
);
heap_free
(
xml_name
);
if
(
!
xmlnode
)
V_VT
(
&
type
)
=
VT_I1
;
return
E_FAIL
;
V_I1
(
&
type
)
=
NODE_ENTITY_REFERENCE
;
xmlnode
->
doc
=
get_doc
(
This
);
xmldoc_add_orphan
(
xmlnode
->
doc
,
xmlnode
);
*
entityRef
=
(
IXMLDOMEntityReference
*
)
create_doc_entity_ref
(
xmlnode
);
hr
=
IXMLDOMDocument2_createNode
(
iface
,
type
,
name
,
NULL
,
&
node
);
if
(
hr
==
S_OK
)
{
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMEntityReference
,
(
void
**
)
entityref
);
IXMLDOMNode_Release
(
node
);
}
return
S_OK
;
return
hr
;
}
}
...
@@ -1358,6 +1356,7 @@ static HRESULT WINAPI domdoc_createNode(
...
@@ -1358,6 +1356,7 @@ static HRESULT WINAPI domdoc_createNode(
{
{
case
NODE_ELEMENT
:
case
NODE_ELEMENT
:
case
NODE_ATTRIBUTE
:
case
NODE_ATTRIBUTE
:
case
NODE_ENTITY_REFERENCE
:
case
NODE_PROCESSING_INSTRUCTION
:
case
NODE_PROCESSING_INSTRUCTION
:
if
(
!
name
||
SysStringLen
(
name
)
==
0
)
return
E_FAIL
;
if
(
!
name
||
SysStringLen
(
name
)
==
0
)
return
E_FAIL
;
default:
default:
...
@@ -1380,6 +1379,9 @@ static HRESULT WINAPI domdoc_createNode(
...
@@ -1380,6 +1379,9 @@ static HRESULT WINAPI domdoc_createNode(
case
NODE_CDATA_SECTION
:
case
NODE_CDATA_SECTION
:
xmlnode
=
xmlNewCDataBlock
(
get_doc
(
This
),
NULL
,
0
);
xmlnode
=
xmlNewCDataBlock
(
get_doc
(
This
),
NULL
,
0
);
break
;
break
;
case
NODE_ENTITY_REFERENCE
:
xmlnode
=
xmlNewReference
(
get_doc
(
This
),
xml_name
);
break
;
case
NODE_PROCESSING_INSTRUCTION
:
case
NODE_PROCESSING_INSTRUCTION
:
#ifdef HAVE_XMLNEWDOCPI
#ifdef HAVE_XMLNEWDOCPI
xmlnode
=
xmlNewDocPI
(
get_doc
(
This
),
xml_name
,
NULL
);
xmlnode
=
xmlNewDocPI
(
get_doc
(
This
),
xml_name
,
NULL
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
5262c570
...
@@ -1907,6 +1907,22 @@ static void test_create(void)
...
@@ -1907,6 +1907,22 @@ static void test_create(void)
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
_bstr_
(
"pi"
),
NULL
,
NULL
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
_bstr_
(
"pi"
),
NULL
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
/* NODE_ENTITY_REFERENCE */
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ENTITY_REFERENCE
;
str
=
SysAllocString
(
szlc
);
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
E_FAIL
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ENTITY_REFERENCE
;
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
_bstr_
(
""
),
NULL
,
&
node
);
ok
(
r
==
E_FAIL
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
/* NODE_ELEMENT */
/* NODE_ELEMENT */
V_VT
(
&
var
)
=
VT_I1
;
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
...
@@ -3882,6 +3898,11 @@ static void test_xmlTypes(void)
...
@@ -3882,6 +3898,11 @@ static void test_xmlTypes(void)
}
}
/* Entity References */
/* Entity References */
hr
=
IXMLDOMDocument_createEntityReference
(
doc
,
NULL
,
&
pEntityRef
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_createEntityReference
(
doc
,
_bstr_
(
""
),
&
pEntityRef
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
str
=
SysAllocString
(
szEntityRef
);
str
=
SysAllocString
(
szEntityRef
);
hr
=
IXMLDOMDocument_createEntityReference
(
doc
,
str
,
NULL
);
hr
=
IXMLDOMDocument_createEntityReference
(
doc
,
str
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
...
...
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