|
@@ -803,6 +803,7 @@ var
|
|
|
sp : PRTFStyle;
|
|
|
sep,sepLast : PRTFStyleElt;
|
|
|
bp : string[rtfBufSiz];
|
|
|
+ I : Integer;
|
|
|
|
|
|
Begin
|
|
|
While true do
|
|
@@ -823,40 +824,40 @@ While true do
|
|
|
FstyleList := sp;
|
|
|
if not CheckCM (rtfGroup, rtfBeginGroup) then
|
|
|
Error ('SSErr - missing {');
|
|
|
- while (GetToken=rtfControl) or (FTokenClass=rtfControl) do
|
|
|
+ I:=0;
|
|
|
+ GetToken;
|
|
|
+ while (fRTFClass=rtfControl) or (FTokenClass=rtfControl) or (FRTFClass=rtfGroup) do
|
|
|
Begin
|
|
|
- if rtfClass=rtfUnknown then
|
|
|
- continue;
|
|
|
- if (CheckMM (rtfParAttr, rtfStyleNum)) then
|
|
|
- Begin
|
|
|
- sp^.rtfSNum:=rtfParam;
|
|
|
- continue;
|
|
|
- End;
|
|
|
- if (CheckMM (rtfStyleAttr, rtfBasedOn)) then
|
|
|
- Begin
|
|
|
- sp^.rtfSBasedOn:=rtfParam;
|
|
|
- continue;
|
|
|
- End;
|
|
|
- if (CheckMM (rtfStyleAttr, rtfNext)) then
|
|
|
- Begin
|
|
|
- sp^.rtfSNextPar:=rtfParam;
|
|
|
- Continue;
|
|
|
- End;
|
|
|
- new(sep);
|
|
|
- if sep=nil then
|
|
|
- Error ('SSErr - cannot allocate style element');
|
|
|
- sep^.rtfSEClass:=rtfClass;
|
|
|
- sep^.rtfSEMajor:=rtfMajor;
|
|
|
- sep^.rtfSEMinor:=rtfMinor;
|
|
|
- sep^.rtfSEParam:=rtfParam;
|
|
|
- sep^.rtfSEText:=rtfTextBuf;
|
|
|
- if sepLast=nil then
|
|
|
- sp^.rtfSSEList:=sep { first element }
|
|
|
- else { add to end }
|
|
|
- sepLast^.rtfNextSE:=sep;
|
|
|
- sep^.rtfNextSE:=nil;
|
|
|
- sepLast:=sep;
|
|
|
- End;
|
|
|
+ If CheckCM(rtfGroup, rtfBeginGroup) then
|
|
|
+ SkipGroup
|
|
|
+ else if rtfClass<>rtfUnknown then
|
|
|
+ begin
|
|
|
+ if (CheckMM (rtfParAttr, rtfStyleNum)) then
|
|
|
+ sp^.rtfSNum:=rtfParam
|
|
|
+ else if (CheckMM (rtfStyleAttr, rtfBasedOn)) then
|
|
|
+ sp^.rtfSBasedOn:=rtfParam
|
|
|
+ else if (CheckMM (rtfStyleAttr, rtfNext)) then
|
|
|
+ sp^.rtfSNextPar:=rtfParam
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ new(sep);
|
|
|
+ if sep=nil then
|
|
|
+ Error ('SSErr - cannot allocate style element');
|
|
|
+ sep^.rtfSEClass:=rtfClass;
|
|
|
+ sep^.rtfSEMajor:=rtfMajor;
|
|
|
+ sep^.rtfSEMinor:=rtfMinor;
|
|
|
+ sep^.rtfSEParam:=rtfParam;
|
|
|
+ sep^.rtfSEText:=rtfTextBuf;
|
|
|
+ if sepLast=nil then
|
|
|
+ sp^.rtfSSEList:=sep { first element }
|
|
|
+ else { add to end }
|
|
|
+ sepLast^.rtfNextSE:=sep;
|
|
|
+ sep^.rtfNextSE:=nil;
|
|
|
+ sepLast:=sep;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ GetToken;
|
|
|
+ End;
|
|
|
if sp^.rtfSNextPar=-1 then { \snext not given }
|
|
|
sp^.rtfSNextPar:=sp^.rtfSNum; { next is itself }
|
|
|
if rtfClass<>rtfText then
|