fpspreadsheet: Fix worksheet crashing when Font #4 is created.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6829 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-03-06 23:23:57 +00:00
parent cadad7b0aa
commit a52a6a75a8
2 changed files with 2 additions and 2 deletions

View File

@ -447,3 +447,4 @@ msgstr "Die Datei kann nicht geschrieben werden, weil der Name des Arbeitsblatte
#: fpsstrings.rsyellow
msgid "yellow"
msgstr "gelb"

View File

@ -6243,8 +6243,7 @@ begin
if ACell = nil then
exit;
if (AFontIndex < 0) or (AFontIndex >= Workbook.GetFontCount) or (AFontIndex = 4) then
// note: Font index 4 is not defined in BIFF
if (AFontIndex < 0) or (AFontIndex >= Workbook.GetFontCount) then
raise EFPSpreadsheet.Create(rsInvalidFontIndex);
fmt := Workbook.GetCellFormat(ACell^.FormatIndex);