Commit Graph

5626 Commits

Author SHA1 Message Date
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 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 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
oleibman ace1755238 Excel Inappropriate Number Format Substitution
My system short date format is set to `yyyy-mm-dd`.
I used Excel to create a spreadsheet, and included some dates, specifying `yyyy-mm-dd` formatting. When I looked at the resulting spreadsheet, I was surprised to see that Excel had stored the style not as `yyyy-mm-dd`, but rather as builtin style 14 (system short date format). Apparently the fact that the Excel styling matched my system choice was sufficient for it to override my choice! This is an astonishingly user-hostile implementation. Even though there are formats which, by design, "respond to changes in regional date and time settings", and even though the format I selected was not among those, Excel decided it was appropriate to vary the display even when I said I wanted an unvarying format.

This PR adds a new method `replaceBuiltinNumberFormat` to undo the damage that Excel does in such a situation. It also adds an `Excel Anomalies` document to the formal documentation, just to make situations like this readily available to the community.

BTW, Excel's sabotage can be avoided by using a number format style like `[Black]yyyy-mm-dd`.
2025-07-10 17:54:52 -07:00
oleibman 9708d72ee1 Ods Reader Process Nested table-row
Fix #4528. Fix #2507. Ods Reader expects `table:table-row` to descend directly from `table:table`. But it turns out that it can be nested under `table:table-header-rows`, `table:table-rows`, or `table:table-row-group`. Similar considerations apply to `table:table-column`. Ods Reader is changed to process the nesting tags, and therefore the nested tags underneath them. This is a major change, but it doesn't seem to have broken any existing tests or samples.

No attempt is made to add any of the nesting tags in Ods Writer.

It should be noted that 4528 has an additional problem, which has been reported as issue #4530. It is not fixed by this PR.
2025-07-08 12:52:55 -07:00
oleibman fbd4070144 Merge pull request #4524 from oleibman/issue4521
Recognize "New" Mimetype for Empty File
2025-07-04 19:57:30 +00:00
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