diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas index 82dfac923..fadb034f2 100755 --- a/components/fpspreadsheet/fpspreadsheet.pas +++ b/components/fpspreadsheet/fpspreadsheet.pas @@ -361,6 +361,7 @@ type procedure WriteFont(ARow, ACol: Cardinal; AFontIndex: Integer); overload; function WriteFontColor(ARow, ACol: Cardinal; AFontColor: TsColor): Integer; function WriteFontSize(ARow, ACol: Cardinal; ASize: Integer): Integer; + function WriteFontStyle(ARow, ACol: Cardinal; AStyle: TsFontStyles): Integer; procedure WriteTextRotation(ARow, ACol: Cardinal; ARotation: TsTextRotation); procedure WriteUsedFormatting(ARow, ACol: Cardinal; AUsedFormatting: TsUsedFormattingFields); procedure WriteBackgroundColor(ARow, ACol: Cardinal; AColor: TsColor); @@ -1448,6 +1449,17 @@ begin Result := WriteFont(ARow, ACol, fnt.FontName, ASize, fnt.Style, fnt.Color); end; +function TsWorksheet.WriteFontStyle(ARow, ACol: Cardinal; + AStyle: TsFontStyles): Integer; +var + lCell: PCell; + fnt: TsFont; +begin + lCell := GetCell(ARow, ACol); + fnt := Workbook.GetFont(lCell^.FontIndex); + Result := WriteFont(ARow, ACol, fnt.FontName, fnt.Size, AStyle, fnt.Color); +end; + {@@ Adds text rotation to the formatting of a cell