Commit Graph

5659 Commits

Author SHA1 Message Date
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 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 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 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 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
oleibman 3cc82a975c Border Tweak
Do not override base style if conditional style indicates BORDER_OMIT.

Do not export BORDER_NONE color 0 for conditional; same approach is already taken for unconditional.
2025-07-17 10:20:25 -07:00
oleibman 2735c40179 StyleMerger Use Copy Of baseStyle
Using baseStyle directly can lead to the by-reference problems associated with Cell and Style.
2025-07-17 07:45:55 -07:00
oleibman ffeaa42583 Emulate Xlsx More Closely
Xlsx conditional styles cannot be used to change alignment, nor font family, nor font size.

Conditional::getStyle currently allocates a new style as an unconditional style; it is changed to do so a conditional ctyle.

Border should not be conditionally merged if borderStyle is OMIT.

Inline Css was generating `class="gridlines gridlinesp"` for all cells. It is changed to use the worksheet settings to decide which classes to use.
2025-07-16 22:11:53 -07:00
oleibman a15091737f Html Writer Conditional Formatting Inline Css
Fix #4539. Conditional Formatting was recently added to Html Writer. It works fine when not using inline Css. However, when using inline Css, the code inadvertently added 2 different `style` attributes (one for the unconditional style and one for the conditional style) to the same cell. This is not valid html, and results in losing the conditional styling. This PR combines the two `style` attributes into one, which will now come after the `class`, `colspan`, and `rowspan` attributes.

Aside from the new tests, this PR changes an unusually large number of existing tests. While this might normally be considered a red flag, it is not a problem here. All of the changes involve merely changing the order of attributes within html tags; none of them affect how the generated html would appear in a browser.
2025-07-15 22:22:34 -07:00
oleibman b82756de76 Don't Use htmlspecialchars When Formatting Xml
Fix #4537. PhpSpreadsheet currently changes apostrophes in text values to `'`. This is perfectly valid Xml. Issue was opened because R does not handle this correctly; this is unquestionably a bug on R's part. So I was not inclined to do anything about it. However ...

User suggested a change to how `htmlspecialchars` was called. Investigating the use of that routine in PhpSpreadsheet, I found that there was some double escaping going on for cells whose type was set to `TYPE_INLINE` - `htmlspecialchars` escaped the string correctly, but it was later written as Xml using a method which escaped the data a second time. So, a real bug in PhpSpreadsheet after all.

There was one call to `htmlspecialchars` in `Shared\XmlWriter`. I replaced `writeRaw(htmlspecialchars(...))` with `text(...)`. And one call in `Writer\Xlsx\Worksheet`, the source of the double escaping bug above; the call to `htmlspecialchars` can just be eliminated there.

Making those changes, the only remaining calls to `htmlspecialchars` are in `Writer\Html`, where they belong. As a bonus, apostrophes now wind up unescaped, so R will be satisfied (even though they should fix their bug).
2025-07-15 21:53:43 -07:00
oleibman 250394d128 Preserve 0x0a In Strings If Desired
Fix #347, which had gone stale but is now reopened. PhpSpreadsheet is automatically replacing CR-LF and CR with LF. The reason for this is unknown, although I suggest a possibility in the issue. I am not willing to make this a breaking change. This PR adds a new property `preserveCr` with setter and getter to DefaultValueBinder (and, by extension, to StringValueBinder and AdvancedValueBinder). The property defaults to false, but users who wish to preserve CR-LF and CR can set it to true for a Spreadsheet or a Reader.
2025-07-15 00:26:20 -07:00
oleibman 2d676462a3 Merge pull request #4532 from oleibman/builtinnumfmt
Excel Inappropriate Number Format Substitution
2025-07-15 06:41:18 +00:00
oleibman 8fb10a665f Update CHANGELOG.md 2025-07-14 23:38:32 -07:00
oleibman a106886447 Merge pull request #4531 from oleibman/issue4528
Ods Reader Process Nested table-row
2025-07-15 06:25:13 +00:00
oleibman b5af16def9 Merge branch 'master' into issue4528 2025-07-14 23:22:15 -07:00
oleibman 11dc1fb67e Update CHANGELOG.md 2025-07-14 23:20:41 -07:00
oleibman 98f464b41f Writer Html/Pdf Support RTL Alignment of Table
Fix #1104, which went stale over 6 years ago, and is now reopened. This PR addresses the alignment of the table, not alignment of text. Support is added for the following:

- Html. Full support.
- Mpdf. Full support, except that, when mixed LTR and RTL worksheets are output, all tables will be on the left of the page (but will be properly aligned).
- Tcpdf. Full support when all worksheets being output are RTL; no support when mixed LTR and RTL worksheets are output.
- Dompdf. No support.
2025-07-14 00:22:54 -07:00
oleibman 159059595e Minor Tweaks 2025-07-11 17:13:53 -07:00
oleibman ae4df820bf Xlsx Reader Use Dynamic Arrays if Spreadsheet Did So
By default, when an Xlsx spreadsheet is read, its calculation engine is set to `RETURN_ARRAY_AS_VALUE` for array formulas. The user does have the option to change this. However, the presence of certain metadata in the file indicates that it was saved as if `RETURN_ARRAY_AS_ARRAY` was in use. This PR tests for the metadata, and, if present, sets `...ARRAY` rather than `...VALUE`. This eliminates the need for any extra action on the user's part.
2025-07-10 18:11:41 -07:00