Commit Graph

3926 Commits

Author SHA1 Message Date
oleibman 8df86e4236 Add Tests for Shared XmlWriter (#3365)
Fill in some very minor coverage gaps.
2023-02-14 21:38:06 -08:00
Mark Baker 5405eafcec Merge pull request #3361 from PHPOffice/Cell-SetValue-Binder-Override
Allow override of the Value Binder when setting a Cell value
2023-02-14 10:28:59 +01:00
MarkBaker b40e131b78 Allow override of the Value Binder when setting a Cell value 2023-02-14 10:13:35 +01:00
oleibman c95a8b7aa5 Update Change Log (#3360)
Catch up.
2023-02-11 23:24:49 -08:00
Mark Baker ff5087c536 Merge pull request #3358 from PHPOffice/Issue-3356_AutoFit-for-Table-AutoFilter
Allow for Table AutoFilter dropdown icon for AutoFit column sizing
2023-02-12 03:01:48 +01:00
Mark Baker 1bcb86c450 Merge branch 'master' into Issue-3356_AutoFit-for-Table-AutoFilter 2023-02-12 02:42:27 +01:00
MarkBaker 35347e7228 Update Change Log 2023-02-12 02:38:45 +01:00
MarkBaker afa64508cc Unit Tests for AutoSizing columns 2023-02-12 02:29:02 +01:00
oleibman 545fc89d8f Resolve Phpstan Messages Reader/Xls Shared/Escher (#3355)
* Resolve Phpstan Messages Reader/Xls Shared/Escher

Reduce number of Phpstan messages by addressing their issues.

* Scrutinizer

Hyperactivity.

* More Scrutinizer

Getting close.

* Even More Scrutinizer

Closer and closer.
2023-02-11 17:21:19 -08:00
MarkBaker 6b1538f9f0 Let column width calculation return a float 2023-02-11 21:23:22 +01:00
oleibman 4e09fd407d Permit Max Column for Row Breaks (#3345)
* Permit Max Column for Row Breaks

Fix #3143. Page break was dropped. Difference between good and bad was the use of attribute `max` in `brk` tag in the good spreadsheet. However, `max` was *not* required in a similar spreadsheet. So the reason for the problem isn't completely explained. Nevertheless, it can't really hurt to capture the `max` value on read (if present) and generate it on write. This resolves the issue. User is also permitted to specify max column when setting a row break programatically. I am not yet in position to document when that might be a good idea.

* Case-sensitive Directory Name

Not a problem on my Windows system.

* Update Documentation and Add Tests

Change is necessitated by probable Excel bug.

* Unhappy With Initial Implementation

I kind of shoe-horned it in. Better to create a new PageBreak class, which will make it easier to accomodate any future surprises about page break handling. The only difficulty with the new approach is making sure getBreaks maintains backwards compatibility. New tests will ensure that.
2023-02-11 07:44:14 -08:00
MarkBaker 57424102f1 When a Worksheet has an AutoFilter, then we make allowance for the AutoFilter dropdown icon in the filter heading when calculating AutoFit column widths.
Because a Table can also have its own AutoFilter, we now have to allow for that possibility as well when calculating column width for AutoFit columns
2023-02-10 23:30:06 +01:00
oleibman b1c754f04b Correct Some Scrutinizer Messages (#3354)
They have crept in recently.
2023-02-09 23:12:22 -08:00
Mark Baker cc3ae628ae Merge pull request #3357 from PHPOffice/Style-NumberFormat_Additional-Fraction-Tests
Additional Unit Tests for Fraction Number Format Mask
2023-02-09 18:21:57 +01:00
MarkBaker a6083e7a64 Additional Unit Tests 2023-02-09 18:03:17 +01:00
MarkBaker 3e74e56207 Update Change Log 2023-02-09 12:42:07 +01:00
Mark Baker 38ea66decd Merge pull request #3338 from fdjohnston/master
Possible fix for issue #3337
2023-02-09 12:37:41 +01:00
MarkBaker 598890be6c Resolve cs issues 2023-02-09 12:20:29 +01:00
Mark Baker 159e7c5997 Merge branch 'master' into master 2023-02-09 11:52:47 +01:00
MarkBaker 350c9ecc7d Updating some docblocks with additional usage details 2023-02-09 00:28:06 +01:00
MarkBaker cd181abd3c Updating Change Log for interim 1.27.1 release 2023-02-08 08:09:43 +01:00
dependabot[bot] cf332477cc Bump dompdf/dompdf from 2.0.2 to 2.0.3 (#3353)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com>
2023-02-07 13:17:57 -08:00
Mark Baker 11bae5c0c4 Merge pull request #3352 from PHPOffice/PR3329-Additional-Exception-Handling
Additional exception handling to prevent an invalid formula from breaking `isDateTime()`
2023-02-07 20:43:32 +01:00
MarkBaker 8c91bd6942 Additional exception handling to prevent a cell containing an invalid formula from breaking isDateTime() 2023-02-07 18:04:37 +01:00
oleibman 5fb76c83ef Resolve Phpstan Messages in Writer Xls (#3343)
* Resolve Phpstan Messages in Writer Xls

Reduce number of Phpstan messages by addressing their issues. This change does not touch Worksheet, and does not eliminate all Phpstan problems in the modules it does touch.

* Scrutinizer

Yet another false positive.
2023-02-07 07:02:27 -08:00
fjohnston@avatarasoftware.com 67dd292028 Unit tests for issue #3337
Added two unit tests for issue #3337: one that includes the xlfn prefix, and one that does not.  These tests will ensure that the prefix is being added, when appropriate, within an array formula.
2023-02-06 14:15:56 -05:00
oleibman 14fd9bddeb Resolve Phpstan Messages in Writer Ods (#3342)
* Resolve Phpstan Messages in Writer Ods

Reduce number of Phpstan messages by addressing their issues.

* Minor Fix

Phpstan reports one fewer error under Php8 than previously.
2023-02-05 18:54:11 -08:00
dependabot[bot] 8841906dae Bump phpunit/phpunit from 9.5.28 to 9.6.3 (#3350)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.28 to 9.6.3.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.3)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  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>
2023-02-05 15:58:02 -08:00
MarkBaker 247f9cb7f9 DealerDirect have renamed the branch for phpcodesniffer-composer-installer from master to main 2023-02-05 13:24:43 +01:00
Mark Baker 560807c07d Merge pull request #3349 from PHPOffice/NumberFormat_Improved-Docblocks
Improved docblocks for toFormattedString()
2023-02-05 12:53:19 +01:00
Mark Baker d2d43d0bf8 Merge branch 'master' into NumberFormat_Improved-Docblocks 2023-02-05 09:48:46 +01:00
MarkBaker 58c1261fff Improved docblocks for toFormattedString(); and some variable renaming in the code for improved readability and purpose 2023-02-05 09:30:55 +01:00
oleibman 590e4c7af1 Allow More Fonts/Fontnames for Exact Width Calculation (#3326)
* Allow More Fonts/Fontnames for Exact Width Calculation

Fix #3190. A limited set of explicitly-named font files can be used when an exact width calculation is required. User noted that font files are named differently on Mac than on Windows (if the fonts are installed on Linux, the font names probably match Windows). Since the algorithm for generating the Mac file name from the font name seems easy, that algorithm is invoked when the Windows-named file is not found.

Moving on from there, it seems odd that only a small set of fonts are supported. It is, of course, impossible to support all possible fonts out of the box. However, it is possible to allow the user to supply additional mappings from font name to file name (or override existing mappings if neither the Windows nor Mac name matches the user's system), and doing so is permitted with this change:
```php
        \PhpOffice\PhpSpreadsheet\Shared\Font::setExtraFontArray([
            'fontname' => [ /* More than 1 can be specified */
                'x' => 'fontfilenamefornormal.ttf',
                'xb' => 'fontfilenameforbold.ttf',
                'xi' => 'fontfilenameforitalic.ttf',
                'xbi' => 'fontfilenameforbolditalic.ttf',
            ],
        ]);
```

* Unexpected Test Difference

... between Windows and Linux.
2023-02-04 07:25:31 -08:00
MarkBaker 393514d4f0 Improved handling of @ format mask 2023-02-04 13:33:11 +01:00
Mark Baker 0f8f35999e Merge pull request #3344 from PHPOffice/Format-Masks_Improved-@
Improved handling of @ format mask
2023-02-04 13:22:28 +01:00
MarkBaker edc003ad16 Improved handling of @ format mask
Note that it still doesn't work fully if in section 4
2023-02-04 12:54:19 +01:00
Mark Baker ad0b68c7cb Merge pull request #3334 from PHPOffice/NumberFormat_Wizards
Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency and Accounting formats
2023-02-03 19:59:36 +01:00
MarkBaker 7ec1969fae Accounting Format PHP Intl Extension and ICU version checks (minimum PHP 7.4.1 and ICU 53) 2023-02-03 18:24:47 +01:00
Mark Baker 777a230765 Merge branch 'master' into NumberFormat_Wizards 2023-02-03 17:29:43 +01:00
MarkBaker e2c5014c43 Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency, and Accounting 2023-02-03 17:14:28 +01:00
oleibman a2282ecb79 Additional Coverage for Reader Xls (#3340)
* Additional Coverage for Reader Xls

More than 750 lines are newly covered, increasing overall coverage on my machine from 91.14% to 93.09%.

* Update FormulasTest.php
2023-02-03 07:42:43 -08:00
Mark Baker e573b45d7f Merge pull request #3339 from PHPOffice/Style_NumberFormat-New-Fractions
Support for fixed value divisor in fractional Number Format Masks
2023-02-02 12:19:59 +01:00
MarkBaker c47af2a344 Support for fixed value divisor in fractional Number Format Masks 2023-02-02 12:00:50 +01:00
fjohnston@avatarasoftware.com 2b33305221 Possible fix for issue #3337
Using the `FunctionPrefix::addFunctionPrefixStripEquals` appears to fix the issue by adding the _xlfn prefix to functions in array formulas.
2023-02-01 17:28:36 -05:00
Mark Baker 3f8b39ca9a Merge pull request #3336 from PHPOffice/Issue-3355_Quote-Prefix-in-Worksheet-for-Named-Range-Evaluation
Resolution for Issue 3335 - Calculation Engine doesn't evaluate Defined Name when default cell A1 is quote-prefixed
2023-02-01 22:18:32 +01:00
MarkBaker ea3be3b53b Unit tests for evaluation of defined name with a quote-prefixed cell 2023-02-01 21:10:19 +01:00
MarkBaker ddd43ac727 Potential resolution for Issue 3355, where the worksheet for a defined name has a quote-prefixed style for default cell A1.
I wish `_calculateFormulaValue()` was private; sadly not
2023-02-01 19:13:10 +01:00
oleibman 889ad85b84 Resolve Phpstan Messages in Reader Ods (#3324)
* Resolve Phpstan Messages in Reader Ods

Reduce number of Phpstan messages by addressing their issues.

* Update HiddenMergeCellsTest.php
2023-02-01 08:52:26 -08:00
dependabot[bot] 394ac0cf43 Bump friendsofphp/php-cs-fixer from 3.13.1 to 3.14.3 (#3333)
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.13.1 to 3.14.3.
- [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.13.1...v3.14.3)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  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>
2023-02-01 07:02:42 -08:00
dependabot[bot] 2446a130b5 Bump phpstan/phpstan from 1.9.2 to 1.9.14 (#3332)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.2 to 1.9.14.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.9.2...1.9.14)

---
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>
2023-02-01 06:49:09 -08:00