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
ca01a441
Commit
ca01a441
authored
Feb 12, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Reimplement IXMLDOMDocument::createElement() over ::createNode().
parent
469b0ff6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
19 deletions
+34
-19
domdoc.c
dlls/msxml3/domdoc.c
+9
-17
msxml_private.h
dlls/msxml3/msxml_private.h
+1
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+24
-1
No files found.
dlls/msxml3/domdoc.c
View file @
ca01a441
...
...
@@ -1038,28 +1038,17 @@ static HRESULT WINAPI domdoc_createElement(
BSTR
tagname
,
IXMLDOMElement
**
element
)
{
xmlNodePtr
xmlnode
;
domdoc
*
This
=
impl_from_IXMLDOMDocument2
(
iface
);
xmlChar
*
xml_name
;
IUnknown
*
elem_unk
;
HRESULT
hr
;
TRACE
(
"%p->(%s,%p)
\n
"
,
iface
,
debugstr_w
(
tagname
),
element
);
VARIANT
type
;
if
(
!
element
)
return
E_INVALIDARG
;
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_w
(
tagname
),
element
)
;
xml_name
=
xmlChar_from_wchar
(
tagname
);
xmlnode
=
xmlNewDocNode
(
get_doc
(
This
),
NULL
,
xml_name
,
NULL
);
xmldoc_add_orphan
(
xmlnode
->
doc
,
xmlnode
);
if
(
!
element
||
!
tagname
)
return
E_INVALIDARG
;
TRACE
(
"created xmlptr %p
\n
"
,
xmlnode
);
elem_unk
=
create_element
(
xmlnode
);
heap_free
(
xml_name
);
V_VT
(
&
type
)
=
VT_I1
;
V_I1
(
&
type
)
=
NODE_ELEMENT
;
hr
=
IUnknown_QueryInterface
(
elem_unk
,
&
IID_IXMLDOMElement
,
(
void
**
)
element
);
IUnknown_Release
(
elem_unk
);
TRACE
(
"returning %p
\n
"
,
*
element
);
return
hr
;
return
IXMLDOMDocument_createNode
(
iface
,
type
,
tagname
,
NULL
,
(
IXMLDOMNode
**
)
element
);
}
...
...
@@ -1347,6 +1336,9 @@ static HRESULT WINAPI domdoc_createNode(
TRACE
(
"node_type %d
\n
"
,
node_type
);
if
((
!
name
||
SysStringLen
(
name
)
==
0
)
&&
(
node_type
==
NODE_ELEMENT
))
return
E_FAIL
;
xml_name
=
xmlChar_from_wchar
(
name
);
switch
(
node_type
)
...
...
dlls/msxml3/msxml_private.h
View file @
ca01a441
/*
*
MSXML Class Factory
*
Common definitions
*
* Copyright 2005 Mike McCormack
*
...
...
dlls/msxml3/tests/domdoc.c
View file @
ca01a441
...
...
@@ -1698,6 +1698,21 @@ static void test_create(void)
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
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_ELEMENT
;
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
);
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
str
,
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
)
)
IXMLDOMNode_Release
(
node
);
...
...
@@ -2885,7 +2900,15 @@ static void test_xmlTypes(void)
IXMLDOMImplementation_Release
(
pIXMLDOMImplementation
);
}
pRoot
=
(
IXMLDOMElement
*
)
0x1
;
hr
=
IXMLDOMDocument_createElement
(
doc
,
NULL
,
&
pRoot
);
ok
(
hr
==
E_INVALIDARG
,
"ret %08x
\n
"
,
hr
);
ok
(
pRoot
==
(
void
*
)
0x1
,
"Expect same ptr, got %p
\n
"
,
pRoot
);
pRoot
=
(
IXMLDOMElement
*
)
0x1
;
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
""
),
&
pRoot
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
ok
(
pRoot
==
(
void
*
)
0x1
,
"Expect same ptr, got %p
\n
"
,
pRoot
);
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"Testing"
),
&
pRoot
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
...
...
@@ -3146,7 +3169,7 @@ static void test_xmlTypes(void)
/* Element */
str
=
SysAllocString
(
szElement
);
hr
=
IXMLDOMDocument_createElement
(
doc
,
s
zElement
,
&
pElement
);
hr
=
IXMLDOMDocument_createElement
(
doc
,
s
tr
,
&
pElement
);
SysFreeString
(
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
...
...
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