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
ac96be9c
Commit
ac96be9c
authored
Jan 27, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support comment nodes in MXWriter.
parent
32c96e63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
mxwriter.c
dlls/msxml3/mxwriter.c
+16
-3
saxreader.c
dlls/msxml3/tests/saxreader.c
+55
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
ac96be9c
...
...
@@ -1155,11 +1155,24 @@ static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface)
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
SAXLexicalHandler_comment
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
chars
,
int
len
)
static
HRESULT
WINAPI
SAXLexicalHandler_comment
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
chars
,
int
nchars
)
{
mxwriter
*
This
=
impl_from_ISAXLexicalHandler
(
iface
);
FIXME
(
"(%p)->(%s): stub
\n
"
,
This
,
debugstr_wn
(
chars
,
len
));
return
E_NOTIMPL
;
static
const
WCHAR
copenW
[]
=
{
'<'
,
'!'
,
'-'
,
'-'
};
static
const
WCHAR
ccloseW
[]
=
{
'-'
,
'-'
,
'>'
,
'\r'
,
'\n'
};
TRACE
(
"(%p)->(%s:%d)
\n
"
,
This
,
debugstr_wn
(
chars
,
nchars
),
nchars
);
if
(
!
chars
)
return
E_INVALIDARG
;
close_element_starttag
(
This
);
write_output_buffer
(
This
->
buffer
,
copenW
,
sizeof
(
copenW
)
/
sizeof
(
WCHAR
));
if
(
nchars
)
write_output_buffer
(
This
->
buffer
,
chars
,
nchars
);
write_output_buffer
(
This
->
buffer
,
ccloseW
,
sizeof
(
ccloseW
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
static
const
struct
ISAXLexicalHandlerVtbl
SAXLexicalHandlerVtbl
=
...
...
dlls/msxml3/tests/saxreader.c
View file @
ac96be9c
...
...
@@ -2851,6 +2851,60 @@ static void test_mxwriter_dispex(void)
IMXWriter_Release
(
writer
);
}
static
void
test_mxwriter_comment
(
void
)
{
static
const
WCHAR
commentW
[]
=
{
'c'
,
'o'
,
'm'
,
'm'
,
'e'
,
'n'
,
't'
,
0
};
ISAXContentHandler
*
content
;
ISAXLexicalHandler
*
lexical
;
IMXWriter
*
writer
;
VARIANT
dest
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXWriter_QueryInterface
(
writer
,
&
IID_ISAXContentHandler
,
(
void
**
)
&
content
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXWriter_QueryInterface
(
writer
,
&
IID_ISAXLexicalHandler
,
(
void
**
)
&
lexical
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXWriter_put_omitXMLDeclaration
(
writer
,
VARIANT_TRUE
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXContentHandler_startDocument
(
content
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXLexicalHandler_comment
(
lexical
,
NULL
,
0
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXLexicalHandler_comment
(
lexical
,
commentW
,
0
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"<!---->
\r\n
"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
hr
=
ISAXLexicalHandler_comment
(
lexical
,
commentW
,
sizeof
(
commentW
)
/
sizeof
(
WCHAR
)
-
1
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"<!---->
\r\n
<!--comment-->
\r\n
"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
ISAXContentHandler_Release
(
content
);
ISAXLexicalHandler_Release
(
lexical
);
IMXWriter_Release
(
writer
);
free_bstrs
();
}
START_TEST
(
saxreader
)
{
ISAXXMLReader
*
reader
;
...
...
@@ -2886,6 +2940,7 @@ START_TEST(saxreader)
test_mxwriter_startenddocument
();
test_mxwriter_startendelement
();
test_mxwriter_characters
();
test_mxwriter_comment
();
test_mxwriter_properties
();
test_mxwriter_flush
();
test_mxwriter_stream
();
...
...
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