Browse Source

* Fixed reading of alternate font name

git-svn-id: trunk@11261 -
michael 17 years ago
parent
commit
29c2d93a57
1 changed files with 13 additions and 0 deletions
  1. 13 0
      packages/fcl-base/src/rtfpars.pp

+ 13 - 0
packages/fcl-base/src/rtfpars.pp

@@ -85,6 +85,7 @@ TRTFParser = class(TObject)
     Procedure UngetToken;
     Procedure SetToken (Aclass, major, minor, param : Integer; text : string);
     Procedure ExpandStyle (n : Integer);
+    Function GetRtfBuf : String;
     { Properties }
     Property Colors [Index : Integer]: PRTFColor Read GetColor;
     Property ClassCallBacks [AClass : Integer]: TRTFFuncptr
@@ -728,6 +729,13 @@ While true do
      Error ('FTErr - missing font name');
   fp^.rtffname:=bp;
   { Read alternate font}
+  if rtfclass=rtfgroup then
+    begin
+    SkipGroup;
+    if Not rtfMajor=ord(';') then
+      Error('Alternate font badly terminated');
+    GetToken;
+    end;
   if (old=0) then       { need to see "End;" here }
     Begin
     GetToken;
@@ -994,6 +1002,11 @@ while se<>nil do
 s^.rtfExpanding:=0;     { done - clear expansion flag }
 End;
 
+function TRTFParser.GetRtfBuf: String;
+begin
+  Result:=rtfTextBuf;
+end;
+
 { ---------------------------------------------------------------------
        Initialize lookup table hash values.
        Only need to do this the first time it's called.