From d55fda1022d3db5d1dbf918d1c6d08a21c48b26d Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 5 May 2014 19:36:45 +0000 Subject: [PATCH] fpspreadsheet: Add "WriteFontStyle" to TsWorksheet. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3010 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpspreadsheet.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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