Commit Graph

3579 Commits

Author SHA1 Message Date
Mark Baker a59b29ae11
Merge branch 'master' into Issue-2833_Null-handling-in-PRODUCT()-Function 2022-05-17 16:53:08 +02:00
oleibman 9aa1708468
Some Fixes for Scatter Charts (#2828)
* Some Fixes for Scatter Charts

Chart issues have been pouring in recently. This is a partial response to issue #2762. It implements "no joins" for scatter charts, as well as having the reader and writer handle "point size", "line width", and "color" for markers. A new boolean property `scatterLines`, with setter and getter, is added to DataSeriesValues to handle joins (default is true which means scatter plot points *are* joined by lines). Some, but not yet all, default font properties for the chart title are handled (color and, surprisingly, font name present challenges).

With these changes, sample 32readwriteScatterChart1.xlsx now looks closer to its source. There are still some differences (x-axis changes), but I think this change is already large enough. I can work on the other problems later.

The code for reading charts has not yet been converted to be namespace aware. Having a tiny island of aware code in a sea of unaware makes no sense to me, so some of the new code is likewise unaware. I hope to be able to get to it eventually, but, among other considerations, it is difficult to generate suitable test cases.

* Add Formal Tests

Essentially the same as the corresponding Samples, but with formal assertions.

* Clean Up Some Code in Reader/Xlsx/Chart

Having added code to support default font attributes as well as element-specific font attributes for chart captions, there was duplicated code between the default and specific sections. I hope that this PR makes the code easier to follow.

* Add Support for Font Name and Color to XLSX Chart Titles

XML layout for these in new files differs from what program was expecting. Not sure if program expectations were wrong, or if this is a change to Excel since initial development.

* Minor Improvement

Handle theoretical case where Chart title has text but no font information.

* Support Bezier Curve and Scaling of X-Axis on Scatter Plot

For Bezier, need to specify `<c:smooth>` tag in addition to already supplied `<c:scatterStyle val="smoothMarker">`

For X-Axis, scatter needs to supply both X and y axis as `<c:valAx>` rather than `<c:catAx>` for X.
2022-05-17 07:48:24 -07:00
MarkBaker db4dac3de9 Filter null values in PRODUCT() function, as they don't affect the calculation in any way, and actually require additional code handling if they're present within the calculation itself 2022-05-17 16:40:14 +02:00
Mark Baker 4df236a688
Merge pull request #2830 from PHPOffice/ChartSheet
Read ChartSheets with the Xlsx Reader if includeCharts is enabled
2022-05-17 16:24:51 +02:00
MarkBaker b4ba57acaa Unit tests for listWorksheetNames() and listWorksheetInfo() with a ChartSheet 2022-05-17 16:11:53 +02:00
MarkBaker e02f25bf48 Update listWorksheetNames() and listWorksheetInfo() to accept ChartSheet information 2022-05-17 15:44:24 +02:00
MarkBaker c66baa44ea Update Change Log 2022-05-17 15:31:44 +02:00
Mark Baker cb81f44091
Merge branch 'master' into ChartSheet 2022-05-17 15:26:09 +02:00
Mark Baker db00b90a12
Merge pull request #2834 from PHPOffice/Issue-2833_Null-handling-in-PRODUCT()-Function
NULL value handling in PRODUCT() Excel function
2022-05-17 13:09:04 +02:00
MarkBaker 2b9b42d5c6 Update Change Log 2022-05-17 13:03:52 +02:00
MarkBaker 79f5cf99f6 Resolve Issue #2833, NULL value handling in PRODUCT() Excel function 2022-05-17 12:56:21 +02:00
MarkBaker a33ed026e9 Update Change Log 2022-05-16 16:35:35 +02:00
MarkBaker 94963f4b97 Type and return tpe cleanups 2022-05-16 15:49:02 +02:00
MarkBaker 198878b347 Add unit tests for ChartSheet reading 2022-05-16 13:30:30 +02:00
MarkBaker 34dd0a929e Read ChartSheets with the Xlsx Reader if includeCharts is enabled; although we're reading it as a normal worksheet that simply contains a chart at cell A1, xOffset 0, yOffset 0, with no data
And Handle ChartSheets in the Xlsx Writer
2022-05-16 13:30:30 +02:00
MarkBaker 092ddbd542 Remove spurious (and out-of-date) text file from source 2022-05-13 10:32:49 +02:00
MarkBaker 5352dbed49 Changelog 2022-05-13 08:49:59 +02:00
Mark Baker ce940a35e9
Merge pull request #2827 from PHPOffice/Issue-2826_Xls-Reader-Converting-Named-Ranges-to-Relative
Fix issue with Xls Reader converting all named ranges from absolute to relative
2022-05-12 12:52:26 +02:00
MarkBaker fd44f47f62 Fix issue with Xls Reader converting all named ranges from absolute to relative 2022-05-12 12:47:18 +02:00
Mark Baker 54d82cd023
Merge pull request #2825 from PHPOffice/Column-Autofit-Indentation
Column autofit indentation
2022-05-11 20:13:04 +02:00
MarkBaker ffd900b6df composer fix 2022-05-11 20:02:58 +02:00
MarkBaker dbcb84bd4d phpstan fix 2022-05-11 19:54:16 +02:00
MarkBaker 4a4078f38f Merge branch 'master' into Column-Autofit-Indentation 2022-05-11 19:00:43 +02:00
Mark Baker a352856485
Merge pull request #2824 from PHPOffice/CalcEngine-Function-Return-Type-CellReference
Calc engine function return type cell reference
2022-05-11 18:59:13 +02:00
MarkBaker dd3ed498e9 Trying to rationalise phpstan between local and CI 2022-05-11 18:48:05 +02:00
MarkBaker 65053d711c Assertion updates 2022-05-11 16:06:44 +02:00
MarkBaker 153a3a6af6 Fix for null value passed to extractSheetTitle() 2022-05-11 16:06:19 +02:00
MarkBaker bb96542b64 Autofit adjustment for indent 2022-05-11 12:33:01 +02:00
oleibman 070bc68514
Html Reader Converting Cell Containing 0 to Null String (#2813)
Fix #2810. Repairing some Phpstan diagnostics, used `?:` rather than `??` in a few places.

2 different Html modules are affected. Also, Ods Reader, but its problem is with sheet title rather than cell contents. And, as it turns out, Ods Reader was already not handling sheets with a title of `0` correctly - it made a truthy test before setting sheet title. That is now changed to truthy or numeric. Other readers are not susceptible to this problem. Tests are added.
2022-05-10 07:33:45 -07:00
oleibman b0bfdde164
Cleanup After Phpstan Upgrade (#2800)
After Phpstan 1.6.3 upgrade, clean up some new problems that will show up if it runs under Php 8+.
2022-05-10 07:20:22 -07:00
Mark Baker 4d5a4824c4
Merge pull request #2820 from PHPOffice/Performance-Coordinates-2
Performance tweaks to calculating column string from index
2022-05-10 13:57:28 +02:00
MarkBaker 55f03a5d38 Performance tweaks to calculating column string from index 2022-05-10 13:28:18 +02:00
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