Commit Graph

5077 Commits

Author SHA1 Message Date
oleibman 9fc8e501b8 Extremely Limited Support for GROUPBY Function
This is a partial response to issue #4282. The actual logic to implement GROUPBY is probably very complicated. And, even worse, Excel has thrown a whole new way of (internally) specifying one of the arguments into the mix. That argument is a function name, expressed not as a mapped integer (as SUBTOTAL does), nor even as a string, but as the unquoted function name prefixed by `_xleta.`. And, unlike its `_xlfn.` and `_xlws.` predecessors, it is difficult to figure out when the new prefix needs to be added, and when it needs to be ignored. I am not even going to attempt that task with this ticket.

So, what does this change do? Like earlier attempts to introduce limited functionality (such as with form controls), it is there so that using GROUPBY can be passed through - you can load a spreadsheet that contains it, and save it to a new spreadsheet, and the function and its results are preserved. Some cautionary notes. Dynamic arrays must be enabled (the function makes no sense without doing that). Changing any of the inputs used in the function may result in internal inconsistencies between PhpSpreadsheet and Excel; this is especially so if the dimensions of the returned array change as a result of changes to the input data. The programmer can avoid some of these problems by changing the formulatAttributes of the cell where the function is used; this may be difficult to do in practice. Oh, yes, using the GROUPBY cell as an argument in another formula will probably lead to problems. Finally, I confess that part of this solution looks awfully kludgey to me.

With its limitations and those cautions, is it worth proceeding with this change? My gut feel is that it is more useful to proceed than not. However, I will give others the opportunity to weigh in. I will wait at least a couple of weeks into the new year before proceeding with this.
2024-12-18 17:28:36 -08:00
oleibman eccbcce498 Merge pull request #4276 from oleibman/streamcontext
Additional Context Options for https, Restore Disabled Tests
2024-12-14 00:01:32 +00:00
oleibman 92292e58eb Simplify Accept Header 2024-12-13 14:58:27 -08:00
oleibman cc86557b77 Remove Connection: keep-alive
Unacceptable performance.
2024-12-13 09:18:02 -08:00
oleibman 62476437ab Add Context for http Requests 2024-12-13 08:22:26 -08:00
oleibman 3078ea9f87 Additional Context Options for https, Restore Disabled Tests
Additional Context Options needed, at least sometimes, to read https images.
2024-12-12 00:10:02 -08:00
oleibman 1e78397ec1 Merge pull request #4273 from oleibman/disable2tests
Disable 2 Tests
2024-12-11 14:25:17 +00:00
oleibman beb0ac856a Disable 2 Tests
For the second time in recent months, some tests are failing/erring because https file_get_contents is not working on github (cannot reproduce locally on Windows or Linux). Filed an issue with Php when this first happened, and their suggested code change worked till now. If they come up with another successful code change, I will implement it and restore these tests.
2024-12-11 06:21:20 -08:00
oleibman b35de99c16 Merge pull request #4268 from oleibman/changelog370
Prepare Changelog For Next Release
2024-12-08 16:45:12 +00:00
oleibman c7794495e4 Prepare Changelog For Next Release 2024-12-08 08:41:03 -08:00
oleibman bce5db9987 Merge pull request #4267 from oleibman/dompdf84b
Upgrade Dompdf to 8.4-Compatible Version
3.6.0
2024-12-08 15:04:12 +00:00
oleibman e8e8b3cd26 Update CHANGELOG.md 2024-12-07 22:32:19 -08:00
oleibman 1c12d32bb5 Merge branch 'master' into dompdf84b 2024-12-07 21:14:48 -08:00
oleibman 94df5941c5 Upgrade Dompdf to 8.4-Compatible Version 2024-12-07 21:09:04 -08:00
oleibman e23c9870b0 Merge pull request #4257 from oleibman/htmlbool
Html Reader/Writer Better Handling of Booleans
2024-12-06 04:06:41 +00:00
oleibman 40d0b8ef97 Merge branch 'master' into htmlbool 2024-12-05 20:01:59 -08:00
oleibman 1eeb705975 Update Changelog 2024-12-05 19:58:35 -08:00
oleibman 9dc82e603d Merge pull request #4250 from oleibman/issue4248
Fill Patterns/Colors When Xml Attributes are Missing
2024-12-06 03:48:51 +00:00
oleibman e78ab77609 Merge pull request #4262 from jlherren/patch-1
Remove unnecessary files from composer package
2024-12-06 03:47:25 +00:00
Jean-Luc c6bb21d8ab Remove unnecessary files from composer package 2024-12-05 10:52:21 +01:00
oleibman 5291be260d Merge pull request #4256 from oleibman/csvmacle
Get Us Closer to Csv Not Autodetect By Default
2024-12-04 17:55:13 +00:00
oleibman 6a4c2c68c4 Include InlineCss 2024-12-01 17:27:00 -08:00
oleibman 3d6f71f6ad Extend to Formulas, and Numbers Stored As String
All still require opt-in.
2024-12-01 09:20:38 -08:00
oleibman ad0289977b Merge pull request #4258 from oleibman/upgrdfixer
Upgrade php-cs-fixer
2024-12-01 14:13:06 +00:00
oleibman 4357263e9d Upgrade php-cs-fixer
Dependabot push required a very minor code change.
2024-12-01 06:04:52 -08:00
oleibman a68e44eee6 Html Reader/Writer Better Handling of Booleans
When Html Writer outputs a cell with a boolean value, the result will either be 1 or null-string; neither of these is optimal for anyone looking at the resulting html. Html Reader already has the ability to recognize data types using the html `data-type` attribute, but Html Writer doesn't use it. This PR adds the ability to generate that attribute for booleans. It will generate a string value appropriate for the locale when it encounters a boolean. Html Reader, when it encounters `data-type="b"`, will interpret the result as true if the value is 1 or a string value recognized as true in any locale; it will interpret the result as false if the value is 0, null-string, null, or a string value recognized as false in any locale; if none of the above, it will leave the value as an unchanged string. So, Reader will wind up with the correct result even if its locale is different than what Writer used.

Because this is a breaking change, it is opt-in. You need to call `Writer::setBetterBoolean(true)` in order for it take effect. The current default value for that property is false. When it is time to introduce breaking changes (see PR #4240), the default will be changed to true.
2024-12-01 05:31:44 -08:00
oleibman c66ac5619c Get Us Closer to Csv Not Autodetect By Default
This has been requested a few times, most recently issue #4092. Because it's a breaking change, I haven't proceeded with it. But, because I have a breaking change PR #4240 already in the queue, this gives a plan for getting where we want to go (under the extremely likely assumption that most users don't deal with Csv files with Mac line endings). This PR doesn't change the current behavior, but it gets us to a state where a single-line change will be sufficient when the time comes for a new major release.
2024-12-01 05:11:54 -08:00
oleibman 41d6f5af03 Merge pull request #4253 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.11.1
Bump squizlabs/php_codesniffer from 3.10.3 to 3.11.1
2024-12-01 12:37:22 +00:00
oleibman b0f5e641af Merge pull request #4254 from PHPOffice/dependabot/composer/mitoteam/jpgraph-10.4.3
Bump mitoteam/jpgraph from 10.4.1 to 10.4.3
2024-12-01 12:36:54 +00:00
oleibman dd2e96a3f6 Merge pull request #4255 from PHPOffice/dependabot/composer/mpdf/mpdf-8.2.5
Bump mpdf/mpdf from 8.2.4 to 8.2.5
2024-12-01 12:36:30 +00:00
dependabot[bot] c9d62867c7 Bump mpdf/mpdf from 8.2.4 to 8.2.5
Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.2.4 to 8.2.5.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](https://github.com/mpdf/mpdf/compare/v8.2.4...v8.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 11:53:48 +00:00
dependabot[bot] 00b2ae5e4c Bump mitoteam/jpgraph from 10.4.1 to 10.4.3
Bumps [mitoteam/jpgraph](https://github.com/mitoteam/jpgraph) from 10.4.1 to 10.4.3.
- [Release notes](https://github.com/mitoteam/jpgraph/releases)
- [Commits](https://github.com/mitoteam/jpgraph/compare/10.4.1...10.4.3)

---
updated-dependencies:
- dependency-name: mitoteam/jpgraph
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 11:53:44 +00:00
dependabot[bot] bfd2fe72d8 Bump squizlabs/php_codesniffer from 3.10.3 to 3.11.1
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.10.3 to 3.11.1.
- [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
- [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.3...3.11.1)

---
updated-dependencies:
- dependency-name: squizlabs/php_codesniffer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-01 11:53:39 +00:00
oleibman eeef6dc083 Scrutinizer 2024-11-29 21:36:53 -08:00
oleibman dd69858111 Fill Patterns/Colors When Xml Attributes are Missing
Fix #4248. PhpSpreadsheet has used what appear to be default attributes and tags when they are missing from Fill patterns and colors. However, Excel handles their absence a little differently from what the "default" would require. PhpSpreadsheet is changed to omit the attributes and tags in question when missing. This change is mostly targeted towards Xlsx read and write, but minor changes for Xls and Html write are also included.

This seems like it could be a breaking change, but I don't think it is. One test (DefaultFillTest introduced by PR #2050) must change, but the change is internal - loading and then saving the spreadsheet used in that change will appear the same after this change as it did before. Other differences are very likely to be bug fixes rather than breaks.
2024-11-29 20:08:11 -08:00
oleibman d9d5ae8736 Merge pull request #4247 from oleibman/issue4246
Swapped Row and Column Indexes in ReferenceHelper
2024-11-30 03:31:34 +00:00
oleibman 1972cb101e Merge branch 'master' into issue4246 2024-11-29 19:29:05 -08:00
oleibman 54fd177ea5 Update CHANGELOG.md 2024-11-29 19:28:16 -08:00
oleibman a0699607bf Merge pull request #4244 from oleibman/issue4241
Fix Minor Break Handling Drawings
2024-11-30 03:16:36 +00:00
oleibman 8efb0fc4f3 Merge branch 'master' into issue4241 2024-11-29 19:13:21 -08:00
oleibman 0e9719b68d Update CHANGELOG.md 2024-11-29 19:12:27 -08:00
oleibman d4ffa3e894 Merge pull request #4243 from sirbaconjr/fix-dollar-sign-issue-4242
Escape any dollar signs when formatting cell data
2024-11-30 02:35:31 +00:00
oleibman 2454696dc6 Swapped Row and Column Indexes in ReferenceHelper
Fix #4246. This can cause an Exception in unusual circumstances.
2024-11-27 18:06:23 -08:00
oleibman 690cb21166 Handle Escaped Quote in Format 2024-11-27 17:04:18 -08:00
oleibman 4b568b47b4 Handle Case Where Both Format and Value Contain Quotation Mark 2024-11-26 15:20:32 -08:00
Everton Barbosa 3eee74950f Ignore cell formatting when the format is a single @
This commit fix two issues that happened when the a cell was formatted as text
* When the cell contains a number prefixed with dollar sign, this number is getting replaced with 0. The replacement happens due to the preg_replace function.
* When the cell contains quotes, the quote would be removed.
2024-11-26 17:20:47 -03:00
oleibman a70b33570e Merge pull request #4239 from oleibman/phpunit11d
Use Php Attributes Rather than Annotations for PhpUnit
2024-11-26 15:03:51 +00:00
oleibman 5c3ae52446 Fix Minor Break Handling Drawings
Fix #4241. Some security batches caused a minor break in Drawings, forcing `setWorksheet` to come after `setPath`. Although the problem is easily fixed in user code, this was not an intended change. Some slight recoding restores the earlier functionality where the order of calls was not important, without sacrificing the security gains. This change will be back-ported to the other active branches to which the security patch had been applied.
2024-11-25 19:54:38 -08:00
oleibman d647fe7ee7 Use Php Attributes Rather than Annotations for PhpUnit
With PhpUnit 10 came the ability to use Php attributes rather than doc-block annotations for things like "data provider". PhpUnit 11 deprecates the use of annotations, and PhpUnit 12 will not not permit their use. Since PhpUnit 11 requires Php8.2+, we cannot adopt it as long as we support Php8.1, which will continue to be the case for some time. However, there is no penalty for early adoption.

Php-cs-fixer can use:
```
'php_unit_attributes' => ['keep_annotations' => false],
```
This allows us to run `composer fix` to automate all the needed changes. No manual changes were needed for any of the test members.

With this change, PhpUnit 9 can no longer be used with the test suite. File composer.json is updated to reflect that reality, and phpunit9.xml.dist, which has been supplied in case anyone needed to use PhpUnit 9, is no longer required, and is thus deleted. For now, PhpUnit 11 is not being added as a possibility.

No source code is changed in this PR.
2024-11-23 20:56:26 -08:00
oleibman fd562affef Merge pull request #4238 from Blacknife/fix-conditional-formatting-a-cell-documentation
fix `Conditional formatting a cell` documentation
2024-11-23 15:29:26 +00:00