Commit Graph

6750 Commits

Author SHA1 Message Date
oleibman 6efb8f0dc2 Merge pull request #5004 from guy-black-box/fix-comparison-type-ordering
Compare values of different types in Excel's type order
2026-10-16 19:52:55 +00:00
oleibman e59617c899 Another Test 2026-10-12 20:32:30 -07:00
oleibman 85606d69df Fix Numeric String Comparisons 2026-10-12 18:51:07 -07:00
oleibman e95a97b6f6 Merge branch 'master' into fix-comparison-type-ordering 2026-10-12 14:33:00 -07:00
oleibman 62b659d519 Merge pull request #5052 from oleibman/odswintweak
Recently Added Test Needs Tweak for Windows
2026-10-12 20:15:17 +00:00
oleibman dff5eb33d1 Recently Added Test Needs Tweak for Windows 2026-10-12 12:54:31 -07:00
oleibman fce33b945c Merge pull request #5006 from guy-black-box/fix-countif-boolean-criterion
Match logical values with a "TRUE" or "FALSE" criterion in COUNTIF and friends
2026-10-12 19:00:16 +00:00
oleibman 68645cbf34 Add Some Tests 2026-10-12 11:55:46 -07:00
oleibman 09a318952c Merge branch 'master' into fix-countif-boolean-criterion 2026-10-12 10:14:11 -07:00
oleibman 242961d07f Merge pull request #5035 from oleibman/issue5032
Don't Iterate Cell Ranges on Non-existent Sheets
2026-10-09 19:10:14 +00:00
oleibman c04c2e56b9 Merge branch 'master' into issue5032 2026-10-09 12:05:36 -07:00
oleibman 0520f890ee Update CHANGELOG.md 2026-10-09 12:04:49 -07:00
oleibman 91442ba5d4 Merge pull request #5033 from n3crosis/fix/ole-pps-conformance
Fix CFB directory entry serialization and sibling trees
2026-10-09 18:32:01 +00:00
oleibman 35b6826efa Merge branch 'master' into fix/ole-pps-conformance 2026-10-09 11:27:32 -07:00
oleibman 845d708486 Merge pull request #5005 from guy-black-box/fix-min-max-literal-text
MIN and MAX: count logical values and numeric text typed as arguments, error on other text
2026-10-09 17:51:11 +00:00
oleibman b3511404e0 Merge pull request #5043 from oleibman/realpath
File::realpath should not issue file_exists
2026-10-08 06:59:14 +00:00
oleibman 1725ae89a3 A Bit More Efficient 2026-10-07 23:54:46 -07:00
oleibman 2527575636 Bounded Ranges on Missing Sheet
@dkulyk noticed a case which wasn't handled properly. I believe the fix works for everything ... except `COLUMNS` and `ROWS`, where Excel seems to ignore the sheet, and I just can't figure out how to do it.
2026-10-04 20:24:47 -07:00
oleibman 5b5b12647e File::realpath should not issue file_exists
Fix #5042. `Shared\File::realpath` is used to normalize file name references in a zip file. It can be used for non-zip file names as well, but zip members is its primary use, and `file_exists` does not work with zip file members. Such usage leads to the issue to which this PR is linked, and there have been other instances in past. In particular, issue #3553 was addressed by editing it out a leading slash in such references; it is not needed, and neither Excel nor PhpSpreadsheet generate one, but it's legal. The fix for 3553 addressed only loading a spreadsheet; but `listWorksheetInfo` and `listWorksheetNames` are subject to the same problem, which is this issue.

The normalization that `realpath` does is already built into `File::realpath` using a well-documented algorithm. So neither `filepath` nor `file_exists` is needed there, and they are removed. There are other problems with the current implementation. It looks only for Unix, not Windows, file separators. And a very peculiar problem arises when the zip entry name matches a file path in the current working directory. These problems all go away with this PR.

It is very likely that some manipulation of the zip entry names can be removed entirely from `Reader\Xlsx`. I may look into this in future, but I'm not going looking for trouble now. The fix for 3553 remains in place, even though no changes are made to match it in `listWorksheet...`, so, chances are the 3553 change could be dropped. As I say, maybe some day.
2026-10-04 16:16:38 -07:00
oleibman ad62b91558 Merge pull request #5023 from dkulyk/ods-table
Ods Reader and Writer : Tables as named database ranges
2026-10-04 00:05:01 +00:00
oleibman 2dc0be23fe Merge pull request #5020 from siarheipashkevich/fix-xls-palette-color-index
Fix Xls Writer reusing an occupied palette index
2026-10-03 23:57:52 +00:00
oleibman bb904a2e23 Merge branch 'master' into fix-xls-palette-color-index 2026-10-03 16:53:48 -07:00
oleibman b67630b614 Merge pull request #5018 from dkulyk/ods-style-hyperlink
Ods Reader : Read the hyperlink LibreOffice keeps in a cell style
2026-10-03 23:47:05 +00:00
oleibman ebfea1db9b Merge pull request #5016 from dkulyk/ods-sheet-rtl
Ods Reader and Writer : Keep the direction of a right-to-left sheet
2026-10-03 23:39:00 +00:00
oleibman 9278e8c146 Don't Iterate Cell Ranges on Non-existent Sheets
Fix #5032. When evaluating formulas, stop iterating a cell range when the sheet on which the range is located does not exist.

While testing, discovered some commented-out tests in `ParseFormulaTest`, having nothing to do with this change, that could now be commented back in.
2026-10-03 07:57:58 -07:00
oleibman 2c6277cacf Merge branch 'master' into ods-table 2026-10-03 07:35:46 -07:00
oleibman e402b34494 Merge pull request #5001 from u01jmg3/feature-box-whisker-chart
Support Box and Whisker charts
2026-10-02 19:02:35 +00:00
^^ dfc86c9577 Fix unused CFB directory entries and strengthen PPS regressions
Unused directory slots must contain NOSTREAM in their sibling and child
pointers under MS-CFB 2.6.3. Zero-filled padding incorrectly points to the
root entry, so serialize the required pointer values while keeping every
other unused byte zero.

Add byte-level padding regressions and behavioral coverage for UTF-16
boundaries, numeric code-unit ordering, invalid nested names before output,
independent storage name scopes, caller object preservation, and distinct
payload round-trips. These assertions catch failures that complete line
coverage alone does not establish.

Document nested storage support, apply project formatting, and add a
changelog entry for the PPS conformance changes.

Validation: 265 tests / 2690 assertions; targeted PHPStan, PHPCS,
PHP-CS-Fixer, and whitespace checks passed.
2026-10-02 22:58:48 +08:00
^^ afab09c0c5 Fix CFB directory entry serialization 2026-10-02 21:59:31 +08:00
oleibman ab358c7da9 Merge branch 'master' into feature-box-whisker-chart 2026-10-01 22:04:01 -07:00
oleibman 37b7907994 Improve Coverage A Bit 2026-10-01 21:25:05 -07:00
oleibman 361cec684f Merge pull request #4978 from saifulferoz/fix/issue-4976-pivot-table-older-excel
Fix PivotTableBuilder on older Excel versions (Issue #4976)
2026-10-02 02:31:59 +00:00
oleibman b11e661634 Merge pull request #5000 from oleibman/securitymd
Security Policy Updates
2026-10-02 02:30:07 +00:00
oleibman 5260b7e2df Merge pull request #5030 from oleibman/deprectcpdf
Tcpdf V6 is Officially Deprecated
2026-10-02 02:29:23 +00:00
oleibman 43b3151526 Tcpdf V6 is Officially Deprecated
Tcpdf is an optional package, but we do make a number of tests of it in our unit test suite. We will continue to support it for now. We are considering dropping support for it at the next PhpSpreadsheet major release.

As an early assessment, there is much too much work involved supporting `tc-lib-pdf` directly; we are not likely ever to move in that direction.

Tcpdf V7 is a bridge version. It is not deprecated (yet), and does not require much in the way of coding changes, but it requires users to supply their own font files; this is relatively easily done in Unix, but it is much harder in Windows. In addition, our test suite can't test satisfactorily with both V6 and V7. We may at some point consider supporting V7, but it is likely that the Windows difficulties will have to be dealt with before we can do so.

This PR includes some very minor coding changes which will not harm V6 and will help in migrating to V7 if we choose that route.
2026-10-01 13:21:07 -07:00
oleibman 145e8e6d7c Merge pull request #5029 from oleibman/updstan20261001b
Monthly Updates
2026-10-01 16:11:53 +00:00
oleibman 680fe05f50 Monthly Updates
Minor changes due to Phpstan (statements where I had previously flagged that I thought it was wrong).

TCPDF V6 officially deprecated. We will continue to support for now.
2026-10-01 08:48:51 -07:00
oleibman 93df8d3219 Omit dev packages from SBOM
I don't think they should be needed. Omitting lowers file size from 225K to 16K.
2026-10-01 06:56:48 -07:00
Dmytro Kulyk 348ff71e96 Changelog: link #5022 and #5023 2026-09-30 12:34:20 +03:00
Dmytro Kulyk faa841582e Ods Reader and Writer : Tables as named database ranges
The Ods Writer skipped every Worksheet\Table. LibreOffice keeps a table
as a named table:database-range, and from its header row it tags the
header cells of an exported PDF as /TH /Scope /Column (LO master).

The writer now writes one per table, with contains-header and the filter
buttons, after the named expressions as the schema orders them; a table
with no name gets one no other table has. The reader reads a named
database range back as a table and, as LibreOffice does, drops one whose
name is taken or cannot be a table. LibreOffice's anonymous ranges stay
a sheet filter, which now lands on the sheet its address names instead
of the last sheet; a range of a sheet that was not loaded is skipped.
2026-09-30 12:26:43 +03:00
oleibman 850b5091a1 Merge pull request #5021 from oleibman/emptyhyperlink
Xlsx Writer Should Ignore Empty Hyperlinks
2026-09-29 07:03:55 +00:00
oleibman 70381bbfd4 Update CHANGELOG.md 2026-09-28 23:59:49 -07:00
oleibman e9007b9abd Xlsx Writer Should Ignore Empty Hyperlinks
This is a follow-up to PR #5008 issue #5007. Ods and Csv Writers were inappropriately writing empty hyperlinks. Collateral to this problem, Xlsx Writer was throwing an exception when attempting to rewrite a spreadsheet with these empty hyperlinks. The PR fixed the problem with the Ods and Csv Writers, so the problem would no longer show up in Xlsx Writer when loading and saving their output. However, Xlsx Writer should not have thrown in the first place - it would be sufficient for it to ignore the empty entries rather than throwing because of them. This PR fixes that problem.
2026-09-28 11:55:12 -07:00
Sergey Pashkevich d438cd1920 Fix Xls Writer reusing an occupied palette index
Xls files store colors as indexes into a palette that the Writer builds
while it walks the workbook styles. addColor() picked the next custom
index from the most recently inserted entry (end()) instead of the
highest index in use.

A color matching an existing palette entry is cached under its exact RGB
string together with the matched index. When the same color is added
later under a differently-cased key (e.g. `ffffff` after `FFFFFF`), that
old, lower index is appended to the cache and "last used" moves
backwards. The next custom color then reuses and overwrites the palette
slot of an earlier custom color, so e.g. gray text is rendered in the
blue used by a fill.

Base the next index on max() so a custom color never lands on an
occupied palette slot.
2026-09-28 17:12:30 +03:00
Dmytro Kulyk d6ae22caaa Changelog: link #5017 and #5018 2026-09-28 10:17:27 +03:00
Dmytro Kulyk c6f1560b2e Ods Reader : Read the hyperlink LibreOffice keeps in a cell style
LibreOffice writes the link of a cell that is not plain text (a number,
a boolean, a date, a formula) as style:hyperlink and loext:hyperlink in
the style:table-cell-properties of the cell's automatic style, which is
how it saves a Xlsx file with such links as Ods. The reader looked only
for text:a, so those links were lost.

The reader now maps each cell style to its link and uses it when the
cell has no text:a. A cell with no style of its own takes the default
cell style of its column, as LibreOffice does for A1 in the test file.
2026-09-28 10:15:28 +03:00
oleibman 6d083fdbdd Merge branch 'master' into ods-sheet-rtl 2026-09-27 18:39:52 -07:00
oleibman 458bffb33e Merge pull request #5014 from dkulyk/ods-number-cell-link
Ods Reader and Writer : Keep the hyperlink of a non-text cell
2026-09-28 01:29:14 +00:00
Dmytro Kulyk 141a082132 Changelog: link #5013 and #5014 2026-09-28 03:26:48 +03:00
Dmytro Kulyk 1e87f6f8d3 Ods Reader and Writer : Keep the hyperlink of a non-text cell
The Ods Writer wrote text:a only for string cells, so a link on a
number, boolean, date or formula cell was lost. The Ods Reader looked
for text:a only in string cells, so it would not have read one back.

All cell types now go through one helper that writes the displayed text,
wrapped in text:a when the cell has a hyperlink. The helper asks
hasHyperlink() first, since getHyperlink() would add an empty one. The
Reader takes text:a from the paragraphs of any cell type.
2026-09-28 03:26:42 +03:00