Commit Graph

6058 Commits

Author SHA1 Message Date
Thomas Lallement f5c9026f62 Merge remote-tracking branch 'origin/drawing-in-cell' into drawing-in-cell
# Conflicts:
#	src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php
2025-12-31 13:45:42 +01:00
Thomas Lallement c2c3dda45b Fix moving drawing in cell and add more tests 2025-12-31 13:43:58 +01:00
Thomas Lallement 23f5052b96 Remove duplicated fixture file 2025-12-31 13:43:58 +01:00
tlallement 53ee8028c5 Allow writing Drawing in Cell 2025-12-31 13:43:58 +01:00
tlallement 977619791d Remove init offsetX & offsetY 2025-12-31 13:43:58 +01:00
Thomas Lallement 4084efd7c8 Remove unused imports 2025-12-31 13:43:58 +01:00
Thomas Lallement bb99f0a2d9 Fix phpstan, cs & phpdoc 2025-12-31 13:43:58 +01:00
Thomas Lallement 35074f377b Finalize XLSX In-Cell Drawing Writer 2025-12-31 13:07:21 +01:00
Thomas Lallement 58af20bde4 WIP - Write in-cell drawing 2025-12-31 13:01:15 +01:00
Thomas Lallement 67f57394ac Merge branch 'PHPOffice:master' into patch-1 2025-12-31 12:04:31 +01:00
oleibman 66ba5a8418 Merge pull request #4762 from oleibman/filterexif
Dependencies
2025-12-29 21:37:17 +00:00
oleibman d53a8e5dde Merge pull request #4761 from oleibman/htmlwarn
Suppress Libxml Warnings in Reader/Html
2025-12-29 21:28:02 +00:00
oleibman 2241b2ca00 A Bit More Coverage 2025-12-27 17:20:49 -08:00
oleibman 2bb1c9df3c Dependencies
A dependency checker found the following minor problems:
- `TIMEVALUE` uses the wrong case for `DateTime`.
- The `filter` extension is used but is not declared as a dependency.
- The `exif` extension is used but is not declared as a dependency.

Php tolerates the first, but the solution is so trivial that it might as well be applied.

You have to go out of your way to not include `filter` - is it almost always builtin. Nevertheless, it shouldn't hurt to explicitly declare it.

`exif` is used in only one place, and, if it's not available there, we fall back to `GD`, which *is* a dependency. Getting rid of the `exif` portion should be harmless.
2025-12-27 16:15:30 -08:00
oleibman 2a43cb4202 Coverage Tweak 2025-12-27 15:24:28 -08:00
oleibman 7fb028df51 Improve Coverage 2025-12-27 12:56:51 -08:00
oleibman 32e59142a3 Suppress Libxml Warnings in Reader/Html
Fix #647, which went stale in 2019 and is now reopened.

Fix #849, which went stale in 2019 and is now reopened.

Html Reader currently echoes any warning messages from Dom::loadHtml when it parses Html input. These are generally not needed, and may cause PhpSpreadsheet to fail needlessly. A new property `$suppressLoadWarnings` is added. It will additionally default to `null`, which will avoid any BC breaks. However, the default will be changed to `true` in a future release. Should the caller be interested in any messages which are suppressed when `true` is in effect, these are available through new method `getLibxmlMessages` after the Html has been loaded.
2025-12-27 11:16:45 -08:00
oleibman 1a01a22d2b Merge pull request #4760 from oleibman/intllocales
Set All Locale Variables at Once in a Threadsafe Manner
2025-12-27 05:00:37 +00:00
oleibman c0e77c993f Miscellanea 2025-12-26 18:21:37 -08:00
oleibman dc4582b9ed Mark Some Properties Used Only For Testing as Internal 2025-12-26 08:35:12 -08:00
oleibman 677a9a6269 Additional Test 2025-12-25 21:26:59 -08:00
oleibman f31e621d0d Update Changelog 2025-12-25 19:50:05 -08:00
oleibman 31174c1c90 Set All Locale Variables at Once in a Threadsafe Manner
Fix #954, which went stale 6 years ago and which I have now reopened. The `setLocale` method in `Calculation` and `Settings` does not affect the 3 localizable properties in `StringHelper` - `currencyCode`, `decimalSeparator`, and `thousandsSeparator`. One way to work around this problem is to set those properties separately; this is probably how most people handle it. Another way is to call Php's own `setlocale` function; this does not require any foreknowledge of what the values need to be, but it comes with baggage (data is maintained at process level rather than thread level), so its use is discouraged.

This PR adds a new `setLocale` method to `StringHelper`. It sets the 3 properties and the `Calculation` language all at once. It depends on the `Intl` extension, which is a recommendation but not a formal requirement for PhpSpreadsheet; the method will return `false` if `Intl` is not available or it thinks the supplied locale is not valid.
2025-12-25 19:24:44 -08:00
oleibman 212fac60e9 Merge pull request #4759 from oleibman/studenttlocale
T.INV Don't Use Locale-Aware sprintf
2025-12-25 00:50:05 +00:00
oleibman d7f59e225e T.INV Don't Use Locale-Aware sprintf
Uppercase f to F, add test.
2025-12-24 16:45:40 -08:00
oleibman bec13757a8 Merge pull request #4753 from oleibman/clonebug
Fix Clone Spreadsheet With Defined Names
2025-12-23 06:58:37 +00:00
oleibman bdcc300c6d Merge branch 'master' into clonebug 2025-12-22 22:50:54 -08:00
oleibman 5cae60730b Update CHANGELOG.md 2025-12-22 22:50:09 -08:00
oleibman d3a7e4493c Merge pull request #4751 from oleibman/webservice2
Changes to WEBSERVICE
2025-12-23 05:43:41 +00:00
oleibman e9cc5b1226 Fix Clone Spreadsheet With Defined Names
When a spreadsheet containing defined names is cloned, the worksheets pointed to by the defined names in the cloned spreadsheet are actually clones of the intended worksheets. Fix this, add tests.
2025-12-22 09:48:34 -08:00
oleibman 9bc3a73ba4 Make White List Instance Property Rather than Static 2025-12-21 22:31:45 -08:00
oleibman 2ce3ac1a90 Wrong Case for Directory Name 2025-12-19 10:24:21 -08:00
oleibman 84747121a1 Changes to WEBSERVICE
This PR started because the documentation on how to configure an Http client was out of date. However, as I investigated further, I found problems. GuzzleHttp, a client mentioned in the documentation, for example - it probably works fine when executed from a browser, but it does not work for `https:` requests from the Windows command line. See https://github.com/guzzle/guzzle/issues/2601, where a user notes that Guzzle's own program to demonstrate how to use it doesn't work, a result that I can confirm is still true. A linked explanation says that the solution is to explicitly specify a path to a CA bundle. For starters, this is impractical from our perspective. One possible solution is to change a php.ini option which is not needed for any other purpose, and which probably needs to change frequently - a burden on users who follow that route. An alternative solution is to use a method `request` to specify the path to the certificate store; this also will need to change from time to time, and, worse, the only method defined in ClientInterface is `sendRequest`, so using this solution isn't client-agnostic, which is a stated goal of https://github.com/PHPOffice/PhpSpreadsheet/commit/7cb4884b96174eb611621635e6fb603ef54178f7. Additionally, it is not clear why an external interface is needed rather than a call to file_get_contents, used elsewhere in PhpSpreadsheet, and not requiring a path to a certificate store.

I also believe that automatically evaluating WEBSERVICE for any arbitrary argument is not a good idea. I am adding a domain whitelist which the user must populate. For domains not in the whitelist, the calculation will revert to `oldCalculatedValue`, which is good enough for pass-through purposes, which probably encompasses most cases. That is how Excel behaves by default - it disables WEBSERVICE calls when it opens a spreadsheet which contains them. For cases where the user adds a new WEBSERVICE call, there is a choice of whitelisting the domain, or getting the result in some other way and using `setCalculatedValue` to store it.

Finally, when a WEBSERVICE call *is* evaluated, it will now accept a cell-address argument rather than just a literal string as is now the case.
2025-12-19 10:12:50 -08:00
oleibman f2acc0afbb Merge pull request #4748 from oleibman/studentt
Fix Some Functions Related to Student-T Distribution
2025-12-17 16:37:45 +00:00
oleibman 6d27759bcc Update Changelog 2025-12-17 08:33:41 -08:00
oleibman 33ebb15ba4 Delete No Longer Needed Statement 2025-12-16 22:26:34 -08:00
oleibman 591ef9acd9 Implement Rest of T.DIST
Found an algorithm for T.DIST  when third argument is FALSE.
2025-12-16 21:34:59 -08:00
oleibman 5b4d7fcdc8 Partial Implementation of T.DIST
T.DIST takes 3 parameters. When the 3rd parameter, a boolean, is true, we now have code to support the request. We still do not have code to handle the false case.
2025-12-16 17:10:53 -08:00
oleibman 06d2799528 Forgot to Remove a Placeholder Function 2025-12-15 17:17:27 -08:00
oleibman 5eb46bd48e Fix Some Functions Related to Student-T Distribution
Fix #4167. That problem was initially reported as a problem with TINV, however, at its root, it was actually a problem with TDIST (which TINV needs to call). Both of these are deprecated by Microsoft in favor of some newer functions. PhpSpreadsheet incorrectly treated T.INV as an alias for TINV, and did not implement T.INV.2T, which actually is an alias for TINV.

To solve this problem, I adapted the Perl CPAN module `Statistics::Disttributions`, written by Michael Kospach around 2003. Unit test results have been manually checked against Excel; a few had to be changed because they were wrong (see the original issue). I believe that all of TDIST, T.DIST.2T, T.DIST.RT, TINV, T.INV, and T.INV.2T now function correctly, at least most of the time. I have not found code or an algorithm that I can use for T.DIST nor for T.TEST, both of which remain unimplemented.
2025-12-15 16:53:30 -08:00
oleibman 09f1a57e53 Merge pull request #4746 from oleibman/issue3255
ListWorksheetInfo Improvements for Xlsx and Ods
2025-12-14 16:12:42 +00:00
oleibman f6b0668422 Update Changelog 2025-12-14 08:08:10 -08:00
oleibman a67339973c Merge pull request #4712 from rpg600/5.1.0-patched
feat: add drawing pass-through support for unsupported elements
2025-12-14 09:36:51 +00:00
oleibman b1f9014567 Fix Ods ListWorksheetInfo
It wasn't handling skipped rows and columns correctly.
2025-12-14 01:21:28 -08:00
oleibman 8120b652c4 Merge pull request #4745 from oleibman/sharedxls
Improve Coverage in Shared
2025-12-14 04:43:08 +00:00
oleibman 8f6acb6c4a Merge pull request #4743 from oleibman/sortsortby
Better Tests for SORT and SORTBY
2025-12-14 04:42:46 +00:00
oleibman 1daaad2576 Xlsx Reader ListWorksheetInfo Honor readEmptyCells
Fix #3255, another oldie (3+ years). Allow the ability to only count rows and columns with data. To avoid a breaking change, keep present logic unless Reader `readEmptyCells` attribute is set to its non-default value, i.e. `false`. This adds very little overhead, and gives a result that I think many users would prefer.
2025-12-13 20:14:11 -08:00
oleibman 11d60f6ace Add Sample for Sort By Column 2025-12-13 10:24:07 -08:00
Reinis Grinbergs 1bb6ae8ae5 Add content types when pass-through 2025-12-13 14:34:14 +01:00
oleibman c69133dc7e Additional ExponentialBestFit Test 2025-12-12 15:11:48 -08:00