Resolve Conditional Formatting issues with Xls writer #2673
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is:
Checklist:
Why this change is needed?
This PR resolves the problem with writing a CF Header for each CF range, no matter how many rules there are for that range, rather than writing a single header for all ranges.
It does not appear that this has ever worked correctly, and that only writing a single CF range was supported before, but recent changes to provide examples of multiple CF ranges in a single worksheet have highlighted the problem, while a modification to the Xls Writer to support multiple ranges actually broke the CF Writer so that Excel issues a warning when the file is opened.
Now the code can also handle:
None of these previously worked. All cell reference, string literal or formula expressions used as rule values were silently converted to integer 0
In the event of s formula expressions that Xls itself doesn't support (e.g. when they use an Excel function that isn't known to the BIFF format), the code defaults the condition to
ptgInt+0 (=0) to avoid breaking the structure of the file.