Commit Graph

3403 Commits

Author SHA1 Message Date
MarkBaker 0861370c4d Update change log 2020-12-10 18:13:12 +01:00
oleibman 497a934374
Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742)
* Fix for 3 Issues Involving ReadXlsx and NamedRange

Issues #1686 and #1723, which provide sample spreadsheets, are probably
solved by this ticket. Issue #1730 is also probably solved, but I have
no way to verify.

There are two problems with how PhpSpreadsheet is handling things now.
Although the first problem is much less severe, and isn't really a factor
in the issues named above, it is helpful to get it out of the way first.
If you define a named range in Excel, and then delete the sheet where
the range exists, Excel saves the range as #REF!. If there is a cell which
references the range, it will similarly have the value #REF! when you open
the Excel file.
Currently, PhpSpreadsheet discards the #REF! definition, so a cell which
references the range will appear as #NAME? rather than #REF!.
This PR changes the behavior so that PhpSpreadsheet retains the #REF!
definition, and cells which reference it will appear as #REF!.

The second problem is the more severe, and is, I believe, responsible
for the 3 issues identified above.
If you define a named range and the sheet on which the range is defined
does not exist at the time, Excel will save the range as something like:

'[1]Unknown Sheet'!$A$1

If a cell references such a range, Excel will again display #REF!.
PhpSpreadsheet currently throws an Exception when it encounters
such a definition while reading the file. This PR changes
the behavior so that PhpSpreadsheet saves the definition as #REF!,
and cells which reference it will behave similarly.

For the record, I will note that Excel does not magically recalculate when a
missing sheet is subsequently added, despite the fact that the reference
might now become resolvable. PhpSpreadsheet behaves likewise.

* Remove Dead Code in Test

Identified it after push but before merge.
2020-12-10 18:08:10 +01:00
MarkBaker ff04c8502a Update change log 2020-12-10 18:05:44 +01:00
oleibman ce7863570a
Fix for 1735 (Incorrect activeSheetIndex after RemoveSheetByIndex) (#1743)
This is a fix for issue #1735.
It adds tests for this situation, and similar situations involving
adding new sheets and accessing existing ones.
Coverage for Spreadsheet.php increases from 69% to 75% as a result.
2020-12-10 18:01:08 +01:00
Adrien Crivelli baa9c452e5
Merge pull request #1745 from rhynodesigns/patch-1
Spelling: Tou -> You
2020-12-09 16:48:30 +09:00
Ryan McAllen 7247e3b5ac
Spelling: Tou -> You 2020-12-07 10:17:56 -05:00
Adrien Crivelli 40abd18fe0
Merge pull request #1734 from oleibman/morecoverage
Improve Coverage in src/PhpSpreadsheet
2020-12-02 09:46:22 +09:00
Owen Leibman 6b4feb6142 Changes for Scrutinizer
Two changes to fix minor problems reported by Scrutinizer.
2020-11-27 07:16:23 -08:00
Owen Leibman 1a0aab1a4f Improve Coverage in src/PhpSpreadsheet
There are no changes to code. Additional tests are added,
so that the following 6 items now have 100% test coverage:
- Comment
- DefinedName
- DocumentGenerator
- IOFactory
- NamedFormula
- NamedRange
2020-11-27 06:50:01 -08:00
Adrien Crivelli ba1ce8b8ec
Automatic GitHub releases from git tags 2020-11-26 12:44:07 +09:00
Adrien Crivelli bd05c590e3
Drop Travis 2020-11-26 11:10:52 +09:00
MarkBaker 02e88971e8 Update todocumentation 2020-11-19 16:45:01 +01:00
MarkBaker bd0462bcfc Work on renaming method arguments for the Readers and Writers 2020-11-19 16:41:52 +01:00
MarkBaker 0acc8ff822 Merge branch 'master' into PHP8-Sane-Property-Names 2020-11-19 13:27:12 +01:00
Mark Baker 0ed5b800be
Resolve XSS Vulnerability in the HTML Writer (#1719)
Resolve XSS Vulnerability in the HTML Writer
2020-11-19 11:59:57 +01:00
MarkBaker 97f82c83de Type-hinting fixes 2020-11-16 21:45:05 +01:00
MarkBaker 29e0a8a6e8 Revert 2020-11-16 21:09:21 +01:00
MarkBaker 575ff5509c Cell row should be an int 2020-11-16 21:03:39 +01:00
MarkBaker 1626f5931b Scrutinizer fixes 2020-11-16 20:19:19 +01:00
MarkBaker d311603c6b Typecasting fixes 2020-11-16 19:48:32 +01:00
MarkBaker d6f2180fa0 Keep scrutinizer happy 2020-11-16 18:14:38 +01:00
MarkBaker 6bf24d8aac See if we can sort out scrutinizer's issue with the hash map 2020-11-16 17:34:44 +01:00
MarkBaker 3ad919575d See if we can sort out scrutinizer's issue with the hash map 2020-11-16 14:45:37 +01:00
MarkBaker 30482890c0 Merge branch 'master' into PHP8-Sane-Property-Names 2020-11-11 15:41:08 +01:00
oleibman 6fe653179f
Make DefinedNames Samples Consistent With Other Samples (#1707)
All other Samples write to temporary directory. DefinedNames samples
write to main directory, which (a) means they aren't stored with others,
and (b) they aren't ignored by git so look like changed files.
The tests are also simplified by requiring Header rather than Bootstrap,
making use of Helper.
2020-11-11 11:02:04 +01:00
MarkBaker 6e497a5fd6 Lets try some more modern annotations for index key/value typing 2020-11-07 20:14:32 +01:00
MarkBaker 34d15b80de Lets try some moew modern annotations for index key/value typing 2020-11-07 17:41:58 +01:00
MarkBaker 3f3a3174b5 Scrutinizer tweaks 2020-11-06 19:48:32 +01:00
MarkBaker d558e2ba99 Datatype fix 2020-11-05 21:20:33 +01:00
MarkBaker 86728cb214 Sane argument names for Styles 2020-11-05 20:04:35 +01:00
MarkBaker 317965078d Fix a couple of phpcs issues 2020-11-05 19:29:55 +01:00
MarkBaker cf6abbc10e Sane argument names in the various classes 2020-11-05 19:15:01 +01:00
MarkBaker b12cebe1f5 Sane argument names in the Chart classes 2020-11-03 20:43:42 +01:00
MarkBaker b5c2709002 Sane argument names in the Cell classes 2020-11-03 19:28:45 +01:00
MarkBaker 4ab629ff82 Sane argument names in the Reference Helper, Settings and Spreadsheet classes 2020-11-03 18:04:45 +01:00
MarkBaker af3918cac8 Sane argument names in the Reference Helper, Settings and Spreadsheet classes 2020-11-03 17:45:12 +01:00
MarkBaker 7e4248d67f Sane argument names in the IO Factory 2020-11-03 11:06:12 +01:00
MarkBaker 06f7d3c8bd Size validator for comment dimensions and margins 2020-11-02 23:48:57 +01:00
MarkBaker a16badbcc4 Size validator for comment dimensions and margins 2020-11-02 22:18:33 +01:00
MarkBaker 0502fd3e7f Size validator for comment dimensions and margins 2020-11-02 21:24:27 +01:00
MarkBaker 93fe84da71 Additional unit tests 2020-11-02 20:14:44 +01:00
MarkBaker 3a960d62a6 Remember return typehints for unit tests 2020-11-02 15:16:40 +01:00
MarkBaker 5e4288958c Additional unit tests for comments 2020-11-02 14:55:28 +01:00
oleibman cca43f0b5b
Merge pull request #4 from PHPOffice/master
Sync with Base
2020-11-01 18:02:37 -08:00
MarkBaker b75551f0eb Adjustment for border style 2020-11-01 21:11:20 +01:00
MarkBaker f27e074756 Merge branch 'master' into PHP8-Sane-Property-Names
# Conflicts:
#	src/PhpSpreadsheet/Style/Alignment.php
#	src/PhpSpreadsheet/Style/Color.php
2020-11-01 14:42:30 +01:00
MarkBaker dc5a5670a0 Style fixes 2020-11-01 14:32:38 +01:00
MarkBaker 4107783e27 Additional unit tests for Style Color 2020-11-01 14:23:11 +01:00
MarkBaker 414c5217b8 Adjust colour validation calls 2020-11-01 12:12:28 +01:00
MarkBaker 613a0b96ae Adjust colour validation calls 2020-11-01 12:09:51 +01:00