Change format of collection of flames to force correct XML syntax.
This commit is contained in:
parent
ea11c313df
commit
29bfa4d098
@ -2,7 +2,7 @@ object MainForm: TMainForm
|
|||||||
Left = 387
|
Left = 387
|
||||||
Top = 166
|
Top = 166
|
||||||
Width = 605
|
Width = 605
|
||||||
Height = 575
|
Height = 595
|
||||||
Caption = 'Apophysis'
|
Caption = 'Apophysis'
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
Font.Charset = ANSI_CHARSET
|
Font.Charset = ANSI_CHARSET
|
||||||
@ -313,7 +313,7 @@ object MainForm: TMainForm
|
|||||||
Left = 1
|
Left = 1
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 431
|
Width = 431
|
||||||
Height = 478
|
Height = 492
|
||||||
Align = alClient
|
Align = alClient
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
PopupMenu = DisplayPopup
|
PopupMenu = DisplayPopup
|
||||||
|
@ -1561,17 +1561,23 @@ begin
|
|||||||
try
|
try
|
||||||
FileList.LoadFromFile(filename);
|
FileList.LoadFromFile(filename);
|
||||||
|
|
||||||
if pos('<flame', FileList.text) <> 0 then
|
// fix first line
|
||||||
|
if (FileList.Count > 0) then begin
|
||||||
|
FileList[0] := '<Flames name="' + Tag + '">';
|
||||||
|
end;
|
||||||
|
|
||||||
|
if pos('<flame ', FileList.text) <> 0 then
|
||||||
repeat
|
repeat
|
||||||
FileList.Delete(FileList.Count - 1);
|
FileList.Delete(FileList.Count - 1);
|
||||||
until (Pos('</flame>', FileList[FileList.count - 1]) <> 0)
|
until (Pos('</flame>', FileList[FileList.count - 1]) <> 0)
|
||||||
else
|
else
|
||||||
repeat
|
repeat
|
||||||
FileList.Delete(FileList.Count - 1);
|
FileList.Delete(FileList.Count - 1);
|
||||||
until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0);
|
until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or
|
||||||
|
(Pos('</Flames>', FileList[FileList.count - 1]) <> 0);
|
||||||
|
|
||||||
FileList.Add(Trim(FlameToXML(cp1, false)));
|
FileList.Add(Trim(FlameToXML(cp1, false)));
|
||||||
FileList.Add('</' + Tag + '>');
|
FileList.Add('</Flames>');
|
||||||
FileList.SaveToFile(filename);
|
FileList.SaveToFile(filename);
|
||||||
|
|
||||||
finally
|
finally
|
||||||
@ -1583,9 +1589,9 @@ begin
|
|||||||
// New file ... easy
|
// New file ... easy
|
||||||
AssignFile(IFile, filename);
|
AssignFile(IFile, filename);
|
||||||
ReWrite(IFile);
|
ReWrite(IFile);
|
||||||
Writeln(IFile, '<' + Tag + '>');
|
Writeln(IFile, '<Flames name="' + Tag + '">');
|
||||||
Write(IFile, FlameToXML(cp1, false));
|
Write(IFile, FlameToXML(cp1, false));
|
||||||
Writeln(IFile, '</' + Tag + '>');
|
Writeln(IFile, '</Flames>');
|
||||||
CloseFile(IFile);
|
CloseFile(IFile);
|
||||||
end;
|
end;
|
||||||
except on E: EInOutError do
|
except on E: EInOutError do
|
||||||
|
Loading…
Reference in New Issue
Block a user