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
a6d6bebe
Commit
a6d6bebe
authored
Jul 23, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Do not indent after just BOM has been written.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5773a5d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
writer.c
dlls/xmllite/tests/writer.c
+4
-1
writer.c
dlls/xmllite/writer.c
+5
-2
No files found.
dlls/xmllite/tests/writer.c
View file @
a6d6bebe
...
...
@@ -648,6 +648,8 @@ static void test_bom(void)
hr
=
IXmlWriter_SetOutput
(
writer
,
output
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
writer_set_property
(
writer
,
XmlWriterProperty_Indent
);
hr
=
IXmlWriter_WriteElementString
(
writer
,
NULL
,
aW
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -658,7 +660,8 @@ static void test_bom(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
,
"got %x,%x
\n
"
,
ptr
[
0
],
ptr
[
1
]);
ok
(
ptr
[
0
]
==
0xff
&&
ptr
[
1
]
==
0xfe
&&
ptr
[
2
]
==
'<'
,
"Unexpected output: %#x,%#x,%#x
\n
"
,
ptr
[
0
],
ptr
[
1
],
ptr
[
2
]);
GlobalUnlock
(
hglobal
);
IUnknown_Release
(
output
);
...
...
dlls/xmllite/writer.c
View file @
a6d6bebe
...
...
@@ -447,7 +447,9 @@ static void write_node_indent(xmlwriter *writer)
if
(
!
writer
->
indent
)
return
;
if
(
writer
->
output
->
buffer
.
written
)
/* Do state check to prevent newline inserted after BOM. It is assumed that
state does not change between writing BOM and inserting indentation. */
if
(
writer
->
output
->
buffer
.
written
&&
writer
->
state
!=
XmlWriterState_Ready
)
write_output_buffer
(
writer
->
output
,
crlfW
,
ARRAY_SIZE
(
crlfW
));
while
(
indent_level
--
)
write_output_buffer
(
writer
->
output
,
dblspaceW
,
ARRAY_SIZE
(
dblspaceW
));
...
...
@@ -1208,12 +1210,13 @@ static HRESULT WINAPI xmlwriter_WriteStartElement(IXmlWriter *iface, LPCWSTR pre
return
E_OUTOFMEMORY
;
write_encoding_bom
(
This
);
write_node_indent
(
This
);
This
->
state
=
XmlWriterState_ElemStarted
;
This
->
starttagopen
=
TRUE
;
push_element
(
This
,
element
);
write_node_indent
(
This
);
write_output_buffer
(
This
->
output
,
ltW
,
ARRAY_SIZE
(
ltW
));
write_output_qname
(
This
->
output
,
prefix
,
local_name
);
writer_inc_indent
(
This
);
...
...
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