Merge pull request #2695 from PHPOffice/Error-Handling-Spill-Calc

Add basic support for Error functions when the error is #SPILL! or #CALC!
This commit is contained in:
Mark Baker 2022-03-18 17:59:58 +01:00 committed by GitHub
commit 0e7ee37ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class ErrorValue
return false;
}
return in_array($value, ExcelError::$errorCodes);
return in_array($value, ExcelError::$errorCodes) || $value === ExcelError::CALC();
}
/**

View File

@ -22,6 +22,7 @@ class ExcelError
'num' => '#NUM!',
'na' => '#N/A',
'gettingdata' => '#GETTING_DATA',
'spill' => '#SPILL!',
];
/**
@ -45,6 +46,10 @@ class ExcelError
++$i;
}
if ($value === self::CALC()) {
return 14;
}
return self::NA();
}

View File

@ -53,4 +53,12 @@ return [
7,
'#N/A',
],
[
9,
'#SPILL!',
],
[
14,
'#CALC!',
],
];

View File

@ -49,6 +49,14 @@ return [
true,
'#N/A',
],
[
true,
'#SPILL!',
],
[
true,
'#CALC!',
],
[
false,
'TRUE',