Commit Graph

5605 Commits

Author SHA1 Message Date
oleibman 3eff3b475a Merge branch 'master' into issue4521 2025-07-04 12:54:53 -07:00
oleibman 3cefc50690 Update CHANGELOG.md 2025-07-04 12:53:28 -07:00
oleibman b271cbffde Merge pull request #4474 from oleibman/issue4451
Bug in resizeMatricesExtend
2025-07-04 17:44:33 +00:00
oleibman 7efb118cbd Phpstan Catch-up 2025-07-04 10:41:20 -07:00
oleibman 019afe055a Merge branch 'master' into issue4451 2025-07-04 09:49:41 -07:00
oleibman a70e4ecbf0 Merge pull request #4499 from ddevsr/cleanup-twice
refactor: cleanup code twice calling
2025-07-04 16:29:13 +00:00
oleibman ca284fac35 Update Spreadsheet.php 2025-07-04 09:15:02 -07:00
oleibman f52d70984f Update Spreadsheet.php 2025-07-04 07:41:56 -07:00
oleibman 852182039f Update Spreadsheet.php 2025-07-04 07:39:08 -07:00
oleibman d41b304a84 Merge pull request #4525 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.76.0
Bump friendsofphp/php-cs-fixer from 3.75.0 to 3.76.0
2025-07-01 18:53:28 +00:00
oleibman 4b780101f6 Merge pull request #4526 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.13.2
Bump squizlabs/php_codesniffer from 3.13.0 to 3.13.2
2025-07-01 18:53:00 +00:00
dependabot[bot] 1c17c1da4a Bump squizlabs/php_codesniffer from 3.13.0 to 3.13.2
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.13.0 to 3.13.2.
- [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.13.0...3.13.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 12:35:37 +00:00
dependabot[bot] 1baa138f0f Bump friendsofphp/php-cs-fixer from 3.75.0 to 3.76.0
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.75.0 to 3.76.0.
- [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.75.0...v3.76.0)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  dependency-version: 3.76.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 12:35:34 +00:00
oleibman bfd7dc8cee Recognize "New" Mimetype for Empty File
Fix #4521. Reader/Csv (which can be invoked by IOFactory::read), checks the mimetype of files if they don't have a csv/tsv extension. It allows empty files, whose mimetype was set to `inode/x-empty` for Php5.3.11 through Php7.3.33 (except for 5.4.0). For 5.3.1-5.3.10, 5.4.0, and 7.4.0+, the mimetype is `application/x-empty`. Reader/Csv recognizes the `inode` version but not the `application` version, which this PR adds.

The person who issued the report also noted that, for a file consisting of cr-lf, Php8.1.* and Php8.2.* report the mimetype as `application/octet-stream`, whereas all other releases report it as `text/plain`. The behavior of Php8.1/2 seems to be a bug, and I cannot possibly guess all the conditions that might lead to that bug. So I will not fix that problem. Anyone who is adversely affected by it can either add a `csv` extension to the filename, or upgrade to Php8.3+, or pre-process the file (e.g. to make it truly empty) before passing it to PhpSpreadsheet. A test case to document the problem is added for documentary purposes; the test will be skipped for Php8.1/2, but run for all other releases.
2025-06-30 21:06:17 -07:00
oleibman 61a6b50f02 Merge pull request #4520 from shaedrich/patch-1
fix(docs): Fix nested lists after paragraphs
2025-06-24 15:46:36 +00:00
Sebastian Hädrich 52f846a637 Indent with four spaces instead of two
to adhere to the standard's best practice

and (verifiedly) make the nesting carry over to being displayed in the rendered output
2025-06-24 10:08:56 +02:00
Sebastian Hädrich a266911203 Indent with four spaces instead of two
to adhere to the standard's best practice

and (hopefully) make the nesting carry over to being displayed in the rendered output
2025-06-24 09:58:48 +02:00
Sebastian Hädrich 55294cf34c Add blank line before list after paragaph
So that it is displayed correctly as list in ReadTheDocs
2025-06-24 09:32:40 +02:00
oleibman 747ccd1b44 Merge pull request #4514 from oleibman/parsehuge4
Allow Xlsx Reader to Specify ParseHuge Master
4.4.0
2025-06-23 01:23:23 +00:00
oleibman be45c88293 Update CHANGELOG.md 2025-06-22 13:50:07 -07:00
oleibman 9588592048 Merge branch 'master' into parsehuge4 2025-06-22 13:38:08 -07:00
oleibman e4efeff296 Allow Xlsx Reader to Specify ParseHuge Master
Fix #4260. A number of Security Advisories related to libxml_options were opened. In the end, we disabled the ability to specify any libxml_options. However, some users were adversely affected because they needed LIBXML_PARSEHUGE for some of their files. Having finally obtained access to a file demonstrating this problem, we can restore this ability.
- The operation is potentially dangerous, a vector for memory leaks and out-of-memory errors. It is not recommended unless absolutely needed.
- It will not be permitted as a global (static) property with the ability to adversely affect other users on the same server.
- It will instead be implemented as an instance property of Xlsx Reader (default to false), with a setter. I do not see a use case for a getter.
- People will need to set this property individually for each file which they think needs it.
- This change will be backported to all supported releases.
- The sheer size and processing time for the file involved makes it impractical to add a formal test case. It has, nevertheless, been tested satisfactorily.
2025-06-18 17:58:43 -07:00
oleibman d25979fae9 Merge pull request #4508 from oleibman/writestyles
Xlsx Style Writer Minor Refactoring
2025-06-18 04:59:57 +00:00
oleibman cb0f9c0414 Update CHANGELOG.md 2025-06-17 21:57:14 -07:00
oleibman 84acafc0bf Merge branch 'master' into writestyles 2025-06-17 21:35:23 -07:00
oleibman 0dbe154e29 Merge pull request #4503 from oleibman/issue4502
AutoColor for LibreOffice Dark Mode
2025-06-18 04:22:45 +00:00
oleibman 30369ca036 Merge pull request #4501 from oleibman/issue2760
Allow Xlsx Reader/Writer to Process Font Charset
2025-06-18 04:21:17 +00:00
oleibman 84b7ab93fa Merge pull request #4500 from oleibman/office2023theme
Support Current Office Theme
2025-06-18 04:20:29 +00:00
oleibman d38117ffe6 Eliminate Dead Statement 2025-06-12 16:48:59 -07:00
oleibman 04cfc57457 Xlsx Style Writer Minor Refactoring
In our unit tests, we can test the Worksheet Xml which PhpSpreadsheet will generate without having to actually write the spreadsheet to and read it from disk. This refactoring allows us to do the same for Styles, as demonstrated in the new StylesWriterTest.
2025-06-12 15:51:48 -07:00
oleibman f0ca95f8f9 Tests and Documentation 2025-06-10 07:14:38 -07:00
oleibman b91a9ef3f4 AutoColor for LibreOffice Dark Mode
See discussion #4502. I am not sure of what needs to be involved here. This is especially so because Excel also offers AutoColor, but its dark mode looks significantly different than LibreOffice's.

So here's what I've come up with thus far.
- Add boolean autoColor with setter and getter to Font.
- If autoColor is true, ODS writer and XLSX Writer will record it in the xml, and will not write a font color. It is possible that both can co-exist; I'm just not sure how they are supposed to interact if that is the case.
- It makes most sense to me if the spreadsheet's default font specifies autoColor, but PhpSpreadsheet will not insist on that.
- Xlsx Reader will process autoColor. Like most other styles, Ods Reader is not yet set up to handle it.
- LibreOffice Calc should follow the autoColor declarations when it reads either an Xlsx or Ods spreadsheet created by PhpSpreadsheet.
2025-06-05 22:19:12 -07:00
oleibman cbf194c905 WIP Allow Xlsx Reader/Writer to Process Font Charset
Fix #2760. Maybe. I have no real way of confirming. I am not sure why it might be needed, but a comment in the issue suggests that it helps. I have asked the submitter and another participant in the discussion to let me know if it helps before moving forward.
2025-06-03 21:41:21 -07:00
oleibman eb486262fa Support Current Office Theme
A while back, Microsoft introduced changes to the default theme colors and fonts. We are adding support for this new theme so that users can use it easily on new spreadsheets if they wish. (It is already supported when using the Xlsx Reader to load an appropriate file.) The old theme was described by constants COLOR_SCHEME_2013_PLUS_NAME and COLOR_SCHEME_2013_PLUS; these are deprecated in favor of COLOR_SCHEME_2013_2022_NAME and COLOR_SCHEME_2013_2022. The new theme is described by constants COLOR_SCHEME_2023_PLUS_NAME and COLOR_SCHEME_2023_PLUS. PhpSpreadsheet's default theme remains COLOR_SCHEME_2007_2010, to avoid breaking changes.

A third optional parameter `$spreadsheet` is added to setThemeColorName. If specified, the default font names for the theme will be applied to the default style for the spreadsheet. You can thus use the new theme with its relatively new default `Aptos Narrow` font. IMHO, that isn't necessarily a good choice, but it is available. MS stores the new font in a different location than other system fonts, and that can lead to portability problems, e.g. if your spreadsheet uses Aptos and you export it to Html, browsers will not be able to find the font and a substitute font will be used.
2025-06-03 21:36:05 -07:00
Denny Septian Panggabean ca12ffd6ef refactor: using function count instead 2025-06-02 11:34:42 +07:00
Denny Septian Panggabean ea6ed77fdd refactor: cleanup code twice calling 2025-06-02 11:26:30 +07:00
oleibman 44c3bd564b Merge pull request #4487 from oleibman/issue1154
Various Writers RichText TextElement Should Inherit Cell Style
2025-06-01 16:29:26 +00:00
oleibman 59387176e3 Update CHANGELOG.md 2025-06-01 09:26:35 -07:00
oleibman 277c8d5615 Merge branch 'master' into issue1154 2025-06-01 09:17:22 -07:00
oleibman 5c643a890b Merge pull request #4491 from oleibman/filterparm
Minor Changes to FILTER Function
2025-06-01 16:04:59 +00:00
oleibman df3a069722 Merge pull request #4493 from oleibman/torow
TOCOL and TOROW
2025-06-01 16:04:23 +00:00
oleibman bd792ec985 Merge pull request #4492 from oleibman/vstack
VSTACK and HSTACK
2025-06-01 16:04:06 +00:00
oleibman 1825c7428b Merge pull request #4498 from oleibman/stan2117
Upgrade Phpstan
2025-06-01 15:58:55 +00:00
oleibman f84724d13e Upgrade Phpstan
Too many problems with Dependabot update.
2025-06-01 08:41:13 -07:00
oleibman 02671e5c4f Merge pull request #4496 from PHPOffice/dependabot/composer/tecnickcom/tcpdf-6.10.0
Bump tecnickcom/tcpdf from 6.9.3 to 6.10.0
2025-06-01 13:37:00 +00:00
oleibman 173dd22c07 Merge pull request #4494 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.13.0
Bump squizlabs/php_codesniffer from 3.12.2 to 3.13.0
2025-06-01 13:36:43 +00:00
dependabot[bot] d7d4a04d27 Bump tecnickcom/tcpdf from 6.9.3 to 6.10.0
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.9.3 to 6.10.0.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/compare/6.9.3...6.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 11:56:56 +00:00
dependabot[bot] 64bd02a5c5 Bump squizlabs/php_codesniffer from 3.12.2 to 3.13.0
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.12.2 to 3.13.0.
- [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.12.2...3.13.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 11:56:49 +00:00
oleibman f3c3aba618 TOCOL and TOROW
TOCOL and TOROW were introduced to Excel in 2024, and will now be supported by PhpSpreadsheet. The documentation says that, under certain circumstances, "blanks" will be ignored. This seems demonstrably wrong. In the right circumstance, Excel will ignore nulls, not blanks. Further, when it decides to not ignore the nulls, it changes them to 0, which also seems insufficiently documented. PhpSpreadsheet will behave as Excel does.

I discovered some minor problems and some missing test conditions for the TRANSPOSE function while testing these. Those are now fixed.
2025-05-28 23:15:06 -07:00
oleibman e83eae9be7 VSTACK and HSTACK
Fix #4485. VSTACK and HSTACK were introduced to Excel in 2024, and will now be supported by PhpSpreadsheet. Special thanks to @SlowFox71, who posted some code to implement VSTACK in the linked issue. I didn't have to change much between that version and the one in this ticket.

Excel has at least one idiosyncrasy with these functions. If you try to stack 2 tables with, say, `=VSTACK(TABLE1, TABLE2)`, Excel will silently change it to `=VSTACK(TABLE1[], TABLE2[])` and all will be well. This would be difficult for PhpSpreadsheet to do. The problem is that, when Excel reads the formula without the square brackets, it calculates it as a `#NAME?` error. This is baffling, and all the more so because you can "correct" it by editing the formula *without changing anything*, hit enter, and the formula will magically work again. So, if you plan to stack tables using PhpSpreadsheet, you're probably best off using the square brackets.
2025-05-27 19:53:30 -07:00