mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 12:20:28 +02:00
* Fixed style reading for OOffice documents
git-svn-id: trunk@11268 -
This commit is contained in:
parent
91116c2e21
commit
96edd65a89
@ -803,6 +803,7 @@ var
|
||||
sp : PRTFStyle;
|
||||
sep,sepLast : PRTFStyleElt;
|
||||
bp : string[rtfBufSiz];
|
||||
I : Integer;
|
||||
|
||||
Begin
|
||||
While true do
|
||||
@ -823,25 +824,22 @@ 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 CheckCM(rtfGroup, rtfBeginGroup) then
|
||||
SkipGroup
|
||||
else if rtfClass<>rtfUnknown then
|
||||
begin
|
||||
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;
|
||||
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');
|
||||
@ -856,6 +854,9 @@ While true do
|
||||
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 }
|
||||
|
Loading…
Reference in New Issue
Block a user