Commit Graph

3779 Commits

Author SHA1 Message Date
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
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
oleibman 58c6e51992 Sync composer.lock/.json and Phpstan Upgrade (#3212)
* Sync composer.lock/.json and Phpstan Upgrade

For some reason, a version newly cloned from master receives a complaint from composer that the lock and json files aren't in sync. So I ran composer update. The only thing that needs special attention is, as usual, Phpstan. There are an unusually large number of new differences when Phpstan is run with Php7.4 vs Php8.1. These are handled easily enough. But Reader/Xlsx seems very fragile; a change which would have eliminated one of the new errors seems to have caused Phpstan to go into a loop, as does an annotation without a code change, and, indeed, as does just about any change to that member. This bears watching, and it's a reason I will delay installing this.

* Deleting Phpstan Cache Helps

It lets me change Reader/Xlsx as I wished. Not a great resolution, but probably good enough. I will continue to think about it for a couple of days.

* Minor DocBlock Changes

Correct some PhpDocumentor problems.
2022-11-27 07:39:24 -08:00
Mark Baker 042bacf380 Merge pull request #3213 from PHPOffice/Apply-Row-Column-Limits-in-Reference-Helper
Apply Row and Column limits in Reference Helper
2022-11-26 15:56:35 +01:00
MarkBaker 8a670b0115 Apply Row/column limits (1048576 rows and XFD columns) in the Reference Helper when inserting new rows/columns
Conditional row/column ranges are maintained as cell ranges; and inserting a new column/row pushed these beyond Excel limits, so they aren't maintained when a file is saved
2022-11-26 15:15:53 +01:00
MarkBaker bc0154044b Update to wording for LTS 2022-11-26 00:15:24 +01:00
oleibman d2deb133bc Fix Unintential Deprecated Calls in Tests - STATISTICAL (#3181)
* Fix Unintential Deprecated Calls in Tests - STATISTICAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Missed One Deprecation

Fix it now.

* Run Tests in Spreadsheet Context

This is quite a bit more difficult for Statistical than for the other Calculation categories. This is partly because of the use of multi-dimensional matrices, and also because some arguments are interpreted differently when they come from a cell rather than entered directly in a formula. This push leaves 18 out of 89 test members unchanged, except that they are marked with a TODO to show that the work isn't finished. I will not revisit them as part of this PR, but probably will take a look in a subsequent ticket.
2022-11-25 13:57:17 -08:00
oleibman 1fcfadc4b8 Fix Unintential Deprecated Calls - Everything Else (#3183)
* Fix Unintential Deprecated Calls - Everything Else

I think it's best to install these before PR #3166. This one, which I hope to be the last in this series, does have some minor changes to source code, as well as to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Some Remaining Deprecations in Tests

Fix them now.

* Minor Docblock Updates

Worksheet::unprotectCellsByColumnAndRow was incorrect. Other changes are cosmetic, leading to slightly better documentation.

* Update Worksheet.php
2022-11-25 13:06:52 -08:00
Mark Baker 51a1d6e11f Merge pull request #3211 from PHPOffice/CalcEngine-FormattedNumbers_Thousands-Separator
Allow thousands separator in formatted numeric strings
2022-11-25 20:20:47 +01:00
MarkBaker 04be65aee8 Allow thousands separator in formatted numeric strings to be handled as numbers by the Calculation Engine 2022-11-25 20:03:48 +01:00
Mark Baker e1514ac24c Merge pull request #3210 from PHPOffice/CalcEngine-FormattedNumbers_Thousands-Separator-in-Percentages
Allow thousands separator in percentage formatted strings in formulae
2022-11-25 19:34:18 +01:00
MarkBaker 12581cbb72 Allow thousands separator in percentage formatted strings used as numbers by the Calculation Engine 2022-11-25 19:13:20 +01:00
oleibman a884013d00 Fix Unintential Deprecated Calls in Tests - FINANCIAL (#3180)
* Fix Unintential Deprecated Calls in Tests - FINANCIAL

I think it's best to install these before PR #3166. There are no changes to source code, only to doc-blocks and to test members which continue to inadvertently use calls to deprecated functions.

* Change Tests to Run in Spreadsheet Context

Found and fixed some problems with how MIRR handles errors.
2022-11-25 07:19:19 -08:00
MarkBaker 6607b935cf Update Change Log 2022-11-25 14:51:01 +01:00
MarkBaker 1bb0a637ca Update Change Log 2022-11-25 14:22:21 +01:00
Mark Baker bdb34b94b5 Merge pull request #3189 from fdjohnston/currencies_stored_as_strings
Handle Currencies Stored as Strings in Formulas
2022-11-25 14:19:45 +01:00
Mark Baker 80e4d3a4ed Merge branch 'master' into currencies_stored_as_strings 2022-11-25 14:04:15 +01:00
MarkBaker 171d7684d6 Allow currency numeric strings with thousands separator 2022-11-25 13:15:10 +01:00
Mark Baker 6a259d9745 Merge pull request #3173 from PHPOffice/CalcEngine-Feature_Structured_References
Calculation Engine initial support for Structured References in formulae
2022-11-25 07:37:23 +01:00
Mark Baker 1152196e32 Merge branch 'master' into CalcEngine-Feature_Structured_References 2022-11-24 23:56:08 +01:00
MarkBaker 57885b916c Validate table name for uniqueness on setting name or binding to a worksheet 2022-11-24 22:01:54 +01:00