Skip to content

Conversation

@oleibman
Copy link
Collaborator

@oleibman oleibman commented Sep 5, 2025

Fix #4629. Excel Xml can specify Conditional Formatting in 2 ways - either using a conditionalFormatting tag as a child of worksheet, or in a slightly different manner as a child of worksheet->extLst. Although these are both handled by PhpSpreadsheet, the former is lost if there exists a latter whose cell range (sqref) matches it. This PR merges the former with the latter in that circumstance, preserving both.

The issue also notes that font and stopIfTrue are not handled correctly. Support for those was missing in the extlst handling, and is now added with this PR.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

Fix PHPOffice#4629. Excel Xml can specify Conditional Formatting in 2 ways - either using a `conditionalFormatting` tag as a child of `worksheet`, or in a slightly different manner as a child of `worksheet->extLst`. Although these are both handled by PhpSpreadsheet, the former is lost if there exists a latter whose cell range (`sqref`) matches it. This PR merges the former with the latter in that circumstance, preserving both.

The issue also notes that `font` and `stopIfTrue` are not handled correctly. Support for those was missing in the `extlst` handling, and is now added with this PR.
@oleibman oleibman enabled auto-merge September 7, 2025 07:38
@oleibman oleibman added this pull request to the merge queue Sep 7, 2025
Merged via the queue into PHPOffice:master with commit 109b2b2 Sep 7, 2025
13 checks passed
@oleibman oleibman deleted the issue4629 branch September 9, 2025 19:36
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.

Conditional formatting that spans two sheets is read incorrectly

1 participant