Commit Graph

4836 Commits

Author SHA1 Message Date
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 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 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
oleibman fcca8ac3cf Merge pull request #4123 from oleibman/csfixer20240801
Php-cs-fixer Enforcing New Rules
2024-08-01 18:18:33 +00:00
oleibman bbf9d15cb2 Php-cs-fixer Enforcing New Rules
The latest release seems to not want you to give a class element both a Php type and a doc-block type. I used the "fix" operand to delete the redundant doc-block declarations, with no other changes. So there should be no change to executable code.
2024-08-01 10:54:54 -07:00
oleibman 850685426e Better Handling of legacyDrawing Xml
Fix issue #4105. Passing through form controls from load to save was part of the limited support added with PR #3130. However, the legacyDrawing vml, which is a crucial piece of that change, often contains a description only of notes (comments) with no form control contents. Since legacyDrawing is constructed by Xlsx Writer when it doesn't already exist, Xlsx Reader should not interfere with that ability - it should save the contents of legacyDrawing only when it appears to not consist merely of note descriptions.

It should also be an option to delete the legacyDrawing vml before saving. This allows one to add comments, at the cost of losing form controls. A method `deleteLegacyDrawing` is added to Spreadsheet to permit this.
2024-08-01 08:04:34 -07:00
oleibman 85629b77a0 More Extreme Cases 2024-07-31 12:47:19 -07:00
oleibman 768dd75ba1 Merge branch 'master' into atsign 2024-07-30 22:51:13 -07:00
oleibman 3b150557ad Merge pull request #4120 from oleibman/changelog300again
Prepare Changelog for 3.0
2024-07-31 05:39:02 +00:00