Skip to content

Conversation

@oleibman
Copy link
Collaborator

@oleibman oleibman commented Dec 14, 2025

Fix #3255, another oldie (3+ years). Allow the ability to only count rows and columns with data. To avoid a breaking change, keep present logic unless Reader readEmptyCells attribute is set to its non-default value, i.e. false. This adds very little overhead, and gives a result that I think many users would prefer.

It was natural to look at the equivalent code for Ods while doing this. That code turned out to be buggy. Changes there are a bugfix, so I am not concerned about BC breaks, and therefore return what I think most users would want without the need for differing results depending on readEmptyCells.

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#3255, another oldie (3+ years). Allow the ability to only count rows and columns with data. To avoid a breaking change, keep present logic unless Reader `readEmptyCells` attribute is set to its non-default value, i.e. `false`. This adds very little overhead, and gives a result that I think many users would prefer.
It wasn't handling skipped rows and columns correctly.
@oleibman oleibman changed the title Xlsx Reader ListWorksheetInfo Honor readEmptyCells ListWorksheetInfo Improvements for Xlsx and Ods Dec 14, 2025
@oleibman oleibman added this pull request to the merge queue Dec 14, 2025
Merged via the queue into PHPOffice:master with commit 09f1a57 Dec 14, 2025
14 checks passed
@oleibman oleibman deleted the issue3255 branch December 14, 2025 16:18
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.

listWorksheetInfo method counts rows with empty strings

1 participant