Skip to content

Ods Reader Process Nested table-row #4531

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

Merged
merged 3 commits into from
Jul 15, 2025
Merged

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Jul 8, 2025

Fix #4528. Fix #2507. Ods Reader expects table:table-row to descend directly from table:table. But it turns out that it can be nested under table:table-header-rows, table:table-rows, or table:table-row-group. Similar considerations apply to table:table-column. Ods Reader is changed to process the nesting tags, and therefore the nested tags underneath them. This is a major change, but it doesn't seem to have broken any existing tests or samples.

No attempt is made to add any of the nesting tags in Ods Writer.

It should be noted that 4528 has an additional problem, which has been reported as issue #4530. It is not fixed by 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#4528. Fix PHPOffice#2507. Ods Reader expects `table:table-row` to descend directly from `table:table`. But it turns out that it can be nested under `table:table-header-rows`, `table:table-rows`, or `table:table-row-group`. Similar considerations apply to `table:table-column`. Ods Reader is changed to process the nesting tags, and therefore the nested tags underneath them. This is a major change, but it doesn't seem to have broken any existing tests or samples.

No attempt is made to add any of the nesting tags in Ods Writer.

It should be noted that 4528 has an additional problem, which has been reported as issue PHPOffice#4530. It is not fixed by this PR.
@oleibman
Copy link
Collaborator Author

oleibman commented Jul 8, 2025

Isolating the table-row logic into its own subroutine predictably, and unavoidably, creates a new F-complexity function, and Scrutinizer doesn't like that. This is not a concern.

@oleibman oleibman enabled auto-merge July 15, 2025 06:23
@oleibman oleibman added this pull request to the merge queue Jul 15, 2025
Merged via the queue into PHPOffice:master with commit a106886 Jul 15, 2025
12 of 13 checks passed
@oleibman oleibman deleted the issue4528 branch July 15, 2025 06:31
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.

Ods Reader wrong cell value Reader/Ods.php - missed table-row-group
1 participant