Commit Graph

4100 Commits

Author SHA1 Message Date
MarkBaker c5fb58fe68 Allow color palette index values in number format masks 2023-04-06 03:41:20 +02:00
Mark Baker 5da2f6ec42 Merge pull request #3503 from PHPOffice/Examples-AutoFilter-Improvements
Examples auto filter improvements
2023-04-02 21:49:38 +02:00
Mark Baker 82e513162f Merge branch 'master' into Examples-AutoFilter-Improvements 2023-04-02 21:30:46 +02:00
Mark Baker 0e17cbb480 Merge pull request #3505 from PHPOffice/Issue-3504_Structured-Reference-Range-Cache
Resolve Issue #3504
2023-04-02 21:29:47 +02:00
MarkBaker 8e3f385224 Resolve Issue #3504
Cached result for a this row range with structured references
2023-04-02 20:22:51 +02:00
MarkBaker 44f3dbe82b Improved Table examples 2023-04-02 20:05:59 +02:00
MarkBaker 9cf41b5dd2 Improved AutoFilter examples 2023-04-02 20:05:43 +02:00
MarkBaker 3f418ceb9a Merge branch 'master' into Examples-AutoFilter-Improvements 2023-04-01 22:44:17 +02:00
Mark Baker 378d46b761 Merge pull request #3494 from PHPOffice/Worksheet-toArray_Ignore-Hidden-Rows-Columns-Option
Provide an Ignore/Return Hidden rows/columns option to the `toArray()` methods
2023-04-01 22:39:12 +02:00
Mark Baker 5ebb1c9943 Merge branch 'master' into Worksheet-toArray_Ignore-Hidden-Rows-Columns-Option 2023-04-01 22:22:23 +02:00
dependabot[bot] f4e897e3b9 Bump mitoteam/jpgraph from 10.2.5 to 10.2.6 (#3502)
Bumps [mitoteam/jpgraph](https://github.com/mitoteam/jpgraph) from 10.2.5 to 10.2.6.
- [Release notes](https://github.com/mitoteam/jpgraph/releases)
- [Commits](https://github.com/mitoteam/jpgraph/compare/10.2.5...10.2.6)

---
updated-dependencies:
- dependency-name: mitoteam/jpgraph
  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-04-01 09:02:07 -07:00
dependabot[bot] efa462f76f Bump friendsofphp/php-cs-fixer from 3.14.4 to 3.15.1 (#3501)
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.14.4 to 3.15.1.
- [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.14.4...v3.15.1)

---
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-04-01 08:56:09 -07:00
dependabot[bot] 74f455a373 Bump phpstan/phpstan-phpunit from 1.3.9 to 1.3.11 (#3500)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.9 to 1.3.11.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.9...1.3.11)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-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>
2023-04-01 08:19:36 -07:00
dependabot[bot] 79ecc8bbae Bump phpstan/phpstan from 1.10.3 to 1.10.9 (#3499)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.3 to 1.10.9.
- [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.10.3...1.10.9)

---
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-04-01 07:52:31 -07:00
dependabot[bot] 9ded32a72f Bump phpunit/phpunit from 9.6.4 to 9.6.6 (#3498)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.4 to 9.6.6.
- [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.6.4...9.6.6)

---
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>
2023-04-01 07:42:11 -07:00
oleibman d6180ad113 Font Themes (#3486)
* Font Themes

It isn't a feature of Excel that I've made any use of, but PR #3476 added better Theme support for colors, and it is relatively easy to add Theme support for Fonts on top of that.

Excel assigns two theme fonts to its spreadsheets, one for Headings (major), and one for Body (minor). If the body theme is Calibri, when you choose a font for a cell in Excel, you can choose 'Calibri (Body)' from the Theme Fonts section at the top of the Font dropdown, or 'Calibri' from the 'All Fonts' section. If you choose the former, the cell will be automatically restyled if you change the Theme Fonts (via Page Layout, Themes, Fonts). The relationship to the theme fonts is recorded in the XML via a `scheme` tag (descending from `font`) whose `val` attribute can be either `major` or `minor`. Accordingly, this PR, in addition to defining the Theme Font properties, adds a `scheme` property, with getter and setter, to Style/Font.

The main benefit of this PR is that you can now load and save a spreadsheet preserving the connections to the Theme Fonts, without having to take any additional action.

A secondary benefit arises from the following difference. Empty cells in Excel will use the spreadsheet's default font name when they are filled in; but, in Google Sheets, they will use the Theme Minor Font name. By setting the `scheme` property in the default style, the resulting spreadsheet will behave the same in both Excel and Google.

I will note that Excel's font themes specify a Latin font, an East Asian font, a Complex Scripts font, and a set of font substitutions for various languages. PhpSpreadsheet will preserve all of these, and allow them to be changed. However, although it is easy to imagine how the non-Latin options might work, I have not yet been able to come up with an example where Excel uses any of them. In particular, if I use a theme font which does not support language X, and I use Language X in a cell bound to the theme, Excel will use a substitution font which does support it, but the font which it uses does not seem to be chosen from the alternatives supplied in the theme.

* Scrutinizer

The sun rises in the east, and Scrutinizer issues more false positives.
2023-03-31 17:12:37 -07:00
Mark Baker ab83bfab88 Merge pull request #3496 from PHPOffice/CalcEngine-Improved-Range-Logging
Add result logging for Range operator
2023-03-31 20:12:51 +02:00
Mark Baker 1781baae25 Merge branch 'master' into CalcEngine-Improved-Range-Logging 2023-03-31 19:45:23 +02:00
MarkBaker 0eef2c9d29 Add result logging for Range operator 2023-03-31 19:28:59 +02:00
Mark Baker e35b39a9c9 Merge pull request #3482 from PHPOffice/Xlsx-Reader_Windows-Folder-Separator-in-Zip
Handle zips with Windoze directory separators (`\`) rather than the standard linux (`/`)
2023-03-31 13:32:47 +02:00
Mark Baker b48232c616 Merge branch 'master' into Xlsx-Reader_Windows-Folder-Separator-in-Zip 2023-03-31 12:56:02 +02:00
MarkBaker 5bd3be8190 Some optimisation and refactoring of the code logic for evaluating a cell when accessed via the toArray() methods 2023-03-30 23:34:03 +02:00
MarkBaker 41fd431acc Allow CellRange and CellAddress objects for the range argument in the rangeToArray() method. 2023-03-30 22:03:25 +02:00
MarkBaker e1b73dcaf5 Provide an Ignore/Return Hidden rows/columns option to the toArray() methods 2023-03-30 22:00:34 +02:00
MarkBaker e5ed056b81 Provide an Ignore/Return Hidden rows/columns option to the toArray() methods 2023-03-30 18:18:46 +02:00
MarkBaker 661bba8d83 Improvements to AutoFilter Examples 2023-03-29 23:47:35 +02:00
Mark Baker 00c34e71e6 Merge pull request #3488 from PHPOffice/Examples-General-Improvements
Examples general improvements
2023-03-29 22:55:16 +02:00
Mark Baker 78c09b09a2 Merge branch 'master' into Examples-General-Improvements 2023-03-29 22:36:27 +02:00
MarkBaker 7d7e616567 Style and typing fixes 2023-03-29 20:05:52 +02:00
MarkBaker e10c286239 Refactor Downloader as a Helper class 2023-03-29 17:05:30 +02:00
MarkBaker b392613ad4 Provide download link for server-generated files while web viewing 2023-03-29 11:44:15 +02:00
MarkBaker b90c0a625c Format "grid" layouts for web viewing 2023-03-29 11:30:26 +02:00
Mark Baker 523a6b68ef Merge pull request #3485 from PHPOffice/Examples-NumberFormat-Wizards
Examples for using some of the new NumberFormat Wizards
2023-03-29 03:12:36 +02:00
Mark Baker aa9e1ed149 Merge branch 'master' into Examples-NumberFormat-Wizards 2023-03-29 02:56:16 +02:00
MarkBaker a69ab80f7d Build currencies list for Currency and Accounting Wizards 2023-03-28 20:37:10 +02:00
MarkBaker 32b4dfb525 Tweaks 2023-03-28 15:01:48 +02:00
MarkBaker 378f12035d PHPCS fixes 2023-03-28 06:39:40 +02:00
Mark Baker 9d82cecbfd Merge pull request #3487 from PHPOffice/TextGrid-Helper_Use-pre-rather-than-code
Fix issue with online samples - Use <pre> tag in Helper Grid
2023-03-28 05:56:08 +02:00
MarkBaker 8ce5407780 Fix issue with online samples - Helper grid using <code> tag which treats newlines as whitespace; needs <pre> tag to render correctly 2023-03-28 05:39:19 +02:00
MarkBaker 45eef3e901 Merge remote-tracking branch 'origin/Examples-NumberFormat-Wizards' into Examples-NumberFormat-Wizards
# Conflicts:
#	samples/Wizards/NumberFormat/Number.php
#	samples/Wizards/NumberFormat/Percentage.php
#	samples/Wizards/NumberFormat/Scientific.php
2023-03-28 00:09:37 +02:00
MarkBaker 3c82cea8f0 Examples for using some of the new NumberFormat Wizards 2023-03-28 00:08:51 +02:00
MarkBaker 9810e7254a Examples for using some of the new NumberFormat Wizards 2023-03-27 03:13:50 +02:00
Mark Baker 2d6b8b26e8 Merge pull request #3484 from PHPOffice/CalcEngine_Extend-Exception-Returning
Minor adjunct to mpdude's PR to return the previous exception
2023-03-26 16:43:38 +02:00
Mark Baker e34121e195 Merge branch 'master' into CalcEngine_Extend-Exception-Returning 2023-03-26 16:25:29 +02:00
oleibman 0e6866d6f0 Font/Effects/Theme Support for Chart Data Labels and Axis (#3476)
* Font and Effects Support for Chart Data Labels and Axis

Addresses some remaining issues with 32readwriteLineChart5 (see issue #1797). Font size is covered. So are effects, although the results are a bit odd. For the new spreadsheet 32readwriteLineChart6, the Axis labels have a yellow-ish glow, but reading and writing the spreadsheet in PhpSpreadsheet gives them a purple-ish glow. Nevertheless, the new test shows that the output file uses schemeClr accent4, as does the input file. So the effect is handled correctly, but it seems there is likely to be a difference between theme colors (Writer/Xlsx/Theme appears to write hard-coded color schemes, and, in any case, Reader/Xlsx does not appear to handle schemeClr). Fixing that will be a great deal more difficult, with a large chance of regression, and will need to happen in a separate PR (one that I am not currently investigating, but I will open a new issue). Effects using srgbClr (and probably sysclr) should be okay.

* Better Theme Support

When reading Xlsx, the theme colors will now also be used for writing. This means that a file can be loaded and saved and its chart colors will now be preserved. If the spreadsheet is created new, Excel 2007-2010 colors are used. The writer is currently hard-coded to use them, so this avoids making this a breaking change. The theme colors can be explicitly changed if desired, and Excel 2013+ colors can be introduced very easily.
```php
$spreadsheet->getTheme()
    ->setThemeColorName(Theme::COLOR_SCHEME_2013_PLUS_NAME);
```
Likewise, if the old behavior of changing to the 2007-2010 scheme rather than using the input values is desired, that is easy to achieve after the load has taken place.
```php
$spreadsheet->getTheme()
    ->setThemeColorName(Theme::COLOR_SCHEME_2007_2010_NAME);
```
The new Theme class introduced by this change can easily be extended to include Fonts and Effects. Unlike Colors, I am unsure what the practical effects of changing those to, say, the 2013+ defaults would be.

* Scrutinizer

Use an alias in a use statement.

* Update Change Log

Due to potential behavior change.
2023-03-26 03:19:34 -07:00
MarkBaker 62d1301890 Minor adjunct to mpdude's PR to return the previous exception 2023-03-26 09:01:27 +02:00
Esteban Gehring 27a1c598da update instructions for migration from phpexcel (#3483) 2023-03-25 07:31:59 -07:00
oleibman cd9f1659fe WIP Handle REF Error as Part of Range (#3467)
Fix #3453. User sets a valid formula (e.g. `=SUM(Sheet2!B1:Sheet2!B3)`), and then does something to invalidate the formula (e.g. delete Sheet2). Excel changes the formula to `SUM(#REF!:#REF!)` when the spreadsheet is saved; apparently someone thought this was a good idea. But PhpSpreadsheet (a) used to throw an Exception when it evaluated the formula, and (b) now gives a result of `0` when evaluating the formula. Neither is ideal. It would be better to propagate the `#REF!` error.

It is likely that more tests are needed, which is why I will keep this in draft status for a bit.
2023-03-25 07:03:52 -07:00
Mark Baker 1f32fa489a Merge pull request #3329 from mpdude/patch-1
Include previous exception in \PhpOffice\PhpSpreadsheet\Cell\Cell::getCalculatedValue()
2023-03-25 09:09:24 +01:00
Mark Baker f95e56b609 Merge branch 'master' into patch-1 2023-03-25 08:42:11 +01:00