mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 19:18:19 +02:00
fixed xml writer to use current line endings
git-svn-id: trunk@9758 -
This commit is contained in:
parent
ba506191c9
commit
358af7d5d7
@ -263,9 +263,11 @@ begin
|
||||
x := 1;
|
||||
y := 1;
|
||||
while apos < buf do begin
|
||||
if apos[0] = #10 then begin
|
||||
if apos^ in [#10,#13] then begin
|
||||
Inc(y);
|
||||
x := 1;
|
||||
if (apos[1] in [#10,#13]) and (apos[0]<>apos[1]) then
|
||||
inc(apos);
|
||||
end else
|
||||
Inc(x);
|
||||
Inc(apos);
|
||||
|
@ -65,6 +65,7 @@ const
|
||||
(@WriteElement, @WriteAttribute, @WriteText, @WriteCDATA, @WriteEntityRef,
|
||||
@WriteEntity, @WritePI, @WriteComment, @WriteDocument, @WriteDocumentType,
|
||||
@WriteDocumentFragment, @WriteNotation);
|
||||
LineEnd: shortstring = LineEnding;
|
||||
|
||||
procedure WriteNode(node: TDOMNode);
|
||||
begin
|
||||
@ -116,7 +117,7 @@ procedure Stream_WriteLn(const Buffer; Count: Longint);
|
||||
begin
|
||||
if Count > 0 then begin
|
||||
stream.Write(Buffer, Count);
|
||||
stream.WriteByte(10);
|
||||
stream.Write(LineEnd[1],length(LineEnd));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -139,7 +140,7 @@ end;
|
||||
|
||||
procedure wrtLineEnd;
|
||||
begin
|
||||
wrt(#10,1);
|
||||
wrt(LineEnd[1],length(LineEnd));
|
||||
end;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user