Commit Graph

4842 Commits

Author SHA1 Message Date
oleibman 352eaae3ee Php 8.4 Will Deprecate fgetcsv Parameter
As described in issue #4161, Php seems to be prepared to break the fgetcsv function in release 9, marking the existing usage deprecated in 8.4. This gives us a long-term problem. This PR provides a short-term solution.
2024-09-06 01:11:34 -07:00
oleibman e1dae99a70 Merge pull request #4141 from oleibman/svbignoreerrors2
String Value Binder Allow Setting "Ignore Number Stored As Text"
2024-08-24 23:46:49 +00:00
oleibman 176c2c8a89 Update CHANGELOG.md 2024-08-24 16:43:59 -07:00
oleibman 9c2c976b4e Merge pull request #4139 from oleibman/pr1321
Xlsx Reader Default Cell Type
2024-08-24 23:14:41 +00:00
oleibman 47ee4da91e Merge branch 'master' into pr1321 2024-08-24 16:10:45 -07:00
oleibman aecb0b674b Update CHANGELOG.md 2024-08-23 23:56:20 -07:00
oleibman e27ccc8cea Better Handling of Stringable Objects 2024-08-20 07:58:10 -07:00
oleibman 00d23c7157 Merge pull request #4140 from oleibman/pr607
Xls Reader Some Ranges Not Handled Properly
2024-08-19 20:53:19 +00:00
oleibman 259db50132 Merge branch 'master' into pr607 2024-08-19 13:50:05 -07:00
oleibman 4a1839df78 Update CHANGELOG.md 2024-08-19 13:47:28 -07:00
oleibman f9837aa4b7 Merge pull request #4127 from oleibman/issue4125
Currency and Accounting Formats
2024-08-14 15:15:38 +00:00
oleibman cddf61c6ed Update CHANGELOG.md 2024-08-14 08:11:42 -07:00
oleibman 958c8c95d2 Merge branch 'master' into pr1321 2024-08-13 17:38:12 -07:00
oleibman 29c0f217d7 Merge pull request #4122 from oleibman/issue4105
Better Handling of legacyDrawing Xml
2024-08-13 22:15:54 +00:00
oleibman 362cdaf71a Update CHANGELOG.md 2024-08-13 15:13:10 -07:00
oleibman 0152f57e44 String Value Binder Allow Setting "Ignore Number Stored As Text"
When String Value Binder converts a numeric value to text, the resulting spreadsheet will be full of little green triangles to indicate to the end user that something might be wrong. It is unlikely that a spreadsheet created in this manner needs that visual clutter. This PR adds a property and setter (I can't really think of a good use case for a getter) to suppress it. Suppression should arguably be the default, but, for now, I will avoid any BC problems by leaving non-suppression as the default.
2024-08-13 14:36:45 -07:00
oleibman 30384ac043 Xls Reader Some Ranges Not Handled Properly
This supersedes PR #607 by @christian-forgacs, who deserves all the credit for reporting the problem and devising the solution. The PR went stale in 2018, and it is just easier to resubmit a clean version rather than clean up the old one. Among the suggestions in the PR was that you should try to create a spreadsheet from scratch to demonstrate the problem rather than supply one. However, my attempts to match the failing spreadsheet do not have a problem when they are read. So, a supplied spreadsheet it is.

Fix #1570. No sample spreadsheet was supplied with that issue, but I am almost certain that this is another example of the same problem. I am removing the stale label from that issue; it will be closed properly when this PR is merged.
2024-08-13 14:27:42 -07:00
oleibman a377f44463 Xlsx Reader Default Cell Type
Suggested by PR #1321 from @rtek, which was marked stale in March 2020. If the xml for a cell does not specify a type, PhpSpreadsheet has been using string; however, Excel uses numeric. PhpSpreadsheet will be changed to do the same as Excel. In theory, this is a BC break; in practice, it is doubtful that anyone will be adversely affected. No changes in the existing unit tests were required. The new test from rtek does demonstrate the change in behavior; however, the new behavior is certainly what a user would expect to happen. Unlike the original PR, this one is restricted to Xlsx Reader; I do not believe that any logic change is needed for Writer. (N.B. - changing Writer to use class constants rather than literals is a good idea, but, with no other logic change in this version, it seems risky - I may do that as separate PR.)
2024-08-13 14:10:22 -07:00
oleibman bc0460d9b3 Merge pull request #4138 from murongshaozong/master
chore: remove repetitive words
2024-08-13 16:40:05 +00:00
murongshaozong ef34a8680a chore: remove repetitive words
Signed-off-by: murongshaozong <netease163@icloud.com>
2024-08-13 15:05:26 +08:00
oleibman 17e894e21b Merge branch 'master' into issue4125 2024-08-12 09:11:58 -07:00
oleibman 85d5fd919c Merge branch 'master' into issue4105 2024-08-12 09:11:35 -07:00
oleibman f7c183b8ed Merge pull request #4137 from oleibman/fixertest
Php-cs-fixer Increase Timeout, Replace Deprecated Properties
2024-08-12 15:28:44 +00:00
oleibman b843d4e313 Merge branch 'master' into fixertest 2024-08-12 08:25:48 -07:00
oleibman b1d43ee3a3 Remove Some Commented Out Lines 2024-08-12 08:09:37 -07:00
oleibman 9bc51a18c1 Forgot One Change 2024-08-12 08:06:06 -07:00
oleibman 3e56c2da9a Php-cs-fixer Increase Timeout, Replace Deprecated Properties
I am becoming concerned with the increasing run-time of php-cs-fixer, especially since it can time out. Some relief may come from PR #4118, but that won't be merged for some time, if ever. So, bump up the timeout period now. Also replace properties which php-cs-fixer has deprecated with their non-deprecated equivalents. No change to any source code.
2024-08-12 08:01:34 -07:00
oleibman 6a8eda9f9e Merge pull request #3962 from oleibman/atsign
Excel Dynamic Arrays (Avoid Adding At-Signs to Formulas)
2024-08-12 12:48:08 +00:00
oleibman 5e248cf12d Better Workaround for Versions "Error"
PHPCompatibility (versions check) erroneously flags the use of $this in enumerations. They fixed it in their development branch in October 2022. But they haven't had a release since 2019!
2024-08-11 08:24:27 -07:00
oleibman 56ecfa2b2a Work Around PHPCompatibility Bug 2024-08-11 02:23:23 -07:00
oleibman 05847dc293 Use enum for Negative Formats 2024-08-11 00:23:57 -07:00
oleibman fdbf3334fd Update CHANGELOG.md 2024-08-10 00:46:13 -07:00
oleibman 823cb2d4d5 Merge branch 'master' into atsign 2024-08-09 22:34:54 -07:00
oleibman 9d5c676d8f Minor Improvement 2024-08-08 09:24:12 -07:00
oleibman ffbcee6806 Merge pull request #4132 from oleibman/issue4128
Worksheet applyStylesFromArray Retain Active Cell
2.2.2
2024-08-08 02:31:26 +00:00
oleibman 905d93f60d Update CHANGELOG.md 2024-08-07 19:23:00 -07:00
oleibman 9450bc1acb Merge branch 'master' into issue4128 2024-08-07 11:31:01 -07:00
oleibman 23cb107e76 Retain activeCell 2024-08-07 08:43:47 -07:00
oleibman 4500f5a87d Worksheet applyStylesFromArray Retain Active Cell
Fix #4128. PR #4073 introduced applyStylesFromArray method, which allowed setting styles without affecting selectedCells or activeSheet. The first use of this method was in Cell setValueExplicit to set quotePrefix appropriately. The new method did not preserve activeCell. I'm not sure why that should matter, but this seems to have caused a problem for Excel 2016. This seems to be a bug in Excel, one which is fixed in newer releases. However, PhpSpreadsheet can avoid the problem by preserving activeCell as well as selectedCells and activeSheet. This PR makes that change.
2024-08-07 08:12:47 -07:00
oleibman 6153b30581 More Robust Test 2024-08-06 22:10:03 -07:00
oleibman ee1d4d0367 Currency and Accounting Formats
Fix #4125. Currency and Accounting Wizards generate styles for ISO codes, but these are incorrect and cause a problem when Excel tries to open a spreadsheet containing these styles. Debugging that problem, other problems with Wizards came to light:
- Currency Wizard should permit four different styles for negative numbers (as Excel does) - minus sign, minus sign and red font, paretheses, and parenthese and red font. It currently uses only minus sign.
- Accounting Wizard should use parentheses for negative numbers (as Excel does). It currently uses minus sign.
- Accounting Wizard should always use SYMBOL_WITH_SPACING (as Excel does). It currently permits the use of SYMBOL_WITHOUT_SPACING. What WITH_SPACING really does is to ensure decimal-point alignment among adjacent cells in a column with the same format.
- Currency Wizard should always use SYMBOL_WITHOUT_SPACING (as Excel does). It currently permits the use of SYMBOL_WITH_SPACING.

I am correcting these problems by:
- renaming Currency Wizard to CurrencyBase
- adding a `negative` property with setter to it and its constructor.
- adding a new Currency which extends CurrencyBase, always using SYMBOL_WITHOUT_SPACING when formatting.
- having Accounting extend CurrencyBase rather than Currency, always using SYMBOL_WITH_SPACING and NEGATIVE_PARENS when formatting.
- CurrencyBase can be used if the restrictions on Currency and Accounting are not desired (e.g. the suggested accounting constant from [this unimplemented PR](https://github.com/PHPOffice/PhpSpreadsheet/pull/1576)).

Excel does some funny stuff with these formats. In particular, it might try to guess if you have a particular Accounting format in mind. So the Accounting wizard for dollar sign generates a format which (a) matches FORMAT_ACCOUNTING_USD, and (b) Excel (correctly) interprets as an Accounting format for symbol $. On the other hand, the Accounting wizard for euro sign generates a format which (a) matches FORMAT_ACCOUNTING_EUR, but (b) Excel interprets as a custom code rather than an Accounting format. This in itself is not a particularly big deal, but it has made it impossible for me to see exactly what format Excel uses for trailing currency symbols for negative numbers. I can't get them to decimal-point align with positive numbers if I put any kind of space between the trailing parenthesis and the currency symbol, so I omit that. It doesn't look terrible, and it keeps everything aligned, but it might not be what people are used to.

I've also changed the formatting to use spaces rather than non-breaking spaces. They seem to work just fine, and the constants mentioned above use them rather than nbsp.

Fix #4124. Currency formats that contain an ISO currency code which contains one of the characters used to recognize a date format (hmsdy), e.g. [$HUF], are being formatted by PhpSpreadsheet as dates rather than currencies. Code is changed to recognize open bracket followed by dollar sign followed by 3 Latin alphabetic characters followed by close bracket as a non-date.
2024-08-05 18:36:06 -07:00
oleibman e5e6bde299 Update Changelog and Docs Prior to Merge Next Week
This will, I hope, be my last change prior to merge on August 7. PR is fully synced with master (except for this change), and, except for an emergency, I do not intend to merge anything else before this.
2024-08-02 10:48:13 -07:00
oleibman f3ae0bd944 Merge branch 'master' into atsign 2024-08-02 09:01:06 -07:00
oleibman 1c77e00499 Merge pull request #4115 from oleibman/issue4113
New Algorithm for TRUNC, ROUNDUP, and ROUNDDOWN
2024-08-02 15:45:44 +00:00
oleibman b1e5e326ac Merge branch 'master' into issue4113 2024-08-02 08:42:52 -07:00
oleibman 2734dfd8d2 Update CHANGELOG.md 2024-08-02 08:41:48 -07:00
oleibman 4da01c3084 Merge pull request #4111 from oleibman/issue4108
Parameter Name Change Xlsx Writer Workbook
2024-08-01 21:10:16 +00:00
oleibman 3e5f1fec40 Merge branch 'master' into issue4108 2024-08-01 14:07:12 -07:00
oleibman a157e3fe7f Update CHANGELOG.md 2024-08-01 14:04:20 -07:00
oleibman 0ddaff3a21 Update Workbook.php 2024-08-01 11:59:28 -07:00