Skip to content
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

Two Problems with Sample19 #2080

Merged
merged 2 commits into from
May 19, 2021
Merged

Two Problems with Sample19 #2080

merged 2 commits into from
May 19, 2021

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented May 9, 2021

19_NamedRange.php was not changed to use absolute addressing when that was introduced to Named Ranges. Consequently, the output from this sample has been wrong ever since, for both Xls and Xlsx.

There was an additional problem with Xls. It appears that the Xls Writer Parser does not parse multiple concatenations using the ampersand operator correctly. So, =B1+" "+B2 was parsed as =B1+" ". I believe that this is due to ampersand being treated as a condition rather than an operator; A1>A2>A3 isn't valid, but A1&A2&A3 is. My original PR (#1992, which I will now close) only partially resolved this, but I think moving ampersand handling from condition to expression is fully successful.

There are already more than ample tests for Named Ranges, so I did not add a new one for that purpose. However, I did add a new test for the Xls parser problem.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

19_NamedRange.php was not changed to use absolute addressing when that was introduced to Named Ranges. Consequently, the output from this sample has been wrong ever since, for both Xls and Xlsx.

There was an additional problem with Xls. It appears that the Xls Writer Parser does not parse multiple concatenations using the ampersand operator correctly. So, `=B1+" "+B2` was parsed as `=B1+" "`. I believe that this is due to ampersand being treated as a condition rather than an operator; `A1>A2>A3` isn't valid, but `A1&A2&A3` is. My original PR (PHPOffice#1992, which I will now close) only partially resolved this, but I think moving ampersand handling from `condition` to `expression` is fully successful.

There are already more than ample tests for Named Ranges, so I did not add a new one for that purpose. However, I did add a new test for the Xls parser problem.
@oleibman oleibman mentioned this pull request May 9, 2021
5 tasks
@oleibman oleibman merged commit d0570bc into PHPOffice:master May 19, 2021
@oleibman oleibman deleted the sample19b branch July 1, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant