Commit Graph

3449 Commits

Author SHA1 Message Date
MarkBaker bb7e083745 Add Hidden Worksheet unit tests for other Readers 2022-05-24 14:40:45 +02:00
MarkBaker 23ce21901d Add support for reading Worksheet Visibility for Gnumeric 2022-05-24 14:08:41 +02:00
Mark Baker 7fff764698
Merge pull request #2847 from PHPOffice/CellRange-Validation-Performance-Tweak
Minor performance tweaks
2022-05-24 09:00:51 +02:00
Mark Baker 4f1d6d2cac
Merge branch 'master' into CellRange-Validation-Performance-Tweak 2022-05-24 08:50:51 +02:00
MarkBaker 8914c61265 Minor performance tweak 2022-05-23 18:32:20 +02:00
oleibman d11152271e
Eliminate Corruption in Surface Chart Samples (#2846)
* Eliminate Corruption in Surface Chart Samples

Fix #2763 (bubble charts were fixed earlier).

* Improvement in Testing for Numeric Values

The original proposal was to test for numeric values by checking whether the format was NUMERIC or DATE. This is pretty inflexible, and left open a wide gap concerning what to do with GENERAL. Changed to allow the user to set a `numeric` property at the same time as `axisNumberProperties`, eliminating these concerns. User can set property when chart is created (new test member Charts32CatAxValAxTest), or can set it when spreadsheet with chart is read (new method testCatAxValAx in Charts32XmlTest). Sample 33_Chart_create_scatter2 creates a slightly wider chart when `numeric` is set to true than it does when unset, but chart is otherwise the same.

Corrected a bug which occured twice in Chart. Methods getChartAxisX and getChartAxisY created a new Axis object if the chart pointer was null, but neglected to attach the new object to the chart. Thus, subsequent calls to the methods return different objects. Code is changed to attach the new Axis to the Chart.
2022-05-23 09:21:52 -07:00
Mark Baker a54d1c14aa
Merge pull request #2850 from PHPOffice/Ods-Writer-Worksheet-Visibility
Add support for writing Worksheet Visibility for Ods
2022-05-23 17:16:02 +02:00
Mark Baker 2de58d4164
Merge branch 'master' into Ods-Writer-Worksheet-Visibility 2022-05-23 17:06:19 +02:00
Mark Baker 6569f725e3
Merge pull request #2851 from PHPOffice/Ods-Reader-Worksheet-Visibility
Add support for reading Worksheet Visibility for Ods
2022-05-23 17:05:27 +02:00
Mark Baker 2f3892788f
Merge branch 'master' into Ods-Reader-Worksheet-Visibility 2022-05-23 16:52:48 +02:00
Mark Baker 12ae0d249f
Merge pull request #2849 from PHPOffice/Issue-2848_Xlsx-Reader-Invalid-Print-Area
Don't load invalid Print Area, because this will corrupt the internal print area definition, and break on Writing
2022-05-23 16:31:54 +02:00
MarkBaker 3fae29d613 Add support for reading Worksheet Visibility for Ods 2022-05-23 15:30:45 +02:00
MarkBaker 2e5ebea110 Add support for writing Worksheet Visibility for Ods 2022-05-23 13:38:08 +02:00
MarkBaker 924ec23eb0 Don't load invalid Print Area, because this will corrupt the internal print area definition, and break on Writing 2022-05-23 12:12:05 +02:00
MarkBaker 8ef9aa8251 Minor performance tweak 2022-05-23 00:08:06 +02:00
oleibman 7c1c896959
Change and Re-enable URLImageTest (#2844)
Disabled it earlier because its reliance on an external site not under our control was causing problems. URL in spreadsheet is now changed to point to an image in phpspreadsheet.readthedocs.io, which should be more reliable. Test is re-enabled.
2022-05-21 08:07:59 -07:00
oleibman 567b9601b0
Allow Csv Reader to Store Null String in Spreadsheet (#2842)
Fix #2840 (and also #2839 but that's Q&A, not an issue). Csv Reader does not populate cells which contain null string. This PR provides an option for the reader to store null strings as it does with any other string.
2022-05-21 07:21:14 -07:00
oleibman ef031e74e1
More Chart Fixes (#2841)
* More Chart Fixes

Taking up where #2828 left off. Most of the following changes are demonstrated in 32readwriteChartWithImages1:
- Adds support for "scheme" colors (because rgb, theme, and index colors just weren't enough for Excel) for DataSeriesValues. See issue #2299.
- For chart titles (including axis labels), rather than a font name, Excel supplies a 3-fold series of font names for Latin, East Asian, and Complex Scripts. New properties `latin`, `eastAsian`, and `complexScript` are added to the Font class. I frankly have no idea how, or even if, you can set these in Excel; my test case (sample 32readwriteScatterChart7) is a result of manually editing the XML.
- Add support for subscript/superscript to chart titles. This requires a new property `baseLine` in Font (positive=superscript negative=subscript baseline value says how high/low).
- Support for underscore with different scheme color than its text, using a new string property `uSchemeClr` in Font.
- Support for extra options for strikethrough, using a new string property `strikeType` in Font.
- Support for extra options for underscore type, using the existing string property `underline` in Font.
- I do not anticipate that any of the new Font properties will be used except for chart titles.
- If no default font overrides are found for a Rich Text element in chart titles, and no explicit font overrides are found for a Run under such an element, the font element of the Run is set to null.
- PhpSpreadsheet will always write a tag `a:pPr` and, underneath that, an empty tag `a:defRPr`, for default font settings for chart titles and axis labels. Combined with the previous bullet item, this will prevent PhpSpreadsheet from inadvertently overriding the Excel defaults (18 point bold Calibri for chart title, 10 point bold Calibri for axis labels).
- Axis labels will now be written to XML in the same manner as chart titles. Among other considerations, this means that they can now have colors. Fix #2700. Supersedes PR #2701. Demonstrated in sample 32readwriteStockChart5.

* Fix Some Chart Corruption

Fix #2817, where @bridgeplayr gives an excellent description of the problem and how it should be solved.

* Fix Bubble Charts

Sample produced corrupt output - see issue #2763. After a lot of research, solution was just re-ordering of parameters in a single function call.

Bubble 3D had not been supported at all. It is now.

Surface Charts remain corrupted.
2022-05-21 07:01:18 -07:00
oleibman 9d36e442e9
Disable URLImageTest (#2843)
This test has always been problematic in that it depends on an external site not under the control of PhpSpreadsheet, and can therefore break at any time. As it has done this morning. Disable it until a better test is available.
2022-05-21 06:46:02 -07:00
Mark Baker b8957205e1
Merge pull request #2835 from PHPOffice/Issue-2833_Null-handling-in-PRODUCT()-Function
Filter null values in PRODUCT() function

> It all looks good to me.

ty
2022-05-17 17:10:32 +02:00
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