Commit Graph

3181 Commits

Author SHA1 Message Date
MarkBaker c0f5a403ce Suppress tests that we know will fail (for the moment) 2022-03-04 16:12:14 +01:00
MarkBaker 2c95f3a9f8 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work 2022-03-04 14:59:27 +01:00
Mark Baker 7f79e7a17c Merge pull request #2644 from PHPOffice/CalcEngine-Refactor-Branch-Pruning
Initial work on refactoring branch pruning logic
2022-03-04 14:53:46 +01:00
Mark Baker c4f79af56d Merge branch 'master' into CalcEngine-Refactor-Branch-Pruning 2022-03-04 14:40:34 +01:00
Mark Baker 39bba33d00 Merge pull request #2640 from PHPOffice/CSV-Reader-Dataype-casting-improvements
Csv reader dataype casting improvements
2022-03-04 14:39:00 +01:00
Mark Baker dd981a3d77 Merge branch 'master' into CSV-Reader-Dataype-casting-improvements 2022-03-04 14:25:37 +01:00
MarkBaker e243476f77 Initial work on refactoring branch pruning logic 2022-03-04 13:55:06 +01:00
Paul Weidner 23631cb9e5 Correct fill color example in conditional formatting docs. (#2646) 2022-03-04 01:41:21 -08:00
oleibman dade9cc063 Corrupt Sample Output for 20 and 30 (#2648)
Xls Reader can read drawing offsetX and offsetY as float. However, Excel Xlsx (and PhpSpreadsheet) wants them only as int. This leads 20_Read_Xls and 30_Template to produce corrupt Xlsx files for any Php release. Change Xls Reader to treat values as int, eliminating the corrupt files.
2022-03-04 00:51:11 -08:00
oleibman e87be5e16d Failing Test Requiring Too Much Precision (#2647)
The new array tests for IMCSC fail on my system because of a rounding error in the 14th (!) decimal position. This is not a real failure. Change the test to use only the first 8 decimal positions.
2022-03-04 00:11:04 -08:00
MarkBaker aad91f1d25 Merge branch 'master' into CSV-Reader-Dataype-casting-improvements
# Conflicts:
#	src/PhpSpreadsheet/Reader/Csv.php
2022-03-02 12:43:19 +01:00
MarkBaker 45ca934a53 Update Change Log and Documentation 2022-03-02 12:33:20 +01:00
MarkBaker f3d5028518 Work on setting up locale-aware formatted number conversion for the Csv Reader
Unit tests for locale-aware boolean conversion for Csv Reader
2022-03-02 08:53:29 +01:00
dependabot[bot] a7a48bf0ca Bump dompdf/dompdf from 1.1.1 to 1.2.0 (#2633)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v1.1.1...v1.2.0)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 03:58:33 -08:00
dependabot[bot] 30815cc060 Bump phpunit/phpunit from 9.5.13 to 9.5.16 (#2635)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.13 to 9.5.16.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.13...9.5.16)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 03:48:06 -08:00
dependabot[bot] a8ebf45fd7 Bump phpstan/phpstan from 1.4.5 to 1.4.6 (#2634)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.4.5...1.4.6)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-01 03:34:55 -08:00
oleibman f575d2b8b2 Add Ability to Suppress Mac Line Ending Check for CSV Reader (#2623)
With the deprecation of `auto_detect_line_endings` in Php8.1, there have been some tickets (issue #2609 and PR #2438). Although the deprecation message is suppressed, users with a homegrown error handler may still see it. I am not very concerned about that symptom, but I imagine that there will be more similar tickets in future. This PR adds a new property/method to Reader/CSV to allow the user to avoid the deprecated code, at the negligible cost of being unable to read a CSV with Mac line endings even on a Php version that could support it.
2022-03-01 02:01:37 -08:00
oleibman 8258919d72 Phpstan Differences from Php7 to Php8 (#2631)
These changes were already implemented as PR #2428. They were, alas, regressed by PR #2585. If at first you don't succeed ...

As configured, Phpstan running under Php7 reports no errors. However, running under Php8, it reports 100 (!) errors. The vast majority of these are due to two reasons:
- renaming parameters in Php builtin functions in preparation for named parameters.
- using the new class GdImage rather than type resource as the argument type for many image-based functions.

Regardless of the cause, this will be a problem sooner or later. This PR is an attempt to get ahead of that problem. For source members, it tweaks only the Phpstan configuration files, without changing any PhpSpreadsheet code. For the small number of test members involved, the code is fixed. Php7 and Php8 both report no errors with this configuration.

Because this involves no changes to code, and because Phpstan baseline is a common cause of merge difficulties, I will probably merge this in a day or two, more quickly than I customarily do.
2022-03-01 01:53:12 -08:00
MarkBaker 5579712688 Make CSV Reader boolean casting (e.g. string `"TRUE" to boolean TRUE) locale-aware. 2022-02-27 23:06:22 +01:00
MarkBaker f64e2c2408 Prep-work for handling matrix arithmetic in the calc engine, with some basic unit tests 2022-02-27 22:19:12 +01:00
MarkBaker 55be3b4b5a Minor typehint fixes 2022-02-27 22:05:44 +01:00
MarkBaker cff8303f1b Re-merge from baseline 2022-02-27 14:15:49 +01:00
MarkBaker 4d0f426f4f Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work 2022-02-27 13:51:46 +01:00
Mark Baker fe969f59cc Merge pull request #2627 from PHPOffice/Improve-Translation-Separator-Conflict
Resolve `translateSeparator()` method to handle separators cleanly
Some refactoring of the Ods Reader classes to eliminate code duplication
2022-02-27 13:48:45 +01:00
MarkBaker b31d42c52f Some Refactoring of the Ods Reader, moving all formula and address translation from Ods to Excel into a separate class to eliminate code duplication 2022-02-27 13:31:24 +01:00
MarkBaker 99f488efc6 Resolve translateSeparator() method to handle separators (row and column) for array functions as well as for function argument separators; and cleanly handle nesting levels
Note that this method is used when translating Excel functions between en and other locale languages, as well as when converting formulae between different spreadsheet formats (e.g. Ods to Excel)

Nor is this a perfect solution, as there may still be issues when function calls have array arguments that themselves contain function calls; but it's still better than the current logic
2022-02-27 13:01:09 +01:00
MarkBaker e1f278bb20 Unit tests for reading/writing array formulae from Ods 2022-02-27 12:45:48 +01:00
MarkBaker 9413f00497 Some Refactoring of the Ods Reader, moving all formula and address translation from Ods to Excel into a separate class to eliminate code duplication 2022-02-27 12:45:48 +01:00
MarkBaker 1574f483ac Resolve translateSeparator() method to handle separators (row and column) for array functions as well as for function argument separators; and cleanly handle nesting levels
Note that this method is used when translating Excel functions between en and other locale languages, as well as when converting formulae between different spreadsheet formats (e.g. Ods to Excel)

Nor is this a perfect solution, as there may still be issues when function calls have array arguments that themselves contain function calls; but it's still better than the current logic
2022-02-27 12:45:48 +01:00
MarkBaker 7dfa06f369 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work 2022-02-26 23:06:30 +01:00
Mark Baker e6047cfa9d Merge pull request #2626 from PHPOffice/Ods-Merge-Range-Tests
Unit tests for merge ranges for Ods Reader/Writer
2022-02-26 23:04:28 +01:00
MarkBaker 444d0fd77c Unit tests for merge ranges for Ods Reader/Writer 2022-02-26 22:51:15 +01:00
MarkBaker e30e7cbfd4 More unit tests 2022-02-26 22:14:21 +01:00
MarkBaker 5672bd8df1 Resolve issues introduced during resolution of merge conflicts from master
minor refactoring
2022-02-26 20:43:12 +01:00
MarkBaker 45a770a3fc Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	src/PhpSpreadsheet/Cell/Cell.php
#	src/PhpSpreadsheet/Reader/Gnumeric.php
#	tests/data/Cell/SetValueExplicit.php
2022-02-26 16:37:17 +01:00
Mark Baker d88e8f85ba Merge pull request #2625 from PHPOffice/Iso-Date-Datatype-Additional-Unit-Tests
Minor refactoring of ISO Date checking
2022-02-26 16:10:24 +01:00
MarkBaker 138638ad57 Ensure that selected worksheet is correctly set from Gnumeric Reader 2022-02-26 16:00:28 +01:00
MarkBaker 2af0b66f5f Read number formatting for Gnumeric... highlighted as not occurring when reading date values 2022-02-26 15:20:00 +01:00
MarkBaker fe901d13b4 Read number formatting for Gnumeric... highlighted as not occurring when reading date values 2022-02-26 15:08:12 +01:00
MarkBaker 52071e9f4a ODS Reader should also use the new Method for date values 2022-02-26 15:07:20 +01:00
MarkBaker ef4029df63 Refactor ISO data type validation from cell to shared date; add extra checks for invalid dates; and appropriate unit tests 2022-02-26 14:13:12 +01:00
MarkBaker dc718ddfd6 Rename xlfn functions for Ods 2022-02-26 12:10:46 +01:00
MarkBaker a83e3c6b2b Initial work on Gnumeric reader to support array formulae 2022-02-26 12:10:11 +01:00
MarkBaker 200713a9b7 Initial work on ODS reader to support array formulae 2022-02-25 21:17:18 +01:00
MarkBaker a67cffc7d2 minor tweaks 2022-02-24 23:51:00 +01:00
MarkBaker 38069812ca Allow recalc of all values for a spillage range 2022-02-24 22:36:37 +01:00
MarkBaker b929dd17b5 Ensure that the fromArray() and toArray() functions retain the current cell 2022-02-24 22:00:13 +01:00
MarkBaker 7d5dc726b7 Maintain reference for cells inside a spillage range to prevent their being updated; but allow update of the actual formula cell (adjusting spillage range sa required), and allow setting/update during file load.
Additional unit tests for setting/clearing spillage range for array formulae
Plus a bugfix when worksheet context lost on clearing a spillage range
2022-02-24 15:37:03 +01:00
oleibman 9cf526a920 Reading Xlsx With Supplied Palette (#2595)
Fix #2499, which see for details of an obscure problem affecting both PhpSpreadsheet and Excel. Add support for palette contained in workbook styles. This seems to be a very rare occurrence, so allow it only when the palette contains exactly 64 entries. If there are other possibilities, we'll presumably have a new workbook to guide us how to handle them. Also add some tests for specification of indexed color without palette, another rarity (no in-range examples amongst our current files). Also change one private static array, initialized once at run-time and never changed, to a constant.
2022-02-23 22:09:22 -08:00
Thorsten Ho 0cb60a5098 Fix XLSX broken vertical align font style (#2619)
* Fix XLSX broken vertical align font style

* Add fix information to changelog

* Fix phpcs issues
2022-02-23 20:23:59 -08:00