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
This commit is contained in:
wp_xxyyzz
2016-02-14 11:15:23 +00:00
parent 22c42622a2
commit 4ecc8681b3

View File

@ -280,6 +280,8 @@ type
procedure WriteUTF8Text(ACell: PCell; AText: String; procedure WriteUTF8Text(ACell: PCell; AText: String;
ARichTextparams: TsRichTextParams = nil); overload; deprecated 'Use WriteText'; ARichTextparams: TsRichTextParams = nil); overload; deprecated 'Use WriteText';
procedure DeleteRichTextParams(ACell: PCell);
{ Writing of cell attributes } { Writing of cell attributes }
function WriteBackground(ARow, ACol: Cardinal; AStyle: TsFillStyle; function WriteBackground(ARow, ACol: Cardinal; AStyle: TsFillStyle;
APatternColor: TsColor = scTransparent; APatternColor: TsColor = scTransparent;
@ -498,6 +500,8 @@ type
procedure SetRepeatedPrintCols(AFirstCol: Cardinal; ALastCol: Cardinal = UNASSIGNED_ROW_COL_INDEX); procedure SetRepeatedPrintCols(AFirstCol: Cardinal; ALastCol: Cardinal = UNASSIGNED_ROW_COL_INDEX);
procedure SetRepeatedPrintRows(AFirstRow: Cardinal; ALastRow: 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 // Notification of changed cells
procedure ChangedCell(ARow, ACol: Cardinal); procedure ChangedCell(ARow, ACol: Cardinal);
@ -3374,6 +3378,22 @@ begin
end; end;
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. Removes the comment from a cell and releases the memory occupied by the node.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
@ -3953,6 +3973,19 @@ begin
WriteTextAsHTML(Result, AText); WriteTextAsHTML(Result, AText);
end; 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: Writes text containing HTML codes to a cell. Here are the allowed HTML codes:
<b>, <strong> ... bold text <b>, <strong> ... bold text