Commit Graph

2944 Commits

Author SHA1 Message Date
MarkBaker 765d4586ae Renaming the last of the DateTime implementation methods 2021-05-12 17:17:25 +02:00
MarkBaker f7a07747fd More method renaming 2021-05-12 17:17:25 +02:00
MarkBaker aa3269a863 Some method renaming 2021-05-12 17:17:25 +02:00
MarkBaker 97472ae383 Fix AutoFilter dat break referencing the old Now::evaluate() class/method, rather than the new Current::now() 2021-05-12 17:17:25 +02:00
MarkBaker cd667500e0 Group some of the newly extracted Excel DateTime function implementations into groups of related functions with appropriate and meaningful class names, and rename the public methods to be more descriptive of their purpose 2021-05-12 17:17:25 +02:00
MarkBaker 7903827475 Deprecation notice in ChangeLog for the old Excel funcion implementations 2021-05-12 09:55:01 +02:00
oleibman 6fb3d840c2
Merge pull request #2049 from xandros15/#984
#984 Add support notContainsText for conditional styles in xlsx
2021-05-11 14:56:15 -07:00
oleibman d5492ac8ed
Merge branch 'master' into #984 2021-05-11 14:44:33 -07:00
Tanguy De Taxis d08653433c fr locale - Add JOURS function (DAYS equivalent) 2021-05-11 14:49:26 +02:00
Owen Leibman 9c43d5f1b7 Xlsx Writer Formula with Bool Result of False
Fix for #2082. Xlsx Writer was writing a cell which is a formula which evaluates to boolean false as an empty XML tag. This is okay for Excel 365, but not for Excel 2016-. Change to write the tag as a value of 0 instead, which works for all Excel releases. Add test.
2021-05-11 13:48:38 +02:00
xandros15 bb11378fca #984 fix php-cs-fixer warnings 2021-05-11 12:44:40 +02:00
MarkBaker e5bfc3c899 Add phpcs version compatibility check to pipeline 2021-05-10 22:55:32 +02:00
Owen Leibman 9fed8d87f6 Two Problems with Sample19
19_NamedRange.php was not changed to use absolute addressing when that was introduced to Named Ranges. Consequently, the output from this sample has been wrong ever since, for both Xls and Xlsx.

There was an additional problem with Xls. It appears that the Xls Writer Parser does not parse multiple concatenations using the ampersand operator correctly. So, `=B1+" "+B2` was parsed as `=B1+" "`. I believe that this is due to ampersand being treated as a condition rather than an operator; `A1>A2>A3` isn't valid, but `A1&A2&A3` is. My original PR (#1992, which I will now close) only partially resolved this, but I think moving ampersand handling from `condition` to `expression` is fully successful.

There are already more than ample tests for Named Ranges, so I did not add a new one for that purpose. However, I did add a new test for the Xls parser problem.
2021-05-09 15:41:36 -07:00
MarkBaker a0719d8dd4 Use modification time from properties when saving Excel5 2021-05-09 21:03:23 +02:00
MarkBaker 2ddb23574e PHPCS Fix 2021-05-08 22:50:36 +02:00
MarkBaker 9a5a630e3f Check against font attributes 2021-05-08 22:50:36 +02:00
MarkBaker bb572f757f Should fix phpstan 2021-05-08 22:50:36 +02:00
MarkBaker 60e6a59ff2 Additional refactoring 2021-05-08 22:50:36 +02:00
MarkBaker 13ec163333 phpstan appeasement 2021-05-08 22:50:36 +02:00
MarkBaker 5d6b072fb0 More Minor tweaks 2021-05-08 22:50:36 +02:00
MarkBaker e71c2e46d0 Minor style tweaks 2021-05-08 22:50:36 +02:00
MarkBaker 351804335c Refactor Gnumeric Style Reader into a separate dedicated class 2021-05-08 22:50:36 +02:00
Mark Baker d2e6db71fa
Lookup functions additional unit tests (#2074)
* Additional unit tests for VLOOKUP() and HLOOKUP()
* Additional unit tests for CHOOSE()
* Unit tests for HYPERLINK() function
* Fix CHOOSE() test for spillage
2021-05-07 23:40:30 +02:00
Nathan Dench f28eea7341 Use named regex groups and constants for regex strings 2021-05-07 14:34:05 +02:00
Nathan Dench df01db58ad Remove complexity from AddressHelper::convertToR1C1 2021-05-07 14:34:05 +02:00
Nathan Dench a96109d89b Update CHANGELOG.md with R1C1 conversion change 2021-05-07 14:34:05 +02:00
Nathan Dench 76ac008911 R1C1 conversion should handle absolute A1 references 2021-05-07 14:34:05 +02:00
Mark Baker 72a36a5bb8
Resolve issue with conditional font size set to zero in PHP8 (#2073)
* Let's see if the tests now pass against PHP8; output file looks to be good
* Font can't be both superscript and subscript at the same time, so we use if/else rather than if/if
2021-05-07 12:53:59 +02:00
Mark Baker 115e39ae0c
Issue 2066, highlighting more validation needed for LookupRef Functions (#2069)
* Issue 2066, highlighting more validation needed for LookupRef Functions
* Additional test cases
2021-05-07 11:20:38 +02:00
Mark Baker 5ee4fbf090
Implement basic autofilter ranges with Gnumeric Reader (#2057)
* Load basic autofilter ranges with Gnumeric Reader
* Handle null values passed to row height/column with/merged cells/autofilters
2021-05-04 22:32:12 +02:00
oleibman 4be9366722
Gnumeric Better Namespace Handling (#2022)
* Gnumeric Better Namespace Handling

There have been a number of issues concerning the handling of legitimate but unexpected namespace prefixes in Xlsx spreadsheets created by software other than Excel and PhpSpreadsheet/PhpExcel.I have studied them, but, till now, have not had a good idea on how to act on them. A recent comment https://github.com/PHPOffice/PhpSpreadsheet/issues/860#issuecomment-824926224 in issue #860 by @IMSoP has triggered an idea about how to proceed.

Although the issues exclusively concern Xlsx format, I am starting out by dealing with Gnumeric. It is simpler and smaller than Xlsx, and, more important, already has a test for an unexpected prefix, since, at some point, it changed its generic prefix from gmr to gnm. I added support and a test for that some time ago, but almost certainly not in the best possible manner. The code as changed for this PR seems simpler and less kludgey, both for that exceptional case as well as for normal handling.

My hope is that this change can be a template for similar Reader changes for Xml, Ods, and, especially, Xlsx.

All grandfathered Phpstan issues with Gnumeric are fixed and eliminated from baseline as part of this change.

* Namespace Handling using XMLReader

Adopt a suggestion from @IMSoP affecting listWorkSheetInfo, which uses XMLReader rather than SimpleXML for its processing.

* Update GnumericLoadTest.php

PR #2024 was pushed last night, causing a Phpstan problem with this member.

* Update Gnumeric.php

Suggestions from Mark Baker - strict equality test, more descriptive variable names.
2021-05-04 21:41:11 +02:00
xandros15 d0f76fd3ba #984 change to force typing in condition 2021-05-04 11:41:55 +02:00
Mark Baker 5873116488
Unit testing for row/column/worksheet visibility for Xls and Xlsx files (#2059)
* Unit testing for row/column/worksheet visibility for Xls and Xlsx files
* Include very hidden in worksheet visibility tests
2021-05-03 23:46:40 +02:00
Mark Baker 2b268c8dd9
Fix row visibility in XLS Writer (#2058)
* Fix reversed visibility in Xls Writer
2021-05-03 22:21:57 +02:00
xandros15 2b72c7e912 #984 fix Scrutinizer warnings 2021-05-03 18:52:15 +02:00
oleibman 346bad1b1d
Fix for Issue 2042 (SUM Partially Broken) (#2045)
As issue #2042 documents, SUM behaves differently with invalid strings depending on whether they come from a cell or are used as literals in the formula. SUM is not alone in this regard; COUNTA is another function within this behavior, and the solution to this one is modeled on COUNTA. New tests are added for SUM, and the resulting tests are duplicated to confirm correct behavior for both cells and literals.

Samples 16 (CSV), 17 (Html), and 21 (PDF) were adversely affected by this problem. 17 and 21 were immediately fixed, but 16 had another problem - Excel was not interpreting the UTF8 currency symbols correctly, even though the file was saved with a BOM. After some experimenting, it appears that the `sep=;` line generated by setExcelCompatibility(true) causes Excel to mis-handle the file. This seems like a bug - there is apparently no way to save a UTF-8 CSV with non-ASCII characters which specifies a non-standard separator which Excel will open correctly. I don't know if this is a recent change or if it is just the case that nobody noticed this problem till now. So, I changed Sample 16 to use setUseBom rather than setExcelCompatibility, which solved its problem. I then added new tests for setExcelCompatibility, with documentation of this problem.
2021-05-03 18:31:01 +02:00
Mark Baker fd14da1675
Ods defined names unit tests (#2054)
* Defined names/formulae in ODS are prefixed by $$ when used in a formula; so we need to strip this out to fully convert them to an Excel formula

* Test for ODS Writer for DefinedNames
2021-05-03 08:39:42 +02:00
xandros15 a757692992 #984 add support notContainsText for conditional styles in xlsx reader 2021-05-02 22:09:38 +02:00
Mark Baker 83e55cffcc
First steps in the implementation of AutoFilters for ODS Reader and Writer (#2053)
* First steps in the implementation of AutoFilters for ODS Reader and Writer, starting with reading a basic AutoFilter range (ignoring row visibility, filter types and active filters for the moment).

And also some additional refactoring to extract the DefinedNames Reader into its own dedicated class as a part of overall code improvement... on the principle of "when working on a class, always try to leave the library codebase in a better state than you found it"

* Provide a basic Ods Writer implementation for AutoFilters
* AutoFilter Reader Test
* AutoFilter Writer Test
* Update Change Log
2021-05-02 22:00:48 +02:00
xandros15 759c192a44 #984 fix phpcs warnings 2021-05-02 20:56:25 +02:00
oleibman defef9a4ff
Merge pull request #1934 from tiagomalheiro/issues/axis-options
Fix #1933. Swapped chart axis options
2021-04-30 15:27:32 -07:00
oleibman 0a56a9cfc6
Merge branch 'master' into issues/axis-options 2021-04-30 15:03:57 -07:00
Mark Baker d555b5d312
Pattern Fill style should default to 'solid' if there is a pattern fill with colour but no style (#2050)
* Pattern Fill style should default to 'solid' if there is a pattern fill style for a conditional; though may need to check if there are defined fg/bg colours as well; and only set a fill style if there are defined colurs
2021-04-30 20:05:45 +02:00
xandros15 0b0215514a #984 update changelog 2021-04-30 15:30:43 +02:00
xandros15 815dabae89 #984 add support notContainsText for conditional styles in xlsx 2021-04-30 15:22:07 +02:00
oleibman cc5c0205d5
Fix for Issue 2029 (Invalid Cell Coordinate A-1) (#2032)
* Fix for Issue 2029 (Invalid Cell Coordinate A-1)

Fix for #2021. When Html Reader encounters an embedded table, it tries to shift it up a row. It obviously should not attempt to shift it above row 1. @danmodini reported the problem, and suggests the correct solution. This PR implements that and adds a test case.

Performing some additional testing, I found that Html Reader cannot handle inline column width or row height set in points rather than pixels (and HTML writer with useInlineCss generates these values in points). It also doesn't handle border style when the border width (which it ignores) is omitted. Fixed and added tests.
2021-04-29 22:59:01 +02:00
Mark Baker e4973fa041
Start work on refactoring the last of the Excel Statistical functions (#2033)
* Refactoring the last of the Excel Statistical functions
2021-04-29 14:34:50 +02:00
Mark Baker 160ae59751
Resolve problem where underscore placeholder in a number format masks (#2038)
* Resolve problem where underscore placeholder in a number format mask was being replaced, but leaving the sizing character as part of the mask
2021-04-29 14:15:45 +02:00
Owen Leibman 6c9c8db267 Mpdf Caching
Mpdf caches font data in a temporary directory. When running the test suite, it uses different directories for samples vs. normal tests. One is sufficient. This will slightly reduce disk usage and overhead when running test suite.
2021-04-29 00:10:22 -07:00
Mark Baker 475874bed3
Initial implementation of the URLENCODE() web function (#2031)
* Initial implementation of the URLENCODE() web function
2021-04-28 17:10:36 +02:00