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
23c3d908
Commit
23c3d908
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 CDATA nodes in MXWriter.
parent
ac96be9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
4 deletions
+69
-4
mxwriter.c
dlls/msxml3/mxwriter.c
+14
-4
saxreader.c
dlls/msxml3/tests/saxreader.c
+55
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
23c3d908
...
...
@@ -1143,16 +1143,26 @@ static HRESULT WINAPI SAXLexicalHandler_endEntity(ISAXLexicalHandler *iface, con
static
HRESULT
WINAPI
SAXLexicalHandler_startCDATA
(
ISAXLexicalHandler
*
iface
)
{
static
const
WCHAR
scdataW
[]
=
{
'<'
,
'!'
,
'['
,
'C'
,
'D'
,
'A'
,
'T'
,
'A'
,
'['
};
mxwriter
*
This
=
impl_from_ISAXLexicalHandler
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p)
\n
"
,
This
);
write_output_buffer
(
This
->
buffer
,
scdataW
,
sizeof
(
scdataW
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
static
HRESULT
WINAPI
SAXLexicalHandler_endCDATA
(
ISAXLexicalHandler
*
iface
)
{
mxwriter
*
This
=
impl_from_ISAXLexicalHandler
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
static
const
WCHAR
ecdataW
[]
=
{
']'
,
']'
,
'>'
};
TRACE
(
"(%p)
\n
"
,
This
);
write_output_buffer
(
This
->
buffer
,
ecdataW
,
sizeof
(
ecdataW
)
/
sizeof
(
WCHAR
));
return
S_OK
;
}
static
HRESULT
WINAPI
SAXLexicalHandler_comment
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
chars
,
int
nchars
)
...
...
dlls/msxml3/tests/saxreader.c
View file @
23c3d908
...
...
@@ -2905,6 +2905,60 @@ static void test_mxwriter_comment(void)
free_bstrs
();
}
static
void
test_mxwriter_cdata
(
void
)
{
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_startCDATA
(
lexical
);
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_
(
"<![CDATA["
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
hr
=
ISAXLexicalHandler_startCDATA
(
lexical
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXLexicalHandler_endCDATA
(
lexical
);
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_
(
"<![CDATA[<![CDATA[]]>"
),
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
;
...
...
@@ -2941,6 +2995,7 @@ START_TEST(saxreader)
test_mxwriter_startendelement
();
test_mxwriter_characters
();
test_mxwriter_comment
();
test_mxwriter_cdata
();
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