Commit Graph

5014 Commits

Author SHA1 Message Date
oleibman 889bdeb465 Update CHANGELOG.md 2024-11-13 15:37:55 -08:00
oleibman a8553cad0f Merge branch 'master' into sheetindex 2024-11-13 14:10:41 -08:00
oleibman e92a4ff1d8 Merge pull request #4205 from sergiy-petrov/sergiy-petrov-patch-4
Test against php 8.4
2024-11-12 14:31:39 +00:00
oleibman 15f6dd74cc Merge branch 'master' into sergiy-petrov-patch-4 2024-11-12 06:28:36 -08:00
oleibman dbc2e2433a Merge pull request #4224 from m7913d/fix_s_tag
Add support for <s> tag when converting HTML to RichText
2024-11-10 23:44:11 +00:00
oleibman e78e7ea9a7 Update CHANGELOG.md 2024-11-10 15:41:01 -08:00
oleibman 0cf7292ecf Merge branch 'master' into fix_s_tag 2024-11-10 15:22:46 -08:00
oleibman 3e52499a40 Merge pull request #4221 from m7913d/fix_versions_ForbiddenThisUseContexts
Fix incorrect versions error (ForbiddenThisUseContexts)
2024-11-10 19:13:44 +00:00
oleibman 98b5500480 Merge pull request #4228 from oleibman/contrib
Update "Contributing" Notes and One Github Action
2024-11-10 19:00:38 +00:00
oleibman 1983af6597 Merge branch 'master' into contrib 2024-11-10 10:58:26 -08:00
oleibman 830baa14b2 Update "Contributing" Notes and One Github Action
Replace one deprecated action, and update "How to release".
2024-11-10 10:55:42 -08:00
oleibman a8ff421c98 Merge pull request #4222 from m7913d/pr_improve_contributing_guidelines
Improve contributing guidelines for composer newbies
2024-11-10 18:34:11 +00:00
m7913d 1ec119a2bc Fix composer check on Windows 2024-11-10 13:23:49 +01:00
m7913d de6bcaae66 Assert font of parsed HTML is not null 2024-11-10 13:04:32 +01:00
oleibman 4ec8fa7af7 Merge pull request #4226 from oleibman/chg350start
Start Changelog for 3.5.0
2024-11-10 11:57:04 +00:00
oleibman d1c1316517 Start Changelog for 3.5.0 2024-11-10 03:54:01 -08:00
oleibman eec07c20b5 Omitted a Line from Changelog 3.4.0 2024-11-10 02:10:41 -08:00
oleibman 31e2522110 Merge pull request #4225 from oleibman/change340
Update Changelog for New Release
2024-11-10 09:58:47 +00:00
oleibman f10c3cb69b Update Changelog for New Release 2024-11-10 01:54:48 -08:00
oleibman c04a9389d3 Merge commit from fork
* Security Patch

* Throw Exception for EBCDIC Encoding

* Mixed UTF-8 and UTF-16

Further mischief. I don't know if the examples truly are valid Xml, but PhpSpreadsheet is letting them sneak through.
2024-11-10 01:07:59 -08:00
m7913d 9d7fe28b04 Update CHANGELOG.md 2024-11-09 18:37:26 +01:00
m7913d c1c12720a4 Add support for <s> tag when converting HTML to RichText
Fixes #4223
2024-11-09 18:36:46 +01:00
m7913d 26e59cdfc2 Fix incorrect versions error (ForbiddenThisUseContexts)
PHPCompatibility erroneously flags the use of $this in enumerations.
Commit 5e248cf moved disabling of this error check to .github/workflows/main.yml
Hence, `composer versions` and `composer check` should also exclude this check.
2024-11-09 16:50:14 +01:00
m7913d 72d5fdcdbe Improve contributing guidelines for composer newbies
To allow running `composer versions`, it is necessary to call `composer install` to install the (development) dependencies of this project. This may not be obvious to contributors unfamiliar with `composer'.
2024-11-09 15:36:57 +01:00
oleibman b99d061726 Clean Up Some Tests 2024-11-07 21:47:56 -08:00
oleibman 7c973ab085 Merge pull request #4216 from PHPOffice/dependabot/composer/symfony/process-6.4.14
Bump symfony/process from 6.4.8 to 6.4.14
2024-11-06 21:44:23 +00:00
dependabot[bot] d780b1b1de Bump symfony/process from 6.4.8 to 6.4.14
Bumps [symfony/process](https://github.com/symfony/process) from 6.4.8 to 6.4.14.
- [Release notes](https://github.com/symfony/process/releases)
- [Changelog](https://github.com/symfony/process/blob/7.1/CHANGELOG.md)
- [Commits](https://github.com/symfony/process/compare/v6.4.8...v6.4.14)

---
updated-dependencies:
- dependency-name: symfony/process
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-06 18:24:02 +00:00
oleibman 2670e0a972 Merge pull request #4214 from oleibman/issue4213
Changes to ROUNDDOWN/ROUNDUP/TRUNC
2024-11-06 14:02:03 +00:00
oleibman bd1b1e5237 Merge branch 'master' into issue4213 2024-11-06 05:48:06 -08:00
oleibman d01efac277 Update CHANGELOG.md 2024-11-06 05:46:58 -08:00
oleibman 915bfc55cd Merge pull request #4212 from oleibman/issue4200
Write ignoredErrors Tag Before Drawings
2024-11-05 05:53:38 +00:00
oleibman aba2385561 Merge branch 'master' into issue4200 2024-11-04 21:51:26 -08:00
oleibman ee7cc8f0a0 Update CHANGELOG.md 2024-11-04 21:50:27 -08:00
oleibman a18abb3e0f Changes to ROUNDDOWN/ROUNDUP/TRUNC
Fix #4213. Early versions of Php 8.4 caused problems for some Excel functions, among them ROUNDDOWN and ROUNDUP. New code was added which seemed to work for 8.4 and all prior releases (back to 7.4). However, as the issue shows, there is a problem with the new logic that had not been a problem for prior releases (PhpSpreadsheet 1.29.1 with Php 8.3 or earlier).

As it happens, some time after 8.4 broke the existing functionality, new features were added to it which enabled much cleaner logic. The code will now take this cleaner path when available, and revert to the older logic when not. This appears to work for all relevant Php releases, at least till the next non-match between PhpSpreadsheet and Excel is reported.

And, having made the change to ROUNDDOWN, it occurred to me that ROUNDDOWN always returns the same result as TRUNC (they differ only in number of required arguments). So I changed TRUNC to call ROUNDDOWN, and that didn't break anything. So I will keep that change. This probably means I should change Calculation so that ROUNDDOWN is called automatically, and deprecate TRUNC. That can happen at a later time.
2024-11-04 19:23:53 -08:00
oleibman ebdde3dcf9 Write ignoredErrors Tag Before Drawings
Fix #4200. Fix #4145. Although the Xml is valid, Excel insists that worksheet.xml specifies `ignoredErrors` (introduced with 1.29.0) before `legacyDrawing` or `drawing`.
2024-11-01 09:20:45 -07:00
oleibman ce32cbab7b Merge pull request #4211 from PHPOffice/dependabot/composer/maennchen/zipstream-php-3.1.1
Bump maennchen/zipstream-php from 3.1.0 to 3.1.1
2024-11-01 13:54:47 +00:00
oleibman fbc5ed47d7 Merge pull request #4209 from PHPOffice/dependabot/composer/tecnickcom/tcpdf-6.7.7
Bump tecnickcom/tcpdf from 6.7.5 to 6.7.7
2024-11-01 13:54:33 +00:00
dependabot[bot] cba025a4a7 Bump maennchen/zipstream-php from 3.1.0 to 3.1.1
Bumps [maennchen/zipstream-php](https://github.com/maennchen/ZipStream-PHP) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/maennchen/ZipStream-PHP/releases)
- [Commits](https://github.com/maennchen/ZipStream-PHP/compare/3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: maennchen/zipstream-php
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 11:30:13 +00:00
dependabot[bot] d6749aea47 Bump tecnickcom/tcpdf from 6.7.5 to 6.7.7
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.7.5 to 6.7.7.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/compare/6.7.5...6.7.7)

---
updated-dependencies:
- dependency-name: tecnickcom/tcpdf
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 11:30:04 +00:00
oleibman 3d4b4b0957 Scrutinizer
See if typehint helps.
2024-10-30 17:57:26 -07:00
oleibman 2f445a1ade Change Hash Code for Worksheet
Fix #4192. Although that issue can be dealt with by changing user code, it would be better to fix it within PhpSpreadsheet. A cloned worksheet may have a pointer to a spreadsheet to which it is not attached. Code can assume it does belong to the spreadsheet, and throw an exception when the spreadsheet cannot find the worksheet in question. It may also not throw an exception when it should.

In my comments to the issue, I was concerned that adding in the needed protection would add overhead to an extremely common situation (setting a cell's value) in order to avoid a pretty rare problem. However, there are problems with both the accuracy and efficiency of the existing code, and I think any performance losses caused by the additional checks will be offset by the performance gains and accuracy of the new code.

Spreadsheet `getIndex` attempts to find the index of a worksheet within its spreadsheet collection. It does so by comparing the hash codes of each sheet in its collection with the hash code of the sheet it is looking for. Its major problem problem is performance-related, namely that it recomputes the hash code of the target sheet with each iteration.

A more severe problem is the accuracy of the hash code. It generates this by hashing together the sheet title, the string range of its auto-filter, and a character representation of whether sheet protection is enabled. Title should definitely be part of the calculation (it must be unique for all sheets attached to a spreadsheet), but it is not clear why this subset of the other properties of Worksheet is used. It tries to save some cycles by using a `dirty` property to indicate whether re-hashing is necessary. It sets that property whenever the title changes, or when `setProtection` is called. So, it doesn't set it when auto-filter changes, and you can easily bypass `setProtection` when changing any of the `Protection` properties. Not to mention the many other properties of worksheet that can be changed. Additionally, if you clone a worksheet, the clone and the original will have the same hash code, which can lead to problems:
```php
$clone = clone $original;
$spreadsheet->getSheet($spreadsheet->getIndex($clone))
    ->setCellValue('A1', 100);
```
That code will change the value of A1 in the original, not the clone.

The `hash` property in Worksheet will now be calculated immediately when the object is constructed or cloned or unserialized. It will not be recalculated, and there is no longer a need for the `dirty` property, which is removed. Hash will be generated by spl_object_id, which was designed for this purpose. (So was spl_object_hash, but many online references suggest that \_id performs much better than \_hash.) Our problem example above will now throw an Exception, as it should, rather than changing the wrong cell. `setValueExplicit`, the problem in the original issue, will now test that the worksheet is attached to the spreadsheet before doing any style manipulation. In order that this not be a breaking change, `getHashCode` will continue to return string, but it is deprecated in favor of `getHashInt`, and Worksheet will no longer implement IComparable to facilitate the deprecation.

I had a vague hope that this change might help with issue #641. It doesn't.
2024-10-30 17:25:49 -07:00
oleibman 363705cd05 Merge pull request #4203 from oleibman/issue4197
Allow ANCHORARRAY as Valid DataValidation List
2024-10-30 22:16:53 +00:00
oleibman 67dad068ef Update CHANGELOG.md 2024-10-30 15:11:57 -07:00
oleibman 5bfe7d36e2 Merge branch 'master' into issue4197 2024-10-30 14:46:30 -07:00
oleibman c28abd8142 Merge pull request #4202 from oleibman/issue4201
Add setLabelFont to Chart/Layout
2024-10-30 20:56:41 +00:00
oleibman 5f91c03904 Scrutinizer (legit) 2024-10-27 15:02:05 -07:00
oleibman d06230eaf4 Allow ANCHORARRAY as Valid DataValidation List
Fix #4197. Overlooked in the introduction of Dynamic Arrays, Data Validation can specify a list to be a result of the spill operator, which is implemented via the ANCHORARRAY function.

It appears that function `DataValidator::isValid` will not work if the list is specified in this manner, nor if it is specified as a defined name. Fixing those situations will be difficult (defined names probably easier than ANCHORARRAY), and there is no reason to delay this change waiting for those to be fixed. I will open a new issue when this PR is merged.
2024-10-27 14:16:42 -07:00
oleibman c42004844d Add setLabelFont to Chart/Layout
Fix #4201. Although that issue can be dealt with without any change to PhpSpreadsheet, it is pretty clear that `setLabelFont` has been accidentally omitted from Chart/Layout. Add it now. Xlsx Chart Writer is changed to use font name from labelFont if latin, eastAsian, or complexScript is uninitialized. Finally, chart label font size is multiplied by 100 in Xlsx Writer, as it is in Excel, but the corresponding division by 100 has been omitted from Xlsx Chart Reader - add that now.
2024-10-27 13:50:21 -07:00
oleibman 8799a041a0 Merge pull request #4189 from oleibman/csvphp9
Method to Test Whether Csv Will Be Affected by Php9
2024-10-15 04:32:15 +00:00
oleibman 75ccdb09ad Update CHANGELOG.md 2024-10-14 21:27:22 -07:00