Commit Graph

3960 Commits

Author SHA1 Message Date
Mark Baker 014a120b4e Merge pull request #3394 from PHPOffice/NumberFormat_decimal-placing-with-question-mark
Improved handling for ? placeholder in Number Format Masks
2023-02-22 20:41:40 +01:00
MarkBaker acdcb0b0a2 Refactoring and simplification of replacement code 2023-02-22 20:14:47 +01:00
MarkBaker f468e78b66 Improved handling for ? placeholder in Number Format Masks 2023-02-22 12:55:21 +01:00
Mark Baker 4cefd7a889 Merge pull request #3388 from PHPOffice/NumberFormat_Scaling-Unit-Tests
Additional unit tests for scaling values in Number Format Masks
2023-02-21 13:40:07 +01:00
MarkBaker e812b49bb6 Additional unit tests for scaling values in Number Format Masks 2023-02-21 13:20:23 +01:00
Mark Baker 3102822341 Merge pull request #3387 from PHPOffice/NumberFormat_Additional-Tests
Fix handling for a # symbol in quotes inside a number format mask
2023-02-21 04:00:39 +01:00
MarkBaker 5cf4e2cca1 Fix handling for a # symbol in quotes inside a number format mask 2023-02-21 03:17:08 +01:00
oleibman ac1172810e Another Xls Coverage Change (#3385)
I hadn't noticed some minor corruption in a file. It is fixed. Xls now supports BAHTTEXT as _xlfn.BAHTTEXT, not as an index to a list of built-in functions, so it is no longer suitable for this test and is removed from the spreadsheet. TRANSPOSE changes, e.g. A1:B2 to {1,2;3,4}, and the Xls Writer Parser has trouble with that, so its test is also removed from the test spreadsheet.
2023-02-20 12:15:22 -08:00
Mark Baker 41c1b348ed Merge pull request #3386 from PHPOffice/NumberFormatMask-Tweak
Adjust regexp for an explicit 0 for a decimals value when using Currency and Accounting locale masks
2023-02-20 20:41:22 +01:00
MarkBaker c70de6b660 Adjust regexp for an explicit 0 for a decimals value when using Currency and Accounting Number Format Wizards with a locale, to require at least one digit after a dot to ensure this is a decimal and not a text literal 2023-02-20 20:16:55 +01:00
Mark Baker de01e59ad0 Merge pull request #3384 from PHPOffice/NumberFormat-Wizards_Currency-Accounting-zero-decimals
Explicit 0 for a decimals value when using Currency and Accounting NumberFormat Wizards with a locale
2023-02-20 19:56:10 +01:00
MarkBaker 207d029c26 Allow use of an explicit 0 for a decimals value when using Currency and Accounting Number Format Wizards with a locale, to indicate whole currency units only, no minor units 2023-02-20 18:34:59 +01:00
oleibman 33eefe7c9d Resolve Phpstan Messages - FINALE - Shared/OLE (#3364)
* Resolve Phpstan Messages - FINALE - Shared/OLE

Reduce number of Phpstan messages by addressing their issues. This is the last of a series of related tickets to achieve that end. Only a handful of messages will be left in Phpstan baseline after this change is merged.

Shared/Ole.php and Shared/Ole/ChainedBlockStream.php were completely uncovered in the test suite. So I wrote some tests and found they didn't work at all. There were 2 problems. The first was that ChainedBlockStream checks for a mode of `r`, but Ole invokes it with mode `rb`. ChainedBlockStream will now just check the first character of the mode.

The second was a more interesting problem. Ole was reading "an *unsigned* long". However, what it should have been reading was "a 32-bit *signed* long". The irony of this mismatch is that, once the mode problem was corrected, 32-bit Php handled Ole and ChainedBlockStream correctly, but 64-bit Php did not. The code is corrected to work properly for both 32- and 64-bit.

* Scrutinizer

2 dead assignments - sufficient to just make calls which are expected to fail.
2023-02-20 06:40:02 -08:00
oleibman 28fb962cdb Complete Functions Coverage for Xls (except GETPIVOTDATA) (#3383)
Finish the work started in PR #3371 and PR #3340.
2023-02-20 06:07:12 -08:00
Mark Baker 15e1451b3d Merge pull request #3382 from PHPOffice/Issue-3381_Scientific-NumberFormat-Decimal-Precision
Issue 3381 - Fix decimal precision for Scientific Number Format Mask
2023-02-20 13:26:06 +01:00
MarkBaker c0b60fcb76 Issue 3381 - Fix decimal precision for Scientific Number Format Mask 2023-02-20 12:20:49 +01:00
Mark Baker 169a87a752 Merge pull request #3379 from PHPOffice/Issue-3378_Improve-NumberFormat-Mask-Date-Identifier
Adjust identifier for Date Format Masking to prevent it picking out c…
2023-02-18 21:13:08 +01:00
Mark Baker 5b105debdf Merge branch 'master' into Issue-3378_Improve-NumberFormat-Mask-Date-Identifier 2023-02-18 20:59:08 +01:00
MarkBaker 431bd5178e Adjust identifier for Date Format Masking to prevent it picking out currencies with locales containing the letters h, m, s, d and y as dates 2023-02-18 17:46:23 +01:00
oleibman 1f94687f1c Resolve Phpstan Messages - Writer Xls Worksheet (#3363)
Reduce number of Phpstan messages by addressing their issues.
2023-02-18 07:44:26 -08:00
Mark Baker 3beef1f559 Merge pull request #3377 from PHPOffice/AdvancedValueBinder_Additional-Minor-Tweaks
Adjust CURRENCY_USD and CURRENCY_EUR constants
2023-02-18 02:04:01 +01:00
MarkBaker 292dd9073f Adjust CURRENCY_USD and CURRENCY_EUR constants to rationalise and eliminate quoted currency symbols in favour of bracketed symbols 2023-02-18 01:39:29 +01:00
Mark Baker a241792b35 Merge pull request #3376 from PHPOffice/AdvancedValueBinder-Localisation
Advanced value binder localisation and Improvements
2023-02-17 13:58:02 +01:00
MarkBaker 22aa65d802 Additional unit tests 2023-02-17 13:31:45 +01:00
MarkBaker f9ef1e0e7d Additional unit tests 2023-02-17 13:29:21 +01:00
MarkBaker 6ca7ec5d5b Make boolean check case-insensitive 2023-02-17 13:14:20 +01:00
MarkBaker 5072ffb23a Improve support for locale settings and currency identification in the Advanced Value Binder 2023-02-17 12:37:18 +01:00
Mark Baker d49bc40573 Merge pull request #3374 from PHPOffice/CalcEngine_Formatted-Number-Localisation
Improve support for locale settings in the Calculation Engine formatted number matcher
2023-02-17 08:16:58 +01:00
MarkBaker 3d7964f568 Improve support for locale settings in the Calculation Engine formatted number matcher 2023-02-17 08:03:28 +01:00
Mark Baker d029042429 Merge pull request #3373 from PHPOffice/CalcEngine_Formatted-Currency-Expand-Currency-Range
Allow a range of different potential currency codes in the currency matcher regexp
2023-02-17 06:43:42 +01:00
Mark Baker 3dd486208b Merge branch 'master' into CalcEngine_Formatted-Currency-Expand-Currency-Range 2023-02-17 06:37:44 +01:00
MarkBaker 4aaf1f61b9 Allow a range of different potential currency codes (including the locale code) in the currency matcher regexp
(dollar, euro, pound sterling and yen)
2023-02-17 06:16:10 +01:00
oleibman 9e1378d806 Resolve Phpstan Messages - Statistical/Trend and Shared/Trend (#3362)
* Resolve Phpstan Messages - Statistical/Trend and Shared/Trend

Reduce number of Phpstan messages by addressing their issues. The changes in this PR are all to doc blocks; no executable code is changed.

* Scrutinizer

1 mystifying "new" error (matches "old" error), 2 updated doc blocks.
2023-02-16 19:18:02 -08:00
oleibman df9e0da514 Additional Functions Coverage for Reader Xls (#3371)
PR #3340 increased coverage in Reader Xls for most functions. Some of the omissions from that PR (see below) were intended from the start. However, the set of (BINOMDIST, EXPONDIST, GAMMADIST, NORMDIST, POISSON, WEIBULL, and FIXED) were not intended to be omitted; they just did not seem to work. Having had time to research, it appears that the problem is not those functions themselves, but rather the use of Boolean constants as function arguments (see issue #3369). Knowing that, it is possible to add those missing functions back in, just taking care to use `0` or `1` or `TRUE()` or `FALSE()` rather than boolean constants as arguments. No update to source or test code; just adding a few new cells to an Xls spreadsheet.

Functions still omitted because they return array results:
- GROWTH
- LINEST
- LOGEST
- MINVERSE
- MMULT
- TRANSPOSE
- TREND

Functions still omitted because they are not implemented in PhpSpreadsheet:
- BAHTTEXT
- CELL
- FREQUENCY
- GETPIVOTDATA
2023-02-15 22:21:15 -08:00
oleibman 8df86e4236 Add Tests for Shared XmlWriter (#3365)
Fill in some very minor coverage gaps.
2023-02-14 21:38:06 -08:00
Mark Baker 5405eafcec Merge pull request #3361 from PHPOffice/Cell-SetValue-Binder-Override
Allow override of the Value Binder when setting a Cell value
2023-02-14 10:28:59 +01:00
MarkBaker b40e131b78 Allow override of the Value Binder when setting a Cell value 2023-02-14 10:13:35 +01:00
oleibman c95a8b7aa5 Update Change Log (#3360)
Catch up.
2023-02-11 23:24:49 -08:00
Mark Baker ff5087c536 Merge pull request #3358 from PHPOffice/Issue-3356_AutoFit-for-Table-AutoFilter
Allow for Table AutoFilter dropdown icon for AutoFit column sizing
2023-02-12 03:01:48 +01:00
Mark Baker 1bcb86c450 Merge branch 'master' into Issue-3356_AutoFit-for-Table-AutoFilter 2023-02-12 02:42:27 +01:00
MarkBaker 35347e7228 Update Change Log 2023-02-12 02:38:45 +01:00
MarkBaker afa64508cc Unit Tests for AutoSizing columns 2023-02-12 02:29:02 +01:00
oleibman 545fc89d8f Resolve Phpstan Messages Reader/Xls Shared/Escher (#3355)
* Resolve Phpstan Messages Reader/Xls Shared/Escher

Reduce number of Phpstan messages by addressing their issues.

* Scrutinizer

Hyperactivity.

* More Scrutinizer

Getting close.

* Even More Scrutinizer

Closer and closer.
2023-02-11 17:21:19 -08:00
MarkBaker 6b1538f9f0 Let column width calculation return a float 2023-02-11 21:23:22 +01:00
oleibman 4e09fd407d Permit Max Column for Row Breaks (#3345)
* Permit Max Column for Row Breaks

Fix #3143. Page break was dropped. Difference between good and bad was the use of attribute `max` in `brk` tag in the good spreadsheet. However, `max` was *not* required in a similar spreadsheet. So the reason for the problem isn't completely explained. Nevertheless, it can't really hurt to capture the `max` value on read (if present) and generate it on write. This resolves the issue. User is also permitted to specify max column when setting a row break programatically. I am not yet in position to document when that might be a good idea.

* Case-sensitive Directory Name

Not a problem on my Windows system.

* Update Documentation and Add Tests

Change is necessitated by probable Excel bug.

* Unhappy With Initial Implementation

I kind of shoe-horned it in. Better to create a new PageBreak class, which will make it easier to accomodate any future surprises about page break handling. The only difficulty with the new approach is making sure getBreaks maintains backwards compatibility. New tests will ensure that.
2023-02-11 07:44:14 -08:00
MarkBaker 57424102f1 When a Worksheet has an AutoFilter, then we make allowance for the AutoFilter dropdown icon in the filter heading when calculating AutoFit column widths.
Because a Table can also have its own AutoFilter, we now have to allow for that possibility as well when calculating column width for AutoFit columns
2023-02-10 23:30:06 +01:00
oleibman b1c754f04b Correct Some Scrutinizer Messages (#3354)
They have crept in recently.
2023-02-09 23:12:22 -08:00
Mark Baker cc3ae628ae Merge pull request #3357 from PHPOffice/Style-NumberFormat_Additional-Fraction-Tests
Additional Unit Tests for Fraction Number Format Mask
2023-02-09 18:21:57 +01:00
MarkBaker a6083e7a64 Additional Unit Tests 2023-02-09 18:03:17 +01:00
MarkBaker 3e74e56207 Update Change Log 2023-02-09 12:42:07 +01:00