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

Clone Worksheet With Table and/or Chart #3821

Merged
merged 5 commits into from Dec 13, 2023
Merged

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Dec 11, 2023

Fix #3820. When cloning a worksheet, special handling is already included for cellCollection and drawingCollection. It needs to be added for tableCollection as well.

chartCollection also needs similar treatment. It is more difficult because clone methods now need to be added for most of the Chart objects, and testing is more difficult. I had not planned to add this to the PR, but have since changed my mind.

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

Why this change is needed?

Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

Fix PHPOffice#3820. When cloning a worksheet, special handling is already included for `cellCollection` and `drawingCollection`. It needs to be added for `tableCollection` as well. In theory, `chartCollection` also needs it. However, there are no clone methods for any of the Chart objects, so that will be a substantially larger effort. There is no need to delay this fix waiting for that.
@oleibman
Copy link
Collaborator Author

No concerns about Scrutinizer "complexity" message.

I had originally said I wouldn't add it to this PR, but I have changed my mind.
@oleibman oleibman changed the title Clone Worksheet With Table Clone Worksheet With Table and/or Chart Dec 12, 2023
@oleibman oleibman added this pull request to the merge queue Dec 13, 2023
Merged via the queue into PHPOffice:master with commit 0fd7cc3 Dec 13, 2023
13 of 14 checks passed
@oleibman oleibman deleted the issue3820 branch December 13, 2023 16:37
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.

Error when cloning sheet inside XLSX with a table
1 participant