-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for _xlfn. prefixed functions + implement ISFORMULA #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks very good. We should only figure out what to do when $pCell is null and then it should be mergeable.
* | ||
* @return bool | ||
*/ | ||
public static function isFormula($value = '', \PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either $pCell should not be optional or there should be a check whether it is null and do something else instead. Maybe add something like:
if (!is_object($pCell)) {
return Functions::REF();
}
and cover it with tests.
Thanks for the review. I wasn't sure under what circumstances it could be null? I've updated it to return a REF error instead and modified the test. Any thoughts on the boolean save conversion I mentioned above? |
Thank you for this nice contribution. For the boolean save conversion I suggest to create a new PR and it could be covered with functionnal tests, probably something similar to |
…`STDEV.P` This change adds support for newer functions that are prefixed by _xlfn. (PHPOffice#356). The calculation engine has been updated to recognise these as functions, and drop the _xlfn. part. It also add a couple of the new functions such as STDEV.S/P, MODE.SNGL, ISFORMULA. Fixes PHPOffice#356 Closes PHPOffice#390
This is:
Checklist:
Why this change is needed?
This change adds support for newer functions that are prefixed by _xlfn. (#356). The calculation engine has been updated to recognise these as functions, and drop the _xlfn. part. I've added a couple of the new functions such as STDEV.S/P, MODE.SNGL, ISFORMULA.
Whilst testing ISFORMULA, I see that loading and saving a spreadsheet that contains true or false values, without making any modifications causes the spreadsheet to contain integer 0 or 1 when loaded again in Excel. Could the following code block be added here
PhpSpreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
Line 1058 in 0084776
to resolve this?
Let me know if my PR needs amending.