Commit Graph

5673 Commits

Author SHA1 Message Date
oleibman 9c083e271d Header/Footer Images Expand "Location"
Fix #484. Fix #1318. Both went stale a long time ago. The images can currently specify their location as Left, Center, or Right. However, they also need to specify their type - first page, even pages, or odd pages (which is what is used when neither of the others is applicable). This is accomplished by adding 18 new constants to `Worksheet\HeaderFooter`, any of which can be specified as the second argument to `HeaderFooter::addImage`. Somewhat surprisingly, no changes are required to Xlsx Writer or Reader.

Xls Reader and Writer support header/footer, but do not support using images in them. No other readers nor writers support header/footer.
2025-08-04 18:15:19 -07:00
oleibman f65b0a2d10 Merge pull request #4570 from oleibman/complextests
Redo ComplexAssert
2025-08-03 15:56:42 +00:00
oleibman e78bca9668 Merge pull request #4556 from oleibman/xmlspace
Xlsx Writer Eliminate xml:space From Non-Text Nodes
2025-08-03 15:46:51 +00:00
oleibman c32605828b Update CHANGELOG.md 2025-08-03 08:44:08 -07:00
oleibman 3dcdbcac3e Redo ComplexAssert
Its use is already causes an issue with Phpstan. It uses interfaces marked as internal by Phpunit, and it will not work with Phpunit 12. It is more complicated than needed. This PR corrects all these problems. It also corrects a handful of other problems that will show up with Phpunit 12. Only tests are changed - no source code.
2025-08-03 08:25:05 -07:00
oleibman 8f7a401f74 Merge pull request #4569 from oleibman/stanfixer
Upgrade Phpstan and php-cs-fixer
2025-08-03 04:07:14 +00:00
oleibman eb53b55157 Upgrade Phpstan and php-cs-fixer 2025-08-02 20:29:32 -07:00
oleibman b726eb3f1c Merge pull request #4554 from oleibman/deprecations
Eliminate Deprecated Constants
2025-08-03 02:10:41 +00:00
oleibman 6d8fc67512 Merge branch 'master' into deprecations 2025-08-02 19:07:45 -07:00
oleibman 7e89ad9e08 Merge pull request #4551 from oleibman/base2html
Minor Breaking Change - Move Some BaseWriter Properties
2025-08-03 01:49:48 +00:00
oleibman 20ac2f1940 Merge pull request #4527 from oleibman/issue4522
Minor Breaking Change to DefaultValueBinder
2025-08-03 01:48:03 +00:00
oleibman ac4befd2f7 Merge commit from fork 2025-08-02 18:06:29 -07:00
oleibman 624dafa3b8 Merge branch 'master' into deprecations 2025-07-30 21:33:35 -07:00
oleibman 95b4e32da2 Merge pull request #4561 from oleibman/docnoprivate
Remove Private Methods/Properties From Online Doc
2025-07-31 00:09:03 +00:00
oleibman bc6c09c8da Remove Private Methods/Properties From Online Doc
Documenting public and protected methods is useful; I don't believe it is useful to document private methods. If people really need them, they can clone the project and run PhpDocumentor against it.

As long as I'm at it, we are several releases behind in PhpDocumentor. Use the latest (3.8.1 replacing 3.5.0). I have confirmed that this works locally on my machine. There's no real way to verify the change until the next PhpSpreadsheet release. Hope it works.
2025-07-30 17:02:06 -07:00
oleibman 69b65d4e2a Xlsx Writer Eliminate xml:space From Non-Text Nodes
Fix #4542. PhpSpreadsheet has been writing attribute `xml:space="preserve"` to the `table` tag when writing a Table. According to the issue, Excel 2016 is treating the resulting file as corrupt. I do not have access to a version of Excel 2016 to confirm. This seems to be a bug with that release. Nevertheless, the OOXML spec, with over 100 references to `xml:space` does not indicate that it is a permitted attribute for `table`. It should only be specified for text nodes. This PR eliminates the undocumented, and unneeded, usage.

Investigating further, PhpSpreadsheet also writes this attribute for `workbook`, `styleSheet`, and `worksheet` tags. It is again undocumented and unneeded in those cases. Although all Excel releases, including 2016, apparently tolerate such usage, this PR also eliminates those.

Finally, there is one case where PhpSpreadsheet omits this tag when it is needed. When writing a cell whose data type is an inline string, and the string contains leading or trailing whitespace, the text tag needs to specify `xml:space`, and is now changed to do so.
2025-07-26 00:08:33 -07:00
oleibman 0b75730cc9 Merge pull request #4555 from oleibman/breakdoc
Changelog Update Semantic Versioning Statement
2025-07-26 05:23:52 +00:00
oleibman ce399b4bc7 Changelog Update Semantic Versioning Statement 2025-07-25 22:16:55 -07:00
oleibman a12a0d0271 Eliminate Deprecated Constants
In Theme, change COLOR_SCHEME_2013_PLUS_NAME to private (use COLOR_SCHEME_2013_2022_NAME instead), and delete COLOR_SCHEME_2013_PLUS (use COLOR_SCHEME_2013_2022).
2025-07-24 01:27:56 -07:00
oleibman 7d1562a55b Merge pull request #4553 from PHPOffice/trimchangelog
Trim Change Log
2025-07-24 05:56:49 +00:00
oleibman 6e9d0a0c0e Trim Change Log 2025-07-23 22:52:57 -07:00
oleibman 2ea9786632 Merge pull request #4552 from oleibman/changelog20250723
Prepare Changelog for New Release
4.5.0
2025-07-24 05:15:59 +00:00
oleibman da5f6952bd Prepare Changelog for New Release 2025-07-23 22:11:19 -07:00
oleibman dfa1d46868 Merge pull request #4543 from oleibman/blockimages
All Readers - Allow or Forbid Fetching of External Images
2025-07-23 04:39:36 +00:00
oleibman 59e20db22f Merge branch 'master' into blockimages 2025-07-22 21:32:24 -07:00
oleibman 2c4ad945cd Update Changelog 2025-07-22 21:23:55 -07:00
oleibman 92b0a84210 Minor Breaking Change - Move Some BaseWriter Properties
When Conditional and Table Formatting were added to Html Reader, properties, getters, and setters were added to BaseReader. They should have been added to Html Reader instead, and this PR moves them from one to the other. It is technically a breaking change, but, since there is no reason to use them with any writer other than Html, I don't anticipate anyone seeing any adverse effects.
2025-07-21 22:19:58 -07:00
oleibman adb7459dfe Merge pull request #4541 from oleibman/issue4539
Html Writer Conditional Formatting Inline Css
2025-07-22 04:26:08 +00:00
oleibman b489fb3a17 Merge branch 'master' into issue4539 2025-07-21 21:23:15 -07:00
oleibman 40138b4110 Update CHANGELOG.md 2025-07-21 21:21:59 -07:00
oleibman 994b072418 Merge pull request #4540 from oleibman/issue4537
Don't Use htmlspecialchars When Formatting Xml
2025-07-22 04:12:28 +00:00
oleibman e005fdb49a Update CHANGELOG.md 2025-07-21 21:09:19 -07:00
oleibman 3538c7e0af Merge branch 'master' into issue4537 2025-07-21 20:52:07 -07:00
oleibman ba72dfe132 Update CHANGELOG.md 2025-07-21 20:51:12 -07:00
oleibman 143921118e Merge pull request #4544 from oleibman/replacedummy
Allow Replace of Dummy Function with Custom Function
2025-07-21 01:06:39 +00:00
oleibman dfb9411da7 Merge branch 'master' into replacedummy 2025-07-20 18:03:39 -07:00
oleibman 4e8bf60a28 Update CHANGELOG.md 2025-07-20 18:02:36 -07:00
oleibman 6b3cb42db2 Merge branch 'master' into issue4522 2025-07-19 16:54:27 -07:00
oleibman 09442da690 Merge pull request #4536 from oleibman/issue347
Preserve 0x0a In Strings If Desired
2025-07-19 23:45:02 +00:00
oleibman 8cbd7a201d Update CHANGELOG.md 2025-07-19 16:36:50 -07:00
oleibman 36dd484c86 Merge branch 'master' into issue347 2025-07-18 23:28:48 -07:00
oleibman 4403ffc7e5 Merge branch 'master' into replacedummy 2025-07-18 22:47:10 -07:00
oleibman f1477b130f Allow Replace of Dummy Function with Custom Function
Custom functions were introduced recently, with a restriction that non-custom functions could not be replaced. However, reviewing a recent issue has led me to the conclusion that it might sometimes be impractical to implement an Excel function in PhpSpreadsheet for all users, but it could still be helpful to some users to offer an implementation anyhow.

The Excel ASC function is currently unimplemented in PhpSpreadsheet, and is a candidate for replacement using the functionality added in this PR. This PR supersedes PR #4513, which I will now close, and its earlier incarnation PR #4511. For reasons discussed in 4513, I don't see a way forward for implementing the Excel ASC function in a way that would be generally usable. However, this PR would permit a user to implement ASC in a way which would satisfy the user's local requirements. See the new `testReplaceDummyFunction`; I think, or at least hope, that, despite the deficiencies of 4511 and 4513, this might satisfy the author's requirement.
2025-07-18 22:01:59 -07:00
oleibman a9c6cbe146 All Readers - Allow or Forbid Fetching of External Images
Add to all readers the option to allow or forbid fetching external images. This is unconditionally allowed now. The default will be set to "allow", so no code changes are necessary. However, we are giving consideration to changing the default.
2025-07-18 21:22:09 -07:00
oleibman b442eefd80 Merge pull request #4535 from oleibman/issue1104
Writer Html/Pdf Support RTL Alignment of Table
2025-07-18 04:47:41 +00:00
oleibman 450c900ccd Merge branch 'master' into issue1104 2025-07-17 21:44:59 -07:00
oleibman 09f6a1df9f Update CHANGELOG.md 2025-07-17 21:43:45 -07:00
oleibman e1d26a0bff Merge pull request #4533 from oleibman/readdynam
Xlsx Reader Use Dynamic Arrays if Spreadsheet Did So
2025-07-18 04:34:04 +00:00
oleibman 7c1da83f8d Merge branch 'master' into readdynam 2025-07-17 21:31:08 -07:00
oleibman 5ca9c5a44e Update CHANGELOG.md 2025-07-17 21:29:26 -07:00