Commit Graph

3798 Commits

Author SHA1 Message Date
MarkBaker fda996e192 Initial work on handling Structured References in the Calculation Engine 2022-12-24 00:20:10 +01:00
MarkBaker 09f63e6902 Prepare Change Log for next release 2022-12-21 13:54:06 +01:00
MarkBaker a40793ce3d 1.26.0 - 2022-12-21
### Added

- Extended flag options for the Reader `load()` and Writer `save()` methods
- Apply Row/Column limits (1048576 and XFD) in ReferenceHelper [PR #3213](https://github.com/PHPOffice/PhpSpreadsheet/pull/3213)
- Allow the creation of In-Memory Drawings from a string of binary image data, or from a stream. [PR #3157](https://github.com/PHPOffice/PhpSpreadsheet/pull/3157)
- Xlsx Reader support for Pivot Tables [PR #2829](https://github.com/PHPOffice/PhpSpreadsheet/pull/2829)
- Permit Date/Time Entered on Spreadsheet to be calculated as Float [Issue #1416](https://github.com/PHPOffice/PhpSpreadsheet/issues/1416) [PR #3121](https://github.com/PHPOffice/PhpSpreadsheet/pull/3121)

### Changed

- Nothing

### Deprecated

- Direct update of Calculation::suppressFormulaErrors is replaced with setter.
- Font public static variable defaultColumnWidths replaced with constant DEFAULT_COLUMN_WIDTHS.
- ExcelError public static variable errorCodes replaced with constant ERROR_CODES.
- NumberFormat constant FORMAT_DATE_YYYYMMDD2 replaced with existing identical FORMAT_DATE_YYYYMMDD.

### Removed

- Nothing

### Fixed

- Fixed handling for `_xlws` prefixed functions from Office365 [Issue #3245](https://github.com/PHPOffice/PhpSpreadsheet/issues/3245) [PR #3247](https://github.com/PHPOffice/PhpSpreadsheet/pull/3247)
- Conditionals formatting rules applied to rows/columns are removed [Issue #3184](https://github.com/PHPOffice/PhpSpreadsheet/issues/3184) [PR #3213](https://github.com/PHPOffice/PhpSpreadsheet/pull/3213)
- Treat strings containing currency or accounting values as floats in Calculation Engine operations [Issue #3165](https://github.com/PHPOffice/PhpSpreadsheet/issues/3165) [PR #3189](https://github.com/PHPOffice/PhpSpreadsheet/pull/3189)
- Treat strings containing percentage values as floats in Calculation Engine operations [Issue #3155](https://github.com/PHPOffice/PhpSpreadsheet/issues/3155) [PR #3156](https://github.com/PHPOffice/PhpSpreadsheet/pull/3156) and [PR #3164](https://github.com/PHPOffice/PhpSpreadsheet/pull/3164)
- Xlsx Reader Accept Palette of Fewer than 64 Colors [Issue #3093](https://github.com/PHPOffice/PhpSpreadsheet/issues/3093) [PR #3096](https://github.com/PHPOffice/PhpSpreadsheet/pull/3096)
- Use Locale-Independent Float Conversion for Xlsx Writer Custom Property [Issue #3095](https://github.com/PHPOffice/PhpSpreadsheet/issues/3095) [PR #3099](https://github.com/PHPOffice/PhpSpreadsheet/pull/3099)
- Allow setting AutoFilter range on a single cell or row [Issue #3102](https://github.com/PHPOffice/PhpSpreadsheet/issues/3102) [PR #3111](https://github.com/PHPOffice/PhpSpreadsheet/pull/3111)
- Xlsx Reader External Data Validations Flag Missing [Issue #2677](https://github.com/PHPOffice/PhpSpreadsheet/issues/2677) [PR #3078](https://github.com/PHPOffice/PhpSpreadsheet/pull/3078)
- Reduces extra memory usage on `__destruct()` calls [PR #3092](https://github.com/PHPOffice/PhpSpreadsheet/pull/3092)
- Additional properties for Trendlines [Issue #3011](https://github.com/PHPOffice/PhpSpreadsheet/issues/3011) [PR #3028](https://github.com/PHPOffice/PhpSpreadsheet/pull/3028)
- Calculation suppressFormulaErrors fix [Issue #1531](https://github.com/PHPOffice/PhpSpreadsheet/issues/1531) [PR #3092](https://github.com/PHPOffice/PhpSpreadsheet/pull/3092)
- Permit Date/Time Entered on Spreadsheet to be Calculated as Float [Issue #1416](https://github.com/PHPOffice/PhpSpreadsheet/issues/1416) [PR #3121](https://github.com/PHPOffice/PhpSpreadsheet/pull/3121)
- Incorrect Handling of Data Validation Formula Containing Ampersand [Issue #3145](https://github.com/PHPOffice/PhpSpreadsheet/issues/3145) [PR #3146](https://github.com/PHPOffice/PhpSpreadsheet/pull/3146)
- Xlsx Namespace Handling of Drawings, RowAndColumnAttributes, MergeCells [Issue #3138](https://github.com/PHPOffice/PhpSpreadsheet/issues/3138) [PR #3136](https://github.com/PHPOffice/PhpSpreadsheet/pull/3137)
- Generation3 Copy With Image in Footer [Issue #3126](https://github.com/PHPOffice/PhpSpreadsheet/issues/3126) [PR #3140](https://github.com/PHPOffice/PhpSpreadsheet/pull/3140)
- MATCH Function Problems with Int/Float Compare and Wildcards [Issue #3141](https://github.com/PHPOffice/PhpSpreadsheet/issues/3141) [PR #3142](https://github.com/PHPOffice/PhpSpreadsheet/pull/3142)
- Fix ODS Read Filter on number-columns-repeated cell [Issue #3148](https://github.com/PHPOffice/PhpSpreadsheet/issues/3148) [PR #3149](https://github.com/PHPOffice/PhpSpreadsheet/pull/3149)
- Problems Formatting Very Small and Very Large Numbers [Issue #3128](https://github.com/PHPOffice/PhpSpreadsheet/issues/3128) [PR #3152](https://github.com/PHPOffice/PhpSpreadsheet/pull/3152)
- XlsxWrite preserve line styles for y-axis, not just x-axis [PR #3163](https://github.com/PHPOffice/PhpSpreadsheet/pull/3163)
- Xlsx Namespace Handling of Drawings, RowAndColumnAttributes, MergeCells [Issue #3138](https://github.com/PHPOffice/PhpSpreadsheet/issues/3138) [PR #3137](https://github.com/PHPOffice/PhpSpreadsheet/pull/3137)
- More Detail for Cyclic Error Messages [Issue #3169](https://github.com/PHPOffice/PhpSpreadsheet/issues/3169) [PR #3170](https://github.com/PHPOffice/PhpSpreadsheet/pull/3170)
- Improved Documentation for Deprecations - many PRs [Issue #3162](https://github.com/PHPOffice/PhpSpreadsheet/issues/3162)
2022-12-21 13:23:47 +01:00
Mark Baker c31b1de3f6 Merge pull request #3256 from PHPOffice/Reader-Writer-Flags
Reader/Writer flags
2022-12-21 13:17:41 +01:00
Mark Baker f5b5ed8289 Merge branch 'master' into Reader-Writer-Flags 2022-12-21 12:59:29 +01:00
Mark Baker b3109d696b Merge pull request #3257 from PHPOffice/Table_Get-Table-by-Name
Additional methods for working with Tables by name
2022-12-21 12:57:34 +01:00
MarkBaker 70e668a593 Unit Tests 2022-12-21 12:26:14 +01:00
MarkBaker 519d3a9f1e Additional methods for working with Tables by name 2022-12-21 06:44:16 +01:00
MarkBaker 96c7249639 Update documentation 2022-12-21 05:36:33 +01:00
MarkBaker 5a437b8d75 Update documentation 2022-12-20 18:28:42 +01:00
MarkBaker 72a9666382 Provide additional flag options for the Reader load() and Writer save() methods 2022-12-20 17:56:50 +01:00
Mark Baker 4fc43c933b Merge pull request #3253 from PHPOffice/Bugfix_Full-Table-Structured-References
Ensure that Full Table Structured References are correctly recognised
2022-12-19 05:03:27 +01:00
MarkBaker ca7226e9d7 Ensure that Full Table Structured References are correctly recognised, and don't throw an error 2022-12-19 04:44:24 +01:00
MarkBaker 0b90d8e416 Minor update to docblocks with a warning for selecting cells and assigning to a variable 2022-12-17 11:41:47 +01:00
Mark Baker 6e3a19e211 Merge pull request #3249 from PHPOffice/New-Excel-Function_Stubs-for-Implementation
Create stubs for new Excel functions
2022-12-16 10:30:39 +01:00
MarkBaker a9ca25d9de Create stubs for new Excel functions 2022-12-15 15:58:56 +01:00
Mark Baker 6d53978e71 Merge pull request #3247 from PHPOffice/Issue-3245_New-xlws-prefix-for-SORT-and-FILTER-Functions-in-Xlsx
Handling the new _xlws. prefix used for SORT() and FILTER() functions
2022-12-15 14:49:40 +01:00
MarkBaker 452048d152 Merge remote-tracking branch 'origin/Issue-3245_New-xlws-prefix-for-SORT-and-FILTER-Functions-in-Xlsx' into Issue-3245_New-xlws-prefix-for-SORT-and-FILTER-Functions-in-Xlsx
# Conflicts:
#	src/PhpSpreadsheet/Writer/Xlsx/FunctionPrefix.php
2022-12-15 14:23:04 +01:00
MarkBaker 58d36bf2b1 Handling the new _xlws. prefix used for SORT() and FILTER() functions in both the Calculation Engine, and in the Xlsx Writer
Create stubs for new uncategorised ANCHORARRAY() and SINGLE() functions; for the new Logical functions BYCOL(), BYROW(); LAMBDA(), LET(), MAKEARRAY(), MAP(), REDUCE() and SCAN() functions; and for the new Information function ISOMITTED()
2022-12-15 14:22:11 +01:00
MarkBaker 5839533dc1 Handling the new _xlws. prefix used for SORT() and FILTER() functions in both the Calculation Engine, and in the Xlsx Writer
Create stubs for new uncategorised ANCHORARRAY(), LAMBDA(), and SINGLE(); and for the new Logical functions BYCOL() and BYROW()
2022-12-15 13:16:45 +01:00
Mark Baker c8cd9a830d Merge pull request #3243 from PHPOffice/Issue-3239_Load-Table-without-Filter
Allow option for disabled filtering on tables
2022-12-13 16:28:04 +01:00
MarkBaker 379e3fc5a5 Additional unit tests for Table Writer 2022-12-13 16:00:22 +01:00
MarkBaker f350037ba1 Allow option for disabled filtering on tables 2022-12-13 11:01:29 +01:00
oleibman 29b07a7c86 Namespace-Aware Code for SheetViewOptions, SheetProtection (minor break) (#3230)
* Namespace-Aware Code for SheetViewOptions, SheetProtection (minor break)

This is fairly straightforward for SheetViewOptions.

SheetProtection is a bit less straightforward. All the attributes should allow for null as well as boolean; this is especially important because Excel defaults to true for some of them and false for others (existing code always treated attributes missing from the XML as false). DocBlocks are updated to indicate the defaults. The test for isProtectionEnabled is changed to reflect this reality. Also, PhpSpreadsheet has been using true/false when writing these, but Excel uses 1/0. Because of these differences, this is a breaking change, but the consequences of the breaks should be minor. Two unit test results needed to change.

Remaining areas in Reader/Xlsx which still use the namespace-unaware code include conditional formatting (internal or external), auto filters, unparsed loaded data, data validation (internal or external), alternate content, and header/footer images.

* Corrections to Xls Reader and Writer

New test and changed sample to go with code changes. Also doc change.
2022-12-11 17:38:26 -08:00
Mark Baker 2351443491 Merge pull request #3236 from PHPOffice/Structured-References_On-Changing-a-Column-Heading
Update cells that use structured references in formula, and defined names, when a table column heading is changed
2022-12-10 15:40:58 +01:00
Mark Baker d5587e9d22 Merge branch 'master' into Structured-References_On-Changing-a-Column-Heading 2022-12-10 15:20:47 +01:00
MarkBaker 6e4a875aea Unit Tests for changing the value of a column header in a Table 2022-12-10 15:04:54 +01:00
MarkBaker 873ea0b503 Update cells that use structured references in formula, and defined names, when a table column heading is changed 2022-12-10 13:17:55 +01:00
oleibman 73ff527121 32-bit Unit Test Warnings (#3232)
* 32-bit Unit Test Warnings

Some new problems exposed with latest Php8.1.

* Update BitWise.php
2022-12-09 08:47:54 -08:00
Mark Baker 836792c325 Merge pull request #3234 from PHPOffice/Refactoring_Function_Tests-Database
Refactor Database function Unit Tests
2022-12-09 15:05:04 +01:00
Mark Baker e5be169e17 Merge branch 'master' into Refactoring_Function_Tests-Database 2022-12-09 13:36:21 +01:00
Mark Baker 7b4ba98081 Merge pull request #3235 from PHPOffice/Structured-References_On-Updating-the-Table-Name
Update cells and defined names that use structured references in formula when a table name is changed
2022-12-09 13:09:41 +01:00
MarkBaker 6f6cf60c28 Unit Tests for changing a Table name 2022-12-09 12:38:45 +01:00
MarkBaker 234196088a Update cells that use structured references in formula, and defined names, when a table name is changed 2022-12-09 01:16:31 +01:00
MarkBaker 6fd24cad58 Refactor database tests to execute the test itself and check assertions in the main test function, not in the base class
Test both the function implementation (directly), and when the function is called in a formula from a spreadsheet
Replace error strings in expected result for providers with the value returned from the ExcelErrors class
2022-12-08 12:49:19 +01:00
oleibman 1a094cdda2 Correct DocBlock in GammaBase (#3231)
See discussion in https://github.com/phpDocumentor/phpDocumentor/issues/3378
2022-12-04 19:54:38 -08:00
Mark Baker 79914c4c0a Merge pull request #3229 from PHPOffice/CalcEngine-Minor-Tweak
Minor tweak to calculation stack
2022-12-05 01:43:25 +01:00
Mark Baker 123932b845 Merge branch 'master' into CalcEngine-Minor-Tweak 2022-12-05 01:35:48 +01:00
MarkBaker 405dec7498 Minor tweak to calculation stack 2022-12-05 00:55:31 +01:00
oleibman ed1ebb9dfe Update Change Log 2022-12-03 (#3227)
Include some undocumented changes since 2022-11-08.
2022-12-03 18:07:17 -08:00
oleibman 3f9752a2db Correct Some DocBlocks in Writer/CSV (#3225)
* Correct Some DocBlocks in Writer/CSV

The parameters for some methods had default values in PHPExcel, but the defaults were removed in PhpSpreadsheet. However, the doc-blocks continue to report a default. I also moved some of the parameter and return type declarations from doc-block to method signature. No other executable code was changed.

This isn't much of a change. I'm just pushing it now to see the effects of changes pushed earlier today (Php8.1 for Scrutinizer, no fake Php7.3 step).

* Comment Change

Scrutinizer was absent from a couple of merges today. Checking to see if it shows up here.
2022-12-03 09:00:49 -08:00
oleibman 2430abde03 Eliminate Some Scrutinizer 'Major' Problems Part 7 Xls (#3219)
* Eliminate Some Scrutinizer 'Major' Problems Part 7 Xls

The last change in this series. Dividing the work between xls and non-xls code seems to partitition the work very nicely 50-50. This is the Xls part. All remaining Scrutinizer problems will be recoded, annotated, or preceded by a comment explaining why no action is taken.

* One More Dead Assignment

Fix it.
2022-12-03 07:12:23 -08:00
oleibman 25d3968788 Eliminate Some Scrutinizer 'Major' Problems Part 6 Non-Xls (#3218)
* Eliminate Some Scrutinizer 'Major' Problems Part 6 Non-Xls

The penultimate change in this series. Dividing the work between xls and non-xls code seems to partitition the work very nicely 50-50. This is the non-Xls part. All remaining Scrutinizer problems will be recoded, annotated, or preceded by a comment explaining why no action is taken.

Three members in Shared/Jama are deleted. All had Scrutinizer errors. None are called from anywhere inside PhpSpreadsheet, including the test suite. It is much easier to delete the unused members than to fix (and test) them.

* More Surprises

Apparently Scrutinizer will sometimes flag an error only once for a module no matter how often it occurs.
2022-12-03 06:44:27 -08:00
oleibman 057572ee90 Change Additional Statistical Tests to Use Spreadsheet Context (#3217)
* Change Additional Statistical Tests to Use Spreadsheet Context

With an earlier change, I made all but 18 Statistical tests run in spreadsheet context. This PR changes 12 of those 18. The remaining 6 usually return array results, so it is a tougher task to handle them. I will continue to think on it.

AVERAGEIF, AVERAGEIFS, and COUNTBLANK are changed to throw an Exception when a range is specified as a literal. They previously accepted array (enclosed in braces) literals, and bumbled along till they threw an error for non-array literals. Throwing an exception appears to be analogous to how Excel operates, rather than something more friendly like a VALUE error. There may be other functions which require similar treatment.

There also remains a TODO for COUNTIFS, and possibly other functions. It appears that PhpSpreadsheet counts booleans for both integer and string compares and probably shouldn't. Again, this is a problem for another day.

* Scrutinizer

Fix one problem.

* Scrutinizer Ignores Its Own Suggested Remedy

Try another approach.
2022-12-02 14:14:43 -08:00
Adrien Crivelli f122dc62be heredoc syntax does not break indentation anymore 2022-12-02 15:33:30 +01:00
Adrien Crivelli 634f16cfb1 No more PHP 7.3 fake CI 2022-12-02 15:17:18 +01:00
Adrien Crivelli d87ef34820 PHP 8.1 on Scrutinizer 2022-12-02 14:16:14 +01:00
Mark Baker dcb10e2760 Merge pull request #3220 from PHPOffice/Issue-3214_Xlsx-Reader-Adjusts-Selected-Cell-when-Loading-CF-Ranges
Store the currently selected cell when loading Conditional Format Ranges, then reset afterwards
2022-11-30 12:07:53 +01:00
Mark Baker c2571223ff Merge branch 'master' into Issue-3214_Xlsx-Reader-Adjusts-Selected-Cell-when-Loading-CF-Ranges 2022-11-30 11:47:56 +01:00
MarkBaker 71334877c9 Store the currently selected cell when loading Conditional Format Ranges, then reset afterwards 2022-11-30 11:12:33 +01:00