52610.fb2 Пишем программу для создания книг FB2. - читать онлайн бесплатно полную версию книги . Страница 26

Пишем программу для создания книг FB2. - читать онлайн бесплатно полную версию книги . Страница 26

begin

result:= integer(m) - integer(w);

end;

procedure SaveBodyFB2;

var

i, j: integer;

S, ss: string;

oldStyle,

LastStyle, CurStyle: TmyStyle; // style

procedure StyleStucture;

begin

if CurStyle <> oldStyle then

begin

if SytleStack.Count = 0 then

begin

SytleStack.Add(TObject(CurStyle))

end

else

begin

LastStyle:= TmyStyle(SytleStack.Last);

case SubStyle(CurStyle,LastStyle) of

0: OutList.Add('</section>');

1: SytleStack.Add(TObject(CurStyle));

else

begin

OutList.Add('</section>');

while CurStyle <> LastStyle do

begin

SytleStack.Delete(SytleStack.Count-1);

OutList.Add('</section>');

LastStyle:= TmyStyle(SytleStack.Last);

end;

end;

end;// case

end;

OutList.Add('<section>');

OutList.Add('<title>');

end;

OutList.Add('<p>'+s+'</p>');

end; // StyleStucture;

begin

oldStyle:= ZZ; EndNotes_count:= 1;

// if

OutList.Add('<section>');

with Form1.ListBox1 do

for i:= 0 to Count - 1 do // просматриваем текст

begin

S:= Items[i];

Ss:= GetStyle(S, CurStyle); // получаем чистую строку и стиль

s:= '';