fpspreadsheet: Add functions to initialize search and replace parameter records.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5946 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2017-06-17 22:16:58 +00:00
parent 92f5e6214d
commit aa308d6bd2

View File

@ -162,6 +162,11 @@ function RandomString(ALen: Integer): String;
function SplitStr(const AText: String; ADelimiter: Char): TStringArray;
function UnquoteStr(AString: String): String;
function InitSearchParams(ASearchText: String = ''; AOptions: TsSearchOptions = [];
ASearchWithin: TsSearchWithin = swWorksheet): TsSearchParams;
function InitReplaceParams(AReplaceText: String = '';
AOptions: TsReplaceOptions = []): TsReplaceParams;
function InitSortParams(ASortByCols: Boolean = true; ANumSortKeys: Integer = 1;
ASortPriority: TsSortPriority = spNumAlpha): TsSortParams;
@ -1988,6 +1993,37 @@ begin
end;
end;
{@@ ----------------------------------------------------------------------------
Initializes a SearchParams record. This record defines the parameters needed
when searching cells.
@param ASearchText This is the text to be searched
@param AOptions Defines options for searching (see TsSearchOptions)
@param AWithin Defines which part of the document is to be searched
-------------------------------------------------------------------------------}
function InitSearchParams(ASearchText: String = ''; AOptions: TsSearchOptions = [];
ASearchWithin: TsSearchWithin = swWorksheet): TsSearchParams;
begin
Result.SearchText := ASearchText;
Result.Options := AOptions;
Result.Within := ASearchWithin;
end;
{@@ ----------------------------------------------------------------------------
Initializes a RecplaceParams record. This record defined how the cell content
found after searching will be replaced
@param AReplaceText Is the text which will be inserted in the found cell
@param AOptions Defines options for the replacement (see
TsReplaceParams)
-------------------------------------------------------------------------------}
function InitReplaceParams(AReplaceText: String = '';
AOptions: TsReplaceOptions = []): TsReplaceParams;
begin
Result.ReplaceText := AReplaceText;
Result.Options := AOptions;
end;
{@@ ----------------------------------------------------------------------------
Initializes a Sortparams record. This record sets paramaters used when cells
are sorted.