Commit Graph

3347 Commits

Author SHA1 Message Date
Mark Baker 32efe0ee45
Merge pull request #2819 from PHPOffice/Performance-Coordinates
Performance tweaks to calculating column string from index
2022-05-10 12:51:14 +02:00
MarkBaker a0ad01e91d Performance tweaks to calculating column string from index 2022-05-10 12:33:43 +02:00
Mark Baker 05d08fe787
Merge pull request #2818 from PHPOffice/Performance-Minor-Tweaks
Performance tweaks to cell address validation
2022-05-09 20:23:03 +02:00
MarkBaker 677054dd0a Performance tweaks to cell address validation 2022-05-09 15:40:17 +02:00
oleibman eb34e02085
Restore Tcpdf/Dompdf to Samples in Test Suite (#2814)
They were dropped because they weren't ready for PHP8 when we were. They are ready now.
2022-05-08 11:48:04 -07:00
oleibman 35530502d2
Allow Csv Reader to Treat String as Contents of File (#2792)
See #1285, which went stale and was closed, but recently received some positive feeback. It seems easy to implement, and the only other plaintext file format, Html, allows loading from a string. Those two reasons combined suggest that we should do it.
2022-05-07 08:24:53 -07:00
oleibman a32861a0a0
Copy from Xls(x) to Html/Pdf Loses Drawings (#2788)
Drawings in an Xlsx file are stored in such a way that Php can read their contents using the `zip:` protocol. This does not, however, work when the file is read by PhpSpreadsheet and then saved as Html or Pdf, since the browser will not recognize that protocol even if the file is available. Such drawings need to be saved in the html as embedded images in order for the copy to display them properly. This is true even when the writer is set to not embed images (default).

An additional problem arises when an Html file with an embedded image is read, because `Worksheet\Drawing::setPath` attempts to validate the path, which it cannot do for the `data:image` Url which embedded images use.

And yet another problem. Writer/Html writes out a MemoryDrawing as a png using the imagepng function; but then declares it as jpeg in the Html. This is now corrected.

And a fourth problem. Writer/Html ignores the last row if it contains nothing but a Memory Drawing, which can be true when copying an Xls file.

These changes are testable (it's how I discovered the second part of this parlay). I think it is also useful to add a sample to see the results of this type of copy.
2022-05-07 08:10:24 -07:00
Mark Baker 9776efc226
Merge pull request #2811 from PHPOffice/Ods-Writer-Bugfix-Row-Height
Fix issue with row height styles in Ods Writer
2022-05-06 21:29:19 +02:00
MarkBaker f7ca14f1f1 Fix issue with row height styles in Ods Writer 2022-05-06 21:16:12 +02:00
MarkBaker 779a5e21be Change Log update 2022-05-06 12:44:04 +02:00
Mark Baker 56509d9a3e
Merge pull request #2808 from PHPOffice/Performance-Ods-Writer
Performance Ods/Html Writers
2022-05-06 12:42:03 +02:00
Mark Baker d4f6e78c4e
Merge branch 'master' into Performance-Ods-Writer 2022-05-06 12:32:13 +02:00
MarkBaker f9d941a3af Tweaks to HTML generation, accessing cells directly from the collection 2022-05-06 12:25:47 +02:00
MarkBaker 0dc1e9b07a Switch iterators to use foreach structure 2022-05-06 11:43:10 +02:00
Mark Baker ea165dc52a
Merge pull request #2807 from PHPOffice/Performance-CellIterator
Update get cell logic in Cell Iterators
2022-05-06 11:24:24 +02:00
MarkBaker ae09dd13e1 Update logic in Cell Iterators to use Cell Collection directly where appropriate, bypassing the overhead of additional calls through the worksheet with extra checks and validations 2022-05-06 10:11:01 +02:00
MarkBaker 7201ddd088 Update get cell logic in Cell Iterators 2022-05-05 16:53:56 +02:00
MarkBaker 4a071ce578 Update Change Log 2022-05-05 13:57:28 +02:00
Mark Baker a86ad55a4a
Merge pull request #2806 from PHPOffice/Performance-Xls-Writer
Memory Experiment in Xls Writer
2022-05-05 13:53:53 +02:00
Mark Baker b72b423309
Merge pull request #2804 from PHPOffice/Performance-Xlsx-Writer
Memory Experiment in Xlsx Writer
2022-05-05 13:49:11 +02:00
MarkBaker 1b71e75bc2 Performance Experiment for the Xls Writer, to avoid creating empty cells; and should also be slightly faster 2022-05-05 11:59:25 +02:00
MarkBaker 5ae74145de Performance Experiment for the String Table, to avoid creating empty cells; should also be slightly faster 2022-05-05 10:19:51 +02:00
MarkBaker b399c09dd5 Performance Experiment for the String Table, to avoid creating empty cells; should also be slightly faster 2022-05-05 10:05:32 +02:00
MarkBaker d686a991db Memory Experiment in Xlsx Writer 2022-05-05 09:44:41 +02:00
Mark Baker 48b5d83ee8
Merge pull request #2802 from PHPOffice/Performance-Experimental-Changes
Simplify validation of columnId/rowId values when creating a CellAddress object
2022-05-03 13:30:56 +02:00
MarkBaker e043cf3e24 Eliminate loop in `trimSheetFromCellReference()` method 2022-05-03 13:22:43 +02:00
MarkBaker b4fc92ec7e Simplify validation of columnId/rowId values when creating a CellAddress object 2022-05-03 12:13:10 +02:00
Mark Baker fde77306ff
Merge pull request #2801 from PHPOffice/ScatterChart-Point-Size
Add point size option for scatter charts
2022-05-03 09:00:44 +02:00
MarkBaker 70f5ec60d7 Add point size option for scatter charts 2022-05-03 08:47:34 +02:00
Mark Baker 853cc22913
Merge pull request #2791 from PHPOffice/Named-Range-Alias-Cell-Collection
Experiment #143 in memory saving/performance in the Cell Collection
2022-05-01 22:21:52 +02:00
Mark Baker 9b99ebda27
Merge branch 'master' into Named-Range-Alias-Cell-Collection 2022-05-01 22:09:26 +02:00
MarkBaker 4f7da29332 Minor performance tweaks 2022-05-01 21:55:37 +02:00
dependabot[bot] b38fa15c89
Bump phpstan/phpstan-phpunit from 1.1.0 to 1.1.1 (#2795)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.1.0...1.1.1)

---
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>
2022-05-01 09:00:18 -07:00
dependabot[bot] b9f1e8189e
Bump phpstan/phpstan from 1.5.4 to 1.6.3 (#2794)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.4 to 1.6.3.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.4...1.6.3)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  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>
Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com>
2022-05-01 08:46:34 -07:00
oleibman 8fc8470f81
Minor Changes for Phpstan 1.6.3 (#2797)
One doc block change, one minor code change.
2022-05-01 08:33:38 -07:00
dependabot[bot] 58cb191abc
Bump dompdf/dompdf from 1.2.1 to 1.2.2 (#2796)
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  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-05-01 07:37:44 -07:00
dependabot[bot] ed7efb05f0
Bump mpdf/mpdf from 8.0.17 to 8.1.1 (#2793)
Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.0.17 to 8.1.1.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](https://github.com/mpdf/mpdf/compare/v8.0.17...v8.1.1)

---
updated-dependencies:
- dependency-name: mpdf/mpdf
  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-05-01 07:17:07 -07:00
MarkBaker 3db129dc52 Update to cloning the Cell Collection 2022-05-01 14:02:23 +02:00
MarkBaker 5112503a06 Merge branch 'master' into Named-Range-Alias-Cell-Collection 2022-05-01 09:14:38 +02:00
oleibman 766252ccb0
Real Errors Identified in Calculation by Scrutinizer (#2774)
* Real Errors Identified in Calculation by Scrutinizer

Before Scrutinizer broke, I took a look at the remaining 43 errors which it categorized as 'major'. Most of these were false positives, but, in the case of Calculation and Reader/Xlsx/Chart, I was able to determine that its analysis of some of the problems was correct. There is little point addressing the false positives until it starts working again, but we should fix the real errors.

This PR addresses the real errors in Calculation.
- A test for `$pCellParent` should have been a test  for `$pCellWorksheet`.
- A test for `$operand1Data['reference']` should have been a test for `$operand1Data['value']`.
- A test for `$operand2Data['reference']` should have been a test for `$operand2Data['value']`.

* Fix Attempt to Erroneously Call trim on Array

Fix #2780. Warning message is being issued when getting calculated value of cell with value `=INDIRECT(ADDRESS(ROW(),COLUMN()-2))/$C$4`. This appears to be the case for all recent (and probably not so recent) releases; it is not a result of changes to the code base. Fix added to this PR because the erring section of code was proximate to code already changed in the PR. Test added.

* Minor Code Changes

Apply some suggestions from @MarkBaker
2022-04-30 19:13:17 -07:00
oleibman 0a531cf1cd
Replace 'self' with self::class in 2 Modules (#2773)
PHP 8.2 is supposed to deprecate the use of `['self', 'functionname']` for callables, suggesting the use of `[self::class, 'functionname']` instead. We made this change in a recent PR, and, while I'm thinking about it, I'll fix the remaining 2 modules with this construction. Vlookup is already adequately covered in unit tests. Reader/Xls/MD5 is not; a unit test is added.
2022-04-30 18:36:24 -07:00
oleibman 450873b5fa
Real Errors Identified in Calculation by Scrutinizer (#2775)
Before Scrutinizer broke, I took a look at the remaining 43 errors which it categorized as 'major'. Most of these were false positives, but, in the case of Calculation and Reader/Xlsx/Chart, I was able to determine that its analysis of some of the problems was correct. There is little point addressing the false positives until it starts working again, but we should fix the real errors.

This PR addresses the real errors in Reader/Xlsx/Chart.
- An assignment to `$XaxisLable` should be an assignment to `$XaxisLabel`.
- An assignment to `$YaxisLable` should be an assignment to `$YaxisLabel`.
2022-04-30 17:43:18 -07:00
MarkBaker 32559b44a3 Use the call to Coordinate::coordinateFromString() to validate the coordinate passed to createNewCell() _before_ we try adding it to the Collection 2022-04-30 20:14:36 +02:00
MarkBaker e3a6bc1e4c We should still get an exception for invalid named ranges, but I'm suppressing the message check temporarily in the tests until I can investigate why we're getting 'Column string index can not be longer than 3 characters' instead of 'Invalid cell coordinate XXXX'.
The memory and execution speeds alone make this worthwhile.
2022-04-30 17:29:45 +02:00
MarkBaker b34f0a96a7 More significant reductions in memory usage for peaks, and faster execution times for key Cell Collection methods 2022-04-30 17:07:24 +02:00
Mark Baker 7169648a64
Merge pull request #2786 from PHPOffice/Cell-Collection-Memory-Experiments
Improve memory performance for getSortedCoordinates() in the Cell Collection
2022-04-28 20:02:38 +02:00
MarkBaker 45be09e98b Minor tweaks to execution speed, including eliminating a method call on storing a cell 2022-04-28 19:43:12 +02:00
MarkBaker 0171709e7f The `sortCellReferenceArray()` in `Coordinate` should have returned cells ordered by row, then by column... but instead sorted by column, then row.
Fixed that bug, using a slightly faster algorithm for the sort index than the simple fix would have used, and modified the tests that didn't have the correct expected result :-(
2022-04-28 17:43:01 +02:00
MarkBaker 1924f3c1d7 Improved memory performance for getSortedCoordinates() in the Cell Collection; with minimal execution time overhead.
This is an important method, as it's called by the Reference Helper and for the Writer save() method; so users should see that improvement.
2022-04-28 16:02:49 +02:00
Mark Baker 533f41f879
Merge pull request #2782 from PHPOffice/New-Excel-Functions
Add "Not yet Implemented" stubs for 14 new Excel Functions
2022-04-27 12:44:12 +02:00