You've already forked lazarus-ccr
fpspreadsheet: Fix font identification issue of OOXML reader for files written by fpspreadsheet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3467 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -978,6 +978,7 @@ var
|
|||||||
fntColor: TsColor;
|
fntColor: TsColor;
|
||||||
nodename: String;
|
nodename: String;
|
||||||
s: String;
|
s: String;
|
||||||
|
isNilFont: Boolean;
|
||||||
begin
|
begin
|
||||||
fnt := Workbook.GetDefaultFont;
|
fnt := Workbook.GetDefaultFont;
|
||||||
if fnt <> nil then begin
|
if fnt <> nil then begin
|
||||||
@ -993,6 +994,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
node := ANode.FirstChild;
|
node := ANode.FirstChild;
|
||||||
|
isNilFont := node = nil;
|
||||||
while node <> nil do begin
|
while node <> nil do begin
|
||||||
nodename := node.NodeName;
|
nodename := node.NodeName;
|
||||||
if nodename = 'name' then begin
|
if nodename = 'name' then begin
|
||||||
@ -1032,6 +1034,7 @@ begin
|
|||||||
|
|
||||||
{ We must not check for duplicate fonts here because then we cannot reconstruct
|
{ We must not check for duplicate fonts here because then we cannot reconstruct
|
||||||
the correct font id later }
|
the correct font id later }
|
||||||
|
if not isNilFont then // the font #4 (nil) is added automatically --> skip it here
|
||||||
FWorkbook.AddFont(fntName, fntSize, fntStyles, fntColor);
|
FWorkbook.AddFont(fntName, fntSize, fntStyles, fntColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user