From 29bfa4d098cb22386ba40915f27623dc1a96d252 Mon Sep 17 00:00:00 2001 From: ronaldhordijk Date: Sun, 25 Sep 2005 08:32:27 +0000 Subject: [PATCH] Change format of collection of flames to force correct XML syntax. --- 2.10/Source/Main.dfm | 4 ++-- 2.10/Source/Main.pas | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/2.10/Source/Main.dfm b/2.10/Source/Main.dfm index 86c6e20..a28540d 100644 --- a/2.10/Source/Main.dfm +++ b/2.10/Source/Main.dfm @@ -2,7 +2,7 @@ object MainForm: TMainForm Left = 387 Top = 166 Width = 605 - Height = 575 + Height = 595 Caption = 'Apophysis' Color = clBtnFace Font.Charset = ANSI_CHARSET @@ -313,7 +313,7 @@ object MainForm: TMainForm Left = 1 Top = 1 Width = 431 - Height = 478 + Height = 492 Align = alClient AutoSize = True PopupMenu = DisplayPopup diff --git a/2.10/Source/Main.pas b/2.10/Source/Main.pas index 0a0dfee..f8894a5 100644 --- a/2.10/Source/Main.pas +++ b/2.10/Source/Main.pas @@ -1561,17 +1561,23 @@ begin try FileList.LoadFromFile(filename); - if pos(' 0 then + // fix first line + if (FileList.Count > 0) then begin + FileList[0] := ''; + end; + + if pos(' 0 then repeat FileList.Delete(FileList.Count - 1); until (Pos('', FileList[FileList.count - 1]) <> 0) else repeat FileList.Delete(FileList.Count - 1); - until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0); + until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or + (Pos('', FileList[FileList.count - 1]) <> 0); FileList.Add(Trim(FlameToXML(cp1, false))); - FileList.Add(''); + FileList.Add(''); FileList.SaveToFile(filename); finally @@ -1583,9 +1589,9 @@ begin // New file ... easy AssignFile(IFile, filename); ReWrite(IFile); - Writeln(IFile, '<' + Tag + '>'); + Writeln(IFile, ''); Write(IFile, FlameToXML(cp1, false)); - Writeln(IFile, ''); + Writeln(IFile, ''); CloseFile(IFile); end; except on E: EInOutError do