You've already forked lazarus-ccr
fpspreadsheet: Reading/writing of error values for xlsx and ods (initial implementation was incomplete).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4248 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -86,6 +86,8 @@ function GetCellRangeString(ARange: TsCellRange;
|
||||
AFlags: TsRelFlags = rfAllRel; Compact: Boolean = false): String; overload;
|
||||
|
||||
function GetErrorValueStr(AErrorValue: TsErrorValue): String;
|
||||
function TryStrToErrorValue(AErrorStr: String; out AErr: TsErrorValue): boolean;
|
||||
|
||||
function GetFileFormatName(AFormat: TsSpreadsheetFormat): string;
|
||||
function GetFileFormatExt(AFormat: TsSpreadsheetFormat): String;
|
||||
function GetFormatFromFileName(const AFileName: TFileName;
|
||||
@@ -761,6 +763,32 @@ begin
|
||||
AFlags, Compact);
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Returns the error value code from a string. Result is false, if the string does
|
||||
not match one of the predefined error strings.
|
||||
|
||||
@param AErrorStr Error string
|
||||
@param AErr Corresponding error value code (type TsErrorValue)
|
||||
@result TRUE if error code could be determined from the error string,
|
||||
FALSE otherwise.
|
||||
-------------------------------------------------------------------------------}
|
||||
function TryStrToErrorValue(AErrorStr: String; out AErr: TsErrorValue): boolean;
|
||||
begin
|
||||
Result := true;
|
||||
case AErrorStr of
|
||||
'#NULL!' : AErr := errEmptyIntersection;
|
||||
'#DIV/0!' : AErr := errDivideByZero;
|
||||
'#VALUE!' : AErr := errWrongType;
|
||||
'#REF!' : AErr := errIllegalRef;
|
||||
'#NAME?' : AErr := errWrongName;
|
||||
'#NUM!' : AErr := errOverflow;
|
||||
'#N/A' : AErr := errArgError;
|
||||
'#FORMULA?': AErr := errFormulaNotSupported;
|
||||
'' : AErr := errOK;
|
||||
else Result := false;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Returns the message text assigned to an error value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user