You've already forked lazarus-ccr
fpspreadsheet: HTML reader reckignozes font specified in "styles" attribute of "table" element as default font of worksheet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4255 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -31,6 +31,7 @@ type
|
|||||||
FCurrRow, FCurrCol: LongInt;
|
FCurrRow, FCurrCol: LongInt;
|
||||||
FCurrCellFormat: TsCellFormat;
|
FCurrCellFormat: TsCellFormat;
|
||||||
FCellFont: TsFont;
|
FCellFont: TsFont;
|
||||||
|
FCurrFont: TsFont;
|
||||||
FCellText: String;
|
FCellText: String;
|
||||||
FAttrList: TsHTMLAttrList;
|
FAttrList: TsHTMLAttrList;
|
||||||
FColSpan, FRowSpan: Integer;
|
FColSpan, FRowSpan: Integer;
|
||||||
@ -148,10 +149,12 @@ begin
|
|||||||
FTableCounter := -1;
|
FTableCounter := -1;
|
||||||
FAttrList := TsHTMLAttrList.Create;
|
FAttrList := TsHTMLAttrList.Create;
|
||||||
FCellFont := TsFont.Create;
|
FCellFont := TsFont.Create;
|
||||||
|
FCurrFont := TsFont.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TsHTMLReader.Destroy;
|
destructor TsHTMLReader.Destroy;
|
||||||
begin
|
begin
|
||||||
|
FreeAndNil(FCurrFont);
|
||||||
FreeAndNil(FCellFont);
|
FreeAndNil(FCellFont);
|
||||||
FreeAndNil(FAttrList);
|
FreeAndNil(FAttrList);
|
||||||
FreeAndNil(parser);
|
FreeAndNil(parser);
|
||||||
@ -480,6 +483,11 @@ begin
|
|||||||
FInTable := true;
|
FInTable := true;
|
||||||
FCurrRow := -1;
|
FCurrRow := -1;
|
||||||
FCurrCol := -1;
|
FCurrCol := -1;
|
||||||
|
InitFont(FCurrFont);
|
||||||
|
FAttrList.Parse(ActualTag);
|
||||||
|
ExtractFont(FCurrFont);
|
||||||
|
FWorkbook.ReplaceFont(DEFAULT_FONTINDEX, FCurrFont.FontName, FCurrFont.Size,
|
||||||
|
FCurrFont.Style, FCurrFont.Color, FCurrFont.Position);
|
||||||
end else
|
end else
|
||||||
if FTableCounter = HTMLParams.TableIndex then
|
if FTableCounter = HTMLParams.TableIndex then
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user