Commit Graph

5693 Commits

Author SHA1 Message Date
oleibman 0c8db6e7d2 Merge branch 'master' into issue1324 2025-08-07 20:33:00 -07:00
oleibman d1db7845cc Update CHANGELOG.md 2025-08-07 20:30:24 -07:00
oleibman 8d8bc23b6d Merge pull request #4572 from oleibman/issue484
Header/Footer Images Expand "Location"
2025-08-07 05:29:16 +00:00
oleibman a4ee68bf1e Merge branch 'master' into issue484 2025-08-06 22:26:24 -07:00
oleibman 3c67aba359 Update CHANGELOG.md 2025-08-06 22:24:24 -07:00
oleibman 216db02ad5 Merge pull request #4565 from oleibman/issue4588
Create Uninitialized Cell If Used in Calculation
2025-08-07 05:00:06 +00:00
oleibman fa2c32996a Merge branch 'master' into issue4588 2025-08-06 21:57:24 -07:00
oleibman 4b9a3cdef8 Update CHANGELOG.md 2025-08-06 21:54:11 -07:00
oleibman 7689037b60 Additional Floating Point Precision Changes
Fix #1324, which went stale many years ago, and is now re-opened. It can be considered a follow-on to PR #4479 which was installed in May. The user complains of a *very* small loss of precision. This can be corrected by using `StringHelper::convertToString` in lieu of a simple cast from float to string in two places. `Style\NumberFormat\Formatter` is quite straightforward. `Writer\Csv` is a bit more complicated. If you put a float with more than 15 digits precision in a Csv, on opening it Excel will give a pop-up, saying something inaccurate like "We've corrected this for you - is that okay?" Better to avoid that by making sure to avoid too much precision when writing to Csv.
2025-08-06 17:53:04 -07:00
oleibman ea97afb754 Merge pull request #4562 from oleibman/issue4557date
Shared/Date::isDateTime Handle Cells Which Calculate as Arrays
2025-08-06 07:16:44 +00:00
oleibman c4cd1b3410 Merge branch 'master' into issue4557date 2025-08-05 23:52:31 -07:00
oleibman 9a805fd7b2 Update CHANGELOG.md 2025-08-05 23:51:04 -07:00
oleibman a907f19462 Merge pull request #4573 from PHPOffice/dependabot/composer/setasign/fpdi-2.6.4
Bump setasign/fpdi from 2.6.3 to 2.6.4
2025-08-05 23:44:36 +00:00
dependabot[bot] 02b12603b7 Bump setasign/fpdi from 2.6.3 to 2.6.4
Bumps [setasign/fpdi](https://github.com/Setasign/FPDI) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/Setasign/FPDI/releases)
- [Commits](https://github.com/Setasign/FPDI/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: setasign/fpdi
  dependency-version: 2.6.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-05 21:26:16 +00:00
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 9a193f2841 Merge pull request #4571 from oleibman/calcformulatests
Clean Up Some Engineering Tests
2025-08-03 23:34:51 +00:00
oleibman 79fca7601c Clean Up Some Engineering Tests
This came to light while cleaning up ComplexAssert. Many tests are calling `_calculateFormulaValue` rather than `calculateFormula`, and, as a result, have to be trimmed before asserting. This PR changes those calls, and does a bit more to simplify the tests. There are a lot of other non-Engineering tests which call `_calculateFormulaValue`, but none of those need to manipulate the result after the test.

This PR changes only tests, no source code.
2025-08-03 13:48:45 -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 150b3849a8 Create Uninitialized Cell If Used in Calculation
Fix #4558. Fix #4530. 4558 deals with a problem with COUNTA. Excel does not count empty cells, but it does count literal nulls (usually empty parameters) in the argument list. PhpSpreadsheet has till now not created empty cells during calculation, and so winds up treating them as literals. It is changed to create the cell when appropriate.

4530 has a similar problem. When INDIRECT winds up evaluating an uninitialized cell, it treats it as a null literal, leading to incorrect results. It is now changed to create the missing cell.

A number of functions, almost all of them Financial, have a related problem. They test for a null literal when initializing some of their parameters, but they should be testing for null literal or cell containing null. They are changed to do the right thing.

SUMIF and related functions are slightly affected by this change, and are changed so that they are no longer affected.

New tests have been added. Only one existing test had to change. MergeBehaviorTest for `[12, '=5+1', '=A1/A2']`, where cell A2 was uninitialized formerly returned one row, but now returns a second all-null row because A2, by virtue of being used in a calculation, now winds up defined. I do not consider this a significant difference.
2025-07-31 23:58:05 -07:00
oleibman 079dc87604 More Tweaks 2025-07-30 23:27:08 -07:00
oleibman 624dafa3b8 Merge branch 'master' into deprecations 2025-07-30 21:33:35 -07:00
oleibman c16eaeb6e4 Coverage Tweaks
See if we can satisfy Scrutinizer.
2025-07-30 20:55:02 -07:00
oleibman f1ce95eaa4 Shared/Date::isDateTime Handle Cells Which Calculate as Arrays
In issue #4557, the user complains, with some justification, about the way Excel handles certain calculations. We are not able to help with that problem. However, the user also notes a problem in Shared/Date when `isDateTime` has to evaluate a cell whose calculated value is an array. This is solved by flattening the calculated result to a single value.

It became obvious while working on this change that the code to set `instanceArrayReturnType` was kind of awkward. Simpler methods `returnArrayAsArray` and `returnArrayAsValue` are added to `Spreadsheet`. Even these started out a bit awkward because `Spreadsheet::calculationEngine` was defined as nullable, which really isn't true. It is allocated by the constructor, and never freed except in the destructor. It is no longer nullable.
2025-07-30 17:19:26 -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