diff --git a/components/fpspreadsheet/source/common/fpsutils.pas b/components/fpspreadsheet/source/common/fpsutils.pas index 6dc131398..70b00e4cc 100644 --- a/components/fpspreadsheet/source/common/fpsutils.pas +++ b/components/fpspreadsheet/source/common/fpsutils.pas @@ -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.