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
760f7ba7
Commit
760f7ba7
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: Reimplement IXMLDOMDocument::createComment() on top of ::createNode().
parent
dd404487
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
18 deletions
+89
-18
domdoc.c
dlls/msxml3/domdoc.c
+15
-16
msxml_private.h
dlls/msxml3/msxml_private.h
+2
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+72
-2
No files found.
dlls/msxml3/domdoc.c
View file @
760f7ba7
...
...
@@ -1105,29 +1105,28 @@ static HRESULT WINAPI domdoc_createComment(
IXMLDOMComment
**
comment
)
{
domdoc
*
This
=
impl_from_IXMLDOMDocument2
(
iface
);
xmlNodePtr
xmlnode
;
xmlChar
*
xml_content
;
VARIANT
type
;
HRESULT
hr
;
IXMLDOMNode
*
node
;
TRACE
(
"%p->(%s %p)
\n
"
,
iface
,
debugstr_w
(
data
),
comment
);
TRACE
(
"%p->(%s %p)
\n
"
,
This
,
debugstr_w
(
data
),
comment
);
if
(
!
comment
)
return
E_INVALIDARG
;
if
(
!
comment
)
return
E_INVALIDARG
;
*
comment
=
NULL
;
xml_content
=
xmlChar_from_wchar
(
data
);
xmlnode
=
xmlNewComment
(
xml_content
);
heap_free
(
xml_content
);
if
(
!
xmlnode
)
return
E_FAIL
;
xmlnode
->
doc
=
get_doc
(
This
);
xmldoc_add_orphan
(
xmlnode
->
doc
,
xmlnode
);
V_VT
(
&
type
)
=
VT_I1
;
V_I1
(
&
type
)
=
NODE_COMMENT
;
*
comment
=
(
IXMLDOMComment
*
)
create_comment
(
xmlnode
);
hr
=
IXMLDOMDocument2_createNode
(
iface
,
type
,
NULL
,
NULL
,
&
node
);
if
(
hr
==
S_OK
)
{
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMComment
,
(
void
**
)
comment
);
IXMLDOMNode_Release
(
node
);
hr
=
IXMLDOMComment_put_data
(
*
comment
,
data
);
}
return
S_OK
;
return
hr
;
}
...
...
dlls/msxml3/msxml_private.h
View file @
760f7ba7
...
...
@@ -174,6 +174,8 @@ static inline BSTR bstr_from_xmlChar(const xmlChar *str)
if
(
ret
)
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPCSTR
)
str
,
-
1
,
ret
,
len
);
}
else
ret
=
SysAllocStringLen
(
NULL
,
0
);
return
ret
;
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
760f7ba7
...
...
@@ -969,6 +969,27 @@ static void test_domdoc( void )
/* test Create Comment */
r
=
IXMLDOMDocument_createComment
(
doc
,
NULL
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
node_comment
=
(
IXMLDOMComment
*
)
0x1
;
/* empty comment */
r
=
IXMLDOMDocument_createComment
(
doc
,
_bstr_
(
""
),
&
node_comment
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
str
=
(
BSTR
)
0x1
;
r
=
IXMLDOMComment_get_data
(
node_comment
,
&
str
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
str
&&
SysStringLen
(
str
)
==
0
,
"expected empty string data
\n
"
);
IXMLDOMComment_Release
(
node_comment
);
SysFreeString
(
str
);
r
=
IXMLDOMDocument_createComment
(
doc
,
NULL
,
&
node_comment
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
str
=
(
BSTR
)
0x1
;
r
=
IXMLDOMComment_get_data
(
node_comment
,
&
str
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
str
&&
(
SysStringLen
(
str
)
==
0
),
"expected empty string data
\n
"
);
IXMLDOMComment_Release
(
node_comment
);
SysFreeString
(
str
);
str
=
SysAllocString
(
szComment
);
r
=
IXMLDOMDocument_createComment
(
doc
,
str
,
&
node_comment
);
SysFreeString
(
str
);
...
...
@@ -1655,6 +1676,7 @@ static void test_create(void)
BSTR
str
,
name
;
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
IXMLDOMComment
*
comment
;
IXMLDOMNode
*
root
,
*
node
,
*
child
;
IXMLDOMNamedNodeMap
*
attr_map
;
IUnknown
*
unk
;
...
...
@@ -1695,6 +1717,54 @@ static void test_create(void)
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
ok
(
node
==
(
void
*
)
0x1
,
"expected same ptr, got %p
\n
"
,
node
);
/* NODE_COMMENT */
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_COMMENT
;
node
=
NULL
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
NULL
,
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
node
!=
NULL
,
"
\n
"
);
r
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMComment
,
(
void
**
)
&
comment
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
IXMLDOMNode_Release
(
node
);
str
=
NULL
;
r
=
IXMLDOMComment_get_data
(
comment
,
&
str
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
str
&&
SysStringLen
(
str
)
==
0
,
"expected empty comment, %p
\n
"
,
str
);
IXMLDOMComment_Release
(
comment
);
SysFreeString
(
str
);
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
_bstr_
(
""
),
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
r
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMComment
,
(
void
**
)
&
comment
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
IXMLDOMNode_Release
(
node
);
str
=
NULL
;
r
=
IXMLDOMComment_get_data
(
comment
,
&
str
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
str
&&
SysStringLen
(
str
)
==
0
,
"expected empty comment, %p
\n
"
,
str
);
IXMLDOMComment_Release
(
comment
);
node
=
(
IXMLDOMNode
*
)
0x1
;
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
_bstr_
(
"blah"
),
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
r
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMComment
,
(
void
**
)
&
comment
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
IXMLDOMNode_Release
(
node
);
str
=
NULL
;
r
=
IXMLDOMComment_get_data
(
comment
,
&
str
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
ok
(
str
&&
SysStringLen
(
str
)
==
0
,
"expected empty comment, %p
\n
"
,
str
);
IXMLDOMComment_Release
(
comment
);
/* NODE_ELEMENT */
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
...
...
@@ -2920,7 +2990,7 @@ static void test_xmlTypes(void)
{
/* Comment */
str
=
SysAllocString
(
szComment
);
hr
=
IXMLDOMDocument_createComment
(
doc
,
s
zComment
,
&
pComment
);
hr
=
IXMLDOMDocument_createComment
(
doc
,
s
tr
,
&
pComment
);
SysFreeString
(
str
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
...
...
@@ -3200,7 +3270,7 @@ static void test_xmlTypes(void)
/* Attribute */
str
=
SysAllocString
(
szAttribute
);
hr
=
IXMLDOMDocument_createAttribute
(
doc
,
s
zAttribute
,
&
pAttrubute
);
hr
=
IXMLDOMDocument_createAttribute
(
doc
,
s
tr
,
&
pAttrubute
);
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