From 4ecc8681b3de695a41e8576572cbad73d5e1c25c Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 14 Feb 2016 11:15:23 +0000 Subject: [PATCH] fpspreadsheet: Add methods DeleteRichTextParams, HasRepeatedPrintCols and HasRepeatedPrintRows to TsWorksheet. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4497 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpspreadsheet.pas | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas index 62376c572..5311b6959 100755 --- a/components/fpspreadsheet/fpspreadsheet.pas +++ b/components/fpspreadsheet/fpspreadsheet.pas @@ -280,6 +280,8 @@ type procedure WriteUTF8Text(ACell: PCell; AText: String; ARichTextparams: TsRichTextParams = nil); overload; deprecated 'Use WriteText'; + procedure DeleteRichTextParams(ACell: PCell); + { Writing of cell attributes } function WriteBackground(ARow, ACol: Cardinal; AStyle: TsFillStyle; APatternColor: TsColor = scTransparent; @@ -498,6 +500,8 @@ type procedure SetRepeatedPrintCols(AFirstCol: Cardinal; ALastCol: Cardinal = UNASSIGNED_ROW_COL_INDEX); procedure SetRepeatedPrintRows(AFirstRow: Cardinal; ALastRow: Cardinal = UNASSIGNED_ROW_COL_INDEX); + function HasRepeatedPrintCols: Boolean; + function HasRepeatedPrintRows: Boolean; // Notification of changed cells procedure ChangedCell(ARow, ACol: Cardinal); @@ -3374,6 +3378,22 @@ begin end; end; +{@@ ---------------------------------------------------------------------------- + Determines whether the worksheet defines repeated print header columns +-------------------------------------------------------------------------------} +function TsWorksheet.HasRepeatedPrintCols: Boolean; +begin + Result := PageLayout.RepeatedCols.FirstIndex <> UNASSIGNED_ROW_COL_INDEX; +end; + +{@@ ---------------------------------------------------------------------------- + Determines whether the worksheet defines repeated print header rows +-------------------------------------------------------------------------------} +function TsWorksheet.HasRepeatedPrintRows: Boolean; +begin + Result := PageLayout.RepeatedRows.FirstIndex <> UNASSIGNED_ROW_COL_INDEX; +end; + {@@ ---------------------------------------------------------------------------- Removes the comment from a cell and releases the memory occupied by the node. -------------------------------------------------------------------------------} @@ -3953,6 +3973,19 @@ begin WriteTextAsHTML(Result, AText); end; +{@@ ---------------------------------------------------------------------------- + Removes any previously assigned richtext parameters from a specific cell. + This action fully restores the font of the cell. +-------------------------------------------------------------------------------} +procedure TsWorksheet.DeleteRichTextParams(ACell: PCell); +begin + if (ACell <> nil) and (Length(ACell^.RichTextParams) > 0) then + begin + SetLength(ACell^.RichTextParams, 0); + ChangedCell(ACell^.Row, ACell^.Col); + end; +end; + {@@ ---------------------------------------------------------------------------- Writes text containing HTML codes to a cell. Here are the allowed HTML codes: , ... bold text