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 #1992

Closed
wants to merge 1 commit into from
Closed

Two Problems with Sample19 #1992

wants to merge 1 commit into from

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Apr 7, 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. I attempted to resolve this, but my attempt is only partially successful. I tried to parse it as other operators by treating the left side as a 'term' rather than an 'expression'. In the resulting spreadsheet, the cell contains the correct calculated value, but it does not contain the actual formula. This is better than it had been, so I have left that change intact while I continue to research.

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. I attempted to resolve this, but my attempt is only partially successful. I tried to parse it as other operators by treating the left side as a 'term' rather than an 'expression'. In the resulting spreadsheet, the cell contains the correct calculated value, but it does not contain the actual formula. This is better than it had been, so I have left that change intact while I continue to research.

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 marked this pull request as draft May 9, 2021 17:29
@oleibman
Copy link
Collaborator Author

oleibman commented May 9, 2021

I tried to push a complete fix for the Xlsx Writer concatenation operator problem, but it didn't automatically merge. I will close this PR and submit another in its place tonight.

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this pull request 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 (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
Copy link
Collaborator Author

oleibman commented May 9, 2021

Closing, superseded by #2080.

@oleibman oleibman closed this May 9, 2021
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