-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Case-sensitivity with string equalities #31
Comments
I confirm the issue still exists and can be summed up like so:
Interestingly LibreOffice 4.0 seems to implement both modes. When creating a new document, it will be case sensitive (default behavior), but if you save it as .xlsx and re-open it, it will switch to case insensitive (Excel compatible behavior). The documentation does not mention anything though: https://help.libreoffice.org/Calc/Operators_in_Calc My opinion is PHPExcel is not called PHPLibreOffice for a reason, and as much as it pains me to say it, I would implement Excel behavior as closely as possible. I will have a look at PHPExcel source code and see if I can submit a PR... |
I should add that Google Drive spreadsheets, behave the same way as Excel. One more argument in favor of Excel behavior for what it is worth... |
This is consistent with Excel behavior (tested on Excel 2010). Fixes PHPOffice#31
Excel, Gnumeric and Google Spreadsheet are case insensitive, so the default behavior of PHPExcel is modified accordingly. However OpenOffice is case sensitive and is also supported via the compatibility mode of PHPExcel. Fixes PHPOffice#31
Excel, Gnumeric and Google Spreadsheet are case insensitive, so the default behavior of PHPExcel is modified accordingly. However OpenOffice is case sensitive and is also supported via the compatibility mode of PHPExcel. Fixes PHPOffice#31
Excel, Gnumeric and Google Spreadsheet are case insensitive, so the default behavior of PHPExcel is modified accordingly. However OpenOffice is case sensitive and is also supported via the compatibility mode of PHPExcel. Fixes PHPOffice#31
I updated my original Pull Request, and it now properly support compatibility mode setting to use case sensitive for OpenOffice and case insensitive for everything else. On a side note, I noticed PHPExcel unit tests would need a lot of love to fix them all. If I ever happen to do some of that work, on which branch should it be ? develop or develop_2.0.0 ? |
The unit tests certainly need a lot of love and attention, and have been largely neglected for a long time, and I'm ore than happy to see some new work in that area. The develop_2.0.0 branch is dead for the moment; I've refactored a lot of the code to use a an object factory, and moved some of the core components to a repository common for all PHPOffice applications; and am rewriting the calculation engine significantly, and those changes won't merge cleanly with any existing branch. So any additions should be against the develop branch. |
Thank you for the clarification. I was indeed wondering how you planned to |
In Excel "Cool" = "COOL"
In PHPExcel "Cool" <> "COOL"
As such, customer had formula in workbook: =IF(A2="NONE",True,False)
In Excel, when A2 = "None" the formula returns True
In PHPExcel the calculated value for the formula cell returns False
I did a cursory scan to try and find the culprit lines in the codebase but the Calculation engine is pretty dense so I figured I'd just toss this one over the wall. Maybe it is this way on purpose due to behavior of other spreadsheet apps - maybe it needs to be a condition just for COMPATIBILITY_EXCEL?
Easy enough to work around (made the customer match case in the workbook values), but I would think a guiding goal for PHPExcel would be to have consistency with Excel results.
Thanks!
The text was updated successfully, but these errors were encountered: