Commit Graph

5522 Commits

Author SHA1 Message Date
oleibman cadeb88d4b Xlsx Reader Do Not Process Printer Settings for Dataonly
Fix #4477. Xlsx Spreadsheet could be loaded and saved normally, but, when the load specified Dataonly, the output file was corrupt. Reader is changed to not process Printer Settings when Dataonly is in effect.
2025-05-21 19:15:20 -07:00
oleibman 85a9a39b91 Merge pull request #4468 from oleibman/issue1425
Copy Styles after insertNewColumnBefore
2025-05-18 19:46:24 +00:00
oleibman a6e2e71791 Merge branch 'master' into issue1425 2025-05-18 12:43:54 -07:00
oleibman 45fe36e6d8 Update CHANGELOG.md 2025-05-18 12:40:11 -07:00
oleibman e16571ea1a Merge pull request #4469 from oleibman/stan1007
Still More Prep for Phpstan 10
2025-05-18 19:25:39 +00:00
oleibman 770eddf69d Still More Prep for Phpstan 10
Remaining:
- Calculation/LookupRef
- Calculation/Statistical
- Shared/OLE
- Odds and ends
2025-05-15 08:19:39 -07:00
oleibman 0e570a50cd Merge pull request #4467 from oleibman/stan1006
More prep for Phpstan 10
2025-05-15 01:31:13 +00:00
oleibman e6aacf72b0 Merge pull request #4466 from oleibman/issue407b
Ods Handling of Ceiling and Floor
2025-05-15 01:22:53 +00:00
oleibman 48ed1bca3e Update CHANGELOG.md 2025-05-14 18:20:14 -07:00
oleibman 2d1f4e87d6 Merge pull request #4465 from oleibman/issue282
Removing Columns/Rows Containing Merged Cells
2025-05-15 01:17:36 +00:00
oleibman 37f7c0d366 Update CHANGELOG.md 2025-05-14 18:15:05 -07:00
oleibman 6a7c834f22 Copy Styles after insertNewColumnBefore
Fix #1425 which went stale 5 years ago, and which I've reopened. Style was not being set properly for last row. Also, Style was not being set at all for insertNewColumnBefore('B').
2025-05-14 16:56:01 -07:00
oleibman 6786cd5f25 Something More Sophisticated
When the merged cells start outside the deleted range but end inside it, the merge is truncated to that portion which is outside the range.
2025-05-13 21:54:27 -07:00
oleibman 7db6e1f491 More prep for Phpstan 10 2025-05-12 22:59:34 -07:00
oleibman 01e97405f8 Tweaks for Gnumeric and Xls 2025-05-12 11:05:39 -07:00
oleibman 3e93d4d85c Merge pull request #4463 from oleibman/stan1005
More Phpstan 10 Prep
2025-05-11 22:32:16 +00:00
oleibman 3a6009d49e Recalibrate for Significance=0
Very peculiar implementation in Excel. PhpSpreadsheet will match it:
- FLOOR(8,0) is #DIV/0. This already matched, and is the only result I understand.
- CEILING(8,0) is 0 (already matched)
- FLOOR.MATH(8,0) is 0 (changed to match)
- FLOOR.PRECISE(8,0) is 0 (changed to match)
- CEILING.MATH(8,0) is 0 (already matched)
- CEILING.PRECISE(8,0) is 0 (already matched)
2025-05-11 00:27:34 -07:00
oleibman 39511e03b5 Ods Handling of Ceiling and Floor
Fix #407, which went stale over 7 years ago, and is now reopened. Ods handling of CEILING and FLOOR functions is, apparently by design, subject to interoperability problems with Excel. See [FLOOR](https://wiki.documentfoundation.org/Documentation/Calc_Functions/FLOOR) and [CEILING](https://wiki.documentfoundation.org/Documentation/Calc_Functions/CEILING). Ods implements its own `CEILING.XCL` and `FLOOR.XCL` functions for interoperability purposes. PhpSpreadsheet will implement those, and `CEILING.ODS` and `FLOOR.ODS` psuedo-functions as well; none of these four will be listed in the official Functions documentation.

In all of the descriptions below, FLOOR follows CEILING exactly.

Ods writes its functions to Xml as follows:
- CEILING.XCL becomes COM.MICROSOFT.CEILING
- CEILING.MATH becomes COM.MICROSOFT.CEILING.MATH
- CEILING.PRECISE becomes COM.MICROSOFT.CEILING.PRECISE
- CEILING remains unchanged

PhpSpreadsheet Ods Writer will do the same, plus:
- CEILING.ODS becomes CEILING

PhpSpreadsheet Ods Reader will act as follows:
- CEILING (not preceded by 'COM.MICROSOFT.') becomes CEILING.ODS
- COM.MICROSOFT.CEILING.MATH becomes CEILING.MATH
- COM.MICROSOFT.CEILING.PRECISE becomes CEILING.PRECISE
- COM.MICROSOFT.CEILING becomes CEILING

PhpSpreadsheet Xlsx Writer will act as follows:
- CEILING.ODS becomes CEILING.MATH
- CEILING.XCL becomes CEILING

PhpSpreadsheet Xls Writer will recognize only the CEILING and FLOOR functions.

Note that the only difference between Ods CEILING and CEILING.MATH is that CEILING will return an error if the number and significance operands have opposite signs. PhpSpreadsheet implements this as `#VALUE!`.
2025-05-10 21:40:28 -07:00
oleibman bc54cfd199 Update MergeCellsDeletedTest.php 2025-05-09 21:10:55 -07:00
oleibman 0245f6ba22 Removing Columns/Rows Containing Merged Cells
Fix #282, which went stale over 7 years ago, and is now reopened. This is certainly related to issue #4379. If merged cells are in the midst of deleted rows/columns, the merge may continue to exist after the deletion, leading to various problems including spreadsheet corruption. The problem is not with either Reader or Writer.

This PR will automatically unmerge all merged cells whose first cell is in the delete range before performing the deletion. This will address the corruption problem. Something more sophisticated may be required, so I won't merge this PR for a while to give me a chance to think about it some more.
2025-05-09 20:58:06 -07:00
oleibman e53a04b016 Start Calculation Changes 2025-05-08 22:44:13 -07:00
oleibman 130c6e99d2 More Phpstan 10 Prep
All of Calculation and Shared/OLE are left to tackle.
2025-05-07 23:57:33 -07:00
oleibman 89343c81f5 Merge pull request #4462 from oleibman/issue2735
Minor Documentation Update
2025-05-08 00:10:21 +00:00
oleibman 773585ad19 Minor Documentation Update
Fix #2735.
2025-05-07 17:05:30 -07:00
oleibman 3922d9ad00 Merge pull request #4453 from oleibman/issue56
Xls Writer Treat Hyperlink Starting with # as Internal
2025-05-07 03:02:50 +00:00
oleibman 8be18d1a49 Update CHANGELOG.md 2025-05-06 20:00:22 -07:00
oleibman 576ce504f9 Merge branch 'master' into issue56 2025-05-06 19:51:00 -07:00
oleibman f9b1b76322 Merge pull request #4459 from oleibman/stan1004
More Phpstan Level 10 Prep - Readers and Styles
2025-05-07 02:43:16 +00:00
oleibman 3977e2ace7 Add Style 2025-05-05 09:19:24 -07:00
oleibman 5c94de34a9 More Phpstan Level 10 Prep - Readers
Also upgrade Phpstan.
2025-05-03 21:18:55 -07:00
oleibman c2a9649782 Merge pull request #4457 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.12.2
Bump squizlabs/php_codesniffer from 3.12.0 to 3.12.2
2025-05-01 15:04:24 +00:00
oleibman b504baf196 Merge pull request #4458 from PHPOffice/dependabot/composer/tecnickcom/tcpdf-6.9.3
Bump tecnickcom/tcpdf from 6.9.0 to 6.9.3
2025-05-01 15:04:05 +00:00
dependabot[bot] aa88cd8f23 Bump tecnickcom/tcpdf from 6.9.0 to 6.9.3
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.9.0 to 6.9.3.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/compare/6.9.0...6.9.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-01 11:26:54 +00:00
dependabot[bot] c82aac1d5f Bump squizlabs/php_codesniffer from 3.12.0 to 3.12.2
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.12.0 to 3.12.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.12.0...3.12.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-01 11:26:48 +00:00
oleibman c88627681c Merge pull request #4452 from oleibman/stan1003write
More Phpstan Level 10 Prep - Writers
2025-04-30 07:47:46 +00:00
oleibman 92d3c1bc7d Xls Writer Treat Hyperlink Starting with # as Internal
Fix #56, which had gone stale but is now reopened. The problem which it reported with Xlsx Writer was fixed long ago. However, Xls Writer has 2 problems regarding hyperlinks. First, some logic which should have been `if ... elseif ... else ...` was coded as `if ... if ... unconditional ...`, resulting in multiple writes and a corrupt worksheet (which Excel does fix correctly). Second, it treated a hyperlink url starting with `#` (pointer to a cell in the same spreadsheet) as external, when it should be treated as internal.

Also changed `Hyperlink::isInternal` to recognize a starting `#`, and to use `str_starts_with('sheet://')` rather than `str_contains`.
2025-04-30 00:23:35 -07:00
oleibman 662033720c Include Some Readers 2025-04-28 15:24:46 -07:00
oleibman ebb04a8811 More Phpstan Level 10 Prep - Writers 2025-04-27 07:15:26 -07:00
oleibman fb2cfed070 Merge pull request #4450 from oleibman/issue1275
Print Area and Row Break
2025-04-23 06:09:17 +00:00
oleibman f474cd6773 Update CHANGELOG.md 2025-04-22 23:06:04 -07:00
oleibman ac9a0fed7e Merge branch 'master' into issue1275 2025-04-22 22:50:27 -07:00
oleibman d8ad4b03d7 Merge pull request #4449 from oleibman/issue4448
XML Reader Recognize Indents
2025-04-23 05:45:32 +00:00
oleibman 11f0b571a4 Merge pull request #4442 from oleibman/issue4438
Micro-optimization for excelToDateTimeObject
2025-04-23 05:16:56 +00:00
oleibman 3c7afe6879 Merge pull request #4447 from oleibman/stan1002
Phpstan 10 and IterableValue Prep Part 2
2025-04-23 05:08:50 +00:00
oleibman 0d236eb274 Print Area and Row Break
Fix #1275, which had been closed as stale, and is now reopened pending the implementation of this PR. If there is a page break inside a defined print area, Excel may not render the print correctly unless the xml `brk` tag contains a `max` attribute. Libre Office renders it correctly. This seems like a bug in Excel (https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/b32ae11b-dee7-4dcb-9b46-a0feb32ce94f states that Office ignores min and max). PR #3345 (issue #3143) already addressed this problem by allowing the user to explicitly specify a `max` property in the PageBreak object. This PR eliminates the need for the user to make use of that kludge, by adding `max` to the xml whenever a page break is specified on a sheet with a defined print area. Xlsx Reader will now ignore the `max` attribute for row breaks, since it is no longer needed; it already ignores it for column breaks. The user may still set the `max` property if desired, just in case the new treatment is not adequate (I have not found a case where that is true). Two existing unit tests are very marginally changed because of this PR.
2025-04-21 23:52:08 -07:00
oleibman de9fdc3855 XML Reader Recognize Indents
Fix #4448
2025-04-20 16:10:50 -07:00
oleibman 1bd8bd90f6 Update Some More Tests 2025-04-20 00:53:29 -07:00
oleibman 455c259e41 Minor Tweak 2025-04-19 10:07:27 -07:00
oleibman 19555d6d96 Phpstan 10 and IterableValue Prep Part 2
There will probably be dozens, if not hundreds, of these before I'm ready to commit.
2025-04-18 23:27:29 -07:00
oleibman e8316367b9 Merge pull request #4439 from oleibman/stan1001
Phpstan Tweaks
2025-04-17 04:43:10 +00:00