Commit Graph

490 Commits

Author SHA1 Message Date
oleibman 5c94de34a9 More Phpstan Level 10 Prep - Readers
Also upgrade Phpstan.
2025-05-03 21:18:55 -07:00
oleibman 662033720c Include Some Readers 2025-04-28 15:24:46 -07:00
oleibman ac9a0fed7e Merge branch 'master' into issue1275 2025-04-22 22:50:27 -07: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 f1a61c4c6b Phpstan Tweaks
Phpstan level 10 reports an enormous number of errors. So does the excluded missingType.iterableValue. I do not plan to introduce either any time soon. But I will submit piecemeal changes from time to time. Changes will be mostly limited to phpdoc type declarations.
2025-04-06 18:14:59 -07:00
oleibman 5ce46da559 Merge branch 'master' into issue4435 2025-04-05 17:29:22 -07:00
oleibman 5b799dbbed Ods Reader No Datatype for Null Value
Issue #4435 was initially described incorrectly. While investigating the original description, I came upon this problem. Ods Reader is trying to set some cells to null without supplying a valid DataType to setValueExplicit, causing that method to throw an exception. Reader is changed to no longer call that method when value is null and DataType is null-string.
2025-04-03 19:55:33 -07:00
oleibman 2213139d96 Merge branch 'master' into issue4416 2025-03-27 00:01:29 -07:00
oleibman 6b61da0017 Column Widths Not Preserved When Using Read Filter
Fix #4416. A peculiar problem indeed. PhpSpreadsheet has been considering a column to be filtered if any cell in the column is filtered and does not preserve the column width if that is the case. It should consider the column not filtered if any cell in the column is not filtered, and consider it filtered only if there are no cells to which that applies. At least, that's how I think it should work, and this change doesn't break any existing tests, and solves this issue.
2025-03-24 20:18:51 -07:00
oleibman c54d55da07 Merge pull request #4417 from oleibman/issue4415
Ignore Fractional Part of Drawing Shadow Alpha
2025-03-23 07:04:00 +00:00
oleibman 71b243539a Ignore Fractional Part of Drawing Shadow Alpha
Fix #4415. We store the rarely-used property Drawing/Shadow/Alpha as an integer representing the percentage. Excel also stores it as an integer, but multiplies it by 1,000, so we divide by 1,000 when we read this value. This can, and in the case of the issue at hand does, leave a fractional portion. Php has deprecated passing a float with a fractional portion to an int argument, so the reporter saw a deprecation message. This is easily fixed.
2025-03-20 20:11:11 -07:00
oleibman 50bf8a0fad Wrong Case in File Name 2025-03-13 12:10:21 -07:00
oleibman 6083e393c1 Permit Read to Class Which Extends Spreadsheet
See discussion #4202. Users can extend Spreadsheet, but the readers cannot return the extended class. This is solved pretty easily by adding a protected method in BaseReader which returns a new Spreadsheet. Users can then extend the Reader which they want, overriding that method to return the extended class.
2025-03-13 12:01:33 -07:00
oleibman 190af743f8 Add FormulaRange to IgnoredErrors Possibilities
When I implemented IgnoredErrors (PR #3508), I dealt only with those that I understood well enough to come up with an example. I finally found an example for FormulaRange in the wild, so this PR adds it. Still unsupported are `calculatedColumn`, `emptyCellReferece`, `listDataValidation`, and `unlockedFormula`.
2025-03-03 20:16:12 -08:00
oleibman 753e5d5e5a Merge branch 'master' into pr1449 2025-02-25 20:40:10 -08:00
oleibman 8013034796 Fix Some Phpstan V2 Issues as Well
Performance of Phpstan V2 on my machine is dreadful. I will not be upgrading till I figure out how to fix it.
2025-02-24 15:43:35 -08:00
oleibman 53a984b747 Merge branch 'master' into feature/justifyLastLine 2025-02-23 12:39:58 -08:00
oleibman f366749285 Polishing Up 2025-02-23 12:38:44 -08:00
oleibman 01539876b1 Merge branch 'master' into issue4375 2025-02-23 12:28:17 -08:00
oleibman caf12eb80f Merge branch 'master' into pr1449 2025-02-21 13:24:21 -08:00
oleibman d813d7efcb Merge pull request #4360 from oleibman/issue4536
Xlsx Reader Defined Name on Sheet with Apostrophe in Title
2025-02-21 01:32:02 +00:00
oleibman 6f58d8c86f Fix Inconsequential Typo 2025-02-19 19:53:52 -08:00
oleibman 2b7e6f50a2 Ignore ignoredErrors when Not Applicable
Fix #4375. Do not set ignoredErrors when using readDataOnly, not when the cell to which it applies doesn't exist.
2025-02-19 19:15:01 -08:00
oleibman 94117dd7e6 Merge branch 'master' into visibility 2025-02-18 21:15:21 -08:00
oleibman 8e50403930 More Tweaks 2025-02-18 10:43:27 -08:00
oleibman 2250a0e53b Yet Another Test 2025-02-18 01:57:53 -08:00
oleibman ae6c92b006 More Tests 2025-02-17 22:45:05 -08:00
oleibman 8930e634a1 Add Some Tests 2025-02-17 17:58:17 -08:00
oleibman 66ae679489 Merge branch 'master' into issue4536 2025-02-16 17:27:37 -08:00
oleibman 4e7e876b83 Tighten Up getStyle(definedName) Processing 2025-02-16 17:24:17 -08:00
oleibman 7f0bcb8aca Eliminate Dead Code 2025-02-15 20:05:19 -08:00
oleibman ec773bbed9 Phpstan Bleeding Edge Part 2 of Many
This will be the biggest of these changes. It takes care of all of the remaining problems in tests. I will handle the problems in src more slowly.
2025-02-15 19:18:39 -08:00
oleibman 9b07be9a0f Add sheetState to ListWorksheetInfo Data
Fix #4345. Add a new item to the output array. Although the output is changed, this does not seem like a breaking change to me.
2025-02-14 23:40:50 -08:00
oleibman 7b606243a0 More Apostrophe Fixes
Fix #4362. A similar problem to 4360, Style not handling sheet name with embedded apostrophe properly. And, with two examples in hand, I was able to determine a pattern to find and fix other possible exposures.
2025-02-14 19:40:34 -08:00
oleibman ac148c8d10 Xlsx Reader Defined Name on Sheet with Apostrophe in Title
Fix #4356. Xlsx Reader needs to handle apostrophe for sheet title in defined name by converting doubled apostrophes to single.
2025-02-12 08:05:11 -08:00
oleibman 37b6ca4979 Allow php-cs-fixer to Handle Implicit Backslashes
Its defaults are to unescape within single quotes, and escape within double quotes and here-docs. Right now, it leaves everything as-is, which means our code is inconsistent and need not be. Further, although dealing with complex regular expressions will never be easy, I find it much easier to figure out what's going on when superfluous back-slashes are removed.

These changes were all made automatically using the "fix" script, so should be reliable. They, of course, pass all unit tests.
2025-02-08 00:11:01 -08:00
oleibman fc9f9858f1 Merge branch 'master' into pr1449 2025-02-07 18:04:58 -08:00
oleibman 4d6db5d1a7 Merge branch 'master' into arraysexplicit 2025-02-06 22:44:41 -08:00
oleibman 95213bf50a Breaking Change - 3 Defaults
Fix #4092. Change default value for Csv Reader autodetect line endings. Prior behavior can be enabled via `setTestAutodetect(true)`.

Change default value for Html Writer "better boolean" logic. Prior behavior can be explicitly enabled via `setBetterBoolean(false)`.

Change default for Xlsx Writer forceFullCalc option. Prior behavior can be explicitly enabled via `setForceFullCalc(null)`.
2025-02-04 06:58:31 -08:00
oleibman eafbed6ca8 Merge pull request #4314 from oleibman/issue4312
CF Priority Property and Overlapping Ranges
2025-02-04 04:35:13 +00:00
oleibman cfc8b8c26f Merge branch 'master' into issue797 2025-02-03 17:50:15 -08:00
oleibman e637713de9 Make Explicit Array Return Type When Tests Require It
When the Dynamic Array PR #3962 was introduced, it left the default as Return Array as Value. At some point, the default should be changed to Return Array as Array. This would, of course, be a breaking change, one which will not be part of Release 4. However, it will possibly be part of Release 5.

Rather than relying on the default setting, this PR explicitly sets Return Array as Value when tests require that setting. This will make it easier to identify potential breaks when the default is changed. The entire test suite will now succeed with either setting as default.

In making these changes, a few minor problems were discovered with how Array as Array is handled. These are fixed with this PR.
2025-01-25 19:40:12 -08:00
oleibman cde2926a9e Merge commit from fork
* Security Patch

Control characters should not be allowed in protocol.

* Tighten Up Drawing

* Fix Test
2025-01-23 21:25:36 -08:00
oleibman 89b30eb41a Merge branch 'master' into issue797 2025-01-21 20:01:25 -08:00
oleibman 8d7500b1e2 Merge branch 'master' into issue4312 2025-01-21 19:58:05 -08:00
oleibman 312388a1b5 Merge branch 'master' into pr1449 2025-01-21 19:29:09 -08:00
oleibman f8bf5087ff Merge branch 'master' into issue4311b 2025-01-15 23:22:32 -08:00
oleibman 41ca105c88 Handle Overlapping Ranges
Fix #4318. Also make getConditionalStyles more useful, by adding a non-default parameter so that all rules pertaining to a single-cell coordinate can be returned, and in priority order. By default, just the first matching rule will be returned.
2025-01-14 20:57:55 -08:00
oleibman 7895ce27fc Merge branch 'master' into pr1449 2025-01-11 22:52:38 -08:00