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
0fd4fae7
Commit
0fd4fae7
authored
Jul 14, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Implement WriteCharEntity().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8b2b455b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
writer.c
dlls/xmllite/tests/writer.c
+42
-0
writer.c
dlls/xmllite/writer.c
+10
-2
No files found.
dlls/xmllite/tests/writer.c
View file @
0fd4fae7
...
...
@@ -1217,6 +1217,47 @@ static void test_WriteFullEndElement(void)
IStream_Release
(
stream
);
}
static
void
test_WriteCharEntity
(
void
)
{
static
const
WCHAR
aW
[]
=
{
'a'
,
0
};
IXmlWriter
*
writer
;
IStream
*
stream
;
HRESULT
hr
;
hr
=
CreateXmlWriter
(
&
IID_IXmlWriter
,
(
void
**
)
&
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* without indentation */
stream
=
writer_set_output
(
writer
);
hr
=
IXmlWriter_SetProperty
(
writer
,
XmlWriterProperty_OmitXmlDeclaration
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartDocument
(
writer
,
XmlStandalone_Omit
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartElement
(
writer
,
NULL
,
aW
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteCharEntity
(
writer
,
0x100
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteStartElement
(
writer
,
NULL
,
aW
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_WriteEndDocument
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXmlWriter_Flush
(
writer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
CHECK_OUTPUT
(
stream
,
"<a>Ā<a /></a>"
);
IXmlWriter_Release
(
writer
);
IStream_Release
(
stream
);
}
START_TEST
(
writer
)
{
test_writer_create
();
...
...
@@ -1235,4 +1276,5 @@ START_TEST(writer)
test_indentation
();
test_WriteAttributeString
();
test_WriteFullEndElement
();
test_WriteCharEntity
();
}
dlls/xmllite/writer.c
View file @
0fd4fae7
...
...
@@ -704,21 +704,29 @@ static HRESULT WINAPI xmlwriter_WriteCData(IXmlWriter *iface, LPCWSTR data)
static
HRESULT
WINAPI
xmlwriter_WriteCharEntity
(
IXmlWriter
*
iface
,
WCHAR
ch
)
{
static
const
WCHAR
fmtW
[]
=
{
'&'
,
'#'
,
'x'
,
'%'
,
'x'
,
';'
,
0
};
xmlwriter
*
This
=
impl_from_IXmlWriter
(
iface
);
WCHAR
bufW
[
16
];
FIXME
(
"%p %
x
\n
"
,
This
,
ch
);
TRACE
(
"%p %#
x
\n
"
,
This
,
ch
);
switch
(
This
->
state
)
{
case
XmlWriterState_Initial
:
return
E_UNEXPECTED
;
case
XmlWriterState_ElemStarted
:
writer_close_starttag
(
This
);
break
;
case
XmlWriterState_DocClosed
:
return
WR_E_INVALIDACTION
;
default:
;
}
return
E_NOTIMPL
;
sprintfW
(
bufW
,
fmtW
,
ch
);
write_output_buffer
(
This
->
output
,
bufW
,
-
1
);
return
S_OK
;
}
static
HRESULT
WINAPI
xmlwriter_WriteChars
(
IXmlWriter
*
iface
,
const
WCHAR
*
pwch
,
UINT
cwch
)
...
...
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