Commit Graph

2048 Commits

Author SHA1 Message Date
Adrien Crivelli 09ab584a23
Merge tag '1.9.0'
1.9.0

### Added

- When <br> appears in a table cell, set the cell to wrap [#1071](https://github.com/PHPOffice/PhpSpreadsheet/issues/1071) and [#1070](https://github.com/PHPOffice/PhpSpreadsheet/pull/1070)
- Add MAXIFS, MINIFS, COUNTIFS and Remove MINIF, MAXIF [#1056](https://github.com/PHPOffice/PhpSpreadsheet/issues/1056)
- HLookup needs an ordered list even if range_lookup is set to false [#1055](https://github.com/PHPOffice/PhpSpreadsheet/issues/1055) and [#1076](https://github.com/PHPOffice/PhpSpreadsheet/pull/1076)
- Improve performance of IF function calls via ranch pruning to avoid resolution of every branches [#844](https://github.com/PHPOffice/PhpSpreadsheet/pull/844)
- MATCH function supports `*?~` Excel functionality, when match_type=0 [#1116](https://github.com/PHPOffice/PhpSpreadsheet/issues/1116)
- Allow HTML Reader to accept HTML as a string [#1136](https://github.com/PHPOffice/PhpSpreadsheet/pull/1136)

### Fixed

- Fix to AVERAGEIF() function when called with a third argument
- Eliminate duplicate fill none style entries [#1066](https://github.com/PHPOffice/PhpSpreadsheet/issues/1066)
- Fix number format masks containing literal (non-decimal point) dots [#1079](https://github.com/PHPOffice/PhpSpreadsheet/issues/1079)
- Fix number format masks containing named colours that were being misinterpreted as date formats; and add support for masks that fully replace the value with a full text string [#1009](https://github.com/PHPOffice/PhpSpreadsheet/issues/1009)
- Stricter-typed comparison testing in COUNTIF() and COUNTIFS() evaluation [#1046](https://github.com/PHPOffice/PhpSpreadsheet/issues/1046)
- COUPNUM should not return zero when settlement is in the last period [#1020](https://github.com/PHPOffice/PhpSpreadsheet/issues/1020) and [#1021](https://github.com/PHPOffice/PhpSpreadsheet/pull/1021)
- Fix handling of named ranges referencing sheets with spaces or "!" in their title
- Cover `getSheetByName()` with tests for name with quote and spaces [#739](https://github.com/PHPOffice/PhpSpreadsheet/issues/739)
- Best effort to support invalid colspan values in HTML reader - [#878](https://github.com/PHPOffice/PhpSpreadsheet/pull/878)
- Fixes incorrect rows deletion [#868](https://github.com/PHPOffice/PhpSpreadsheet/issues/868)
- MATCH function fix (value search by type, stop search when match_type=-1 and unordered element encountered) [#1116](https://github.com/PHPOffice/PhpSpreadsheet/issues/1116)
- Fix `getCalculatedValue()` error with more than two INDIRECT [#1115](https://github.com/PHPOffice/PhpSpreadsheet/pull/1115)
- Writer\Html did not hide columns [#985](https://github.com/PHPOffice/PhpSpreadsheet/pull/985)
2019-08-17 15:27:37 -07:00
Adrien Crivelli 8dea03eaf6
1.9.0 2019-08-17 15:24:35 -07:00
Claudio Galdiolo 74bc0b826d reword repeated text 2019-08-17 13:49:27 -07:00
Adrien Crivelli 05081c4acf
Standardize changelog to the simplest format 2019-08-17 13:31:40 -07:00
Andrey Dovbyshko ed25365531
Fix Writer\Html did not hide columns
Closes #985
2019-08-17 13:26:28 -07:00
yunjusu bbbfdb86a0
Fix `getCalculatedValue()` error with more than two INDIRECT
Closes #1115
2019-08-17 12:59:30 -07:00
Nathanael Noblet 95c8bb9918
Allow HTML Reader to load from string
We often want to export a table as an excel sheet. The system renders the
html and it seems like a waste of time to write it to the file system to
use the reader. This allows us to render the html and then just pass it to
a reader

Closes #1136
2019-08-17 12:54:22 -07:00
Adrien Crivelli 34675bdf5d
Remove dead code 2019-08-12 10:04:40 -07:00
Rolands Usāns 9df68f12e2 MATCH function fix
- fix boolean search
- add support for excel expressions `*?~`

Fixes #1116
Closes #1122
2019-08-11 20:11:36 -07:00
Adrien Crivelli 2166458de3
Duplicated call of strtoupper 2019-08-11 19:41:10 -07:00
Adrien Crivelli 7cca8d2bae Consistent format name and value 2019-08-11 19:39:49 -07:00
rumbleh 1e1118d9e0 Update NumberFormat.php
Fix FORMAT_DATE_DDMMYYYY from 'dd/mm/yy' to 'dd/mm/yyyy'
2019-08-11 19:39:49 -07:00
Alex Pravdin 5fe0a796c7
Fix incorrect cache clearance on row deletion
Fixes #868
Closes #871
2019-08-11 18:36:07 -07:00
Fräntz Miccoli 0b387e767e
Branch pruning around IF function calls to avoid resolution of every branches
Calculation engine was resolving every function by first resolving its arguments
including IFs, this was causing significant over evaluation when IFs were used
as it meant for every case to be evaluated.

Introduce elements to identify ifs and enable better branch resolution
(pruning). We tag parsed tokens to associate a branch identifier to them.

Closes #844
2019-08-11 18:23:47 -07:00
Mahmoud Abdo 785705b712
Best effort to support invalid colspan values in HTML reader
Closes #878
2019-07-27 23:31:23 -07:00
Christian WERNER d6b3514431
Cover `getSheetByName()` with tests for name with quote and spaces
Fixes #739
Closes #893
2019-07-27 22:46:41 -07:00
Mark Baker 26e87c45ae
Test refactoring (#1112)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Argument fix

* Text Test functions refactored into individual test files

* Codestyle (line at eof)

* docblocks
2019-07-27 14:28:16 +02:00
Mark Baker 1c6f0b8a9d
Improved tests (#1110)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* New statistical tests

* Sniffs

* Additional statistical function unit tests

* Additional statistical function unit tests

* Fix case-sensitivity

* Fix HARMEAN code logic

* Unit tests refactored into individual files for all logical functions
Implemented IFNA()

* Fix silly typo

* NOT needs ...args to allow for test when no argument passed

* Codestyle

* Use instance asserts
2019-07-26 22:21:17 +02:00
Mark Baker aaf996a165
Refactor engineering tests (#1106)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Bessels, and set some date tests to defined/named arguments

* Fix test class naming

* Names arguments for math/trig tests

* Docblock updates

* More engineering function unit test refactorings

* More engineering function unit test refactorings. This time, moving on to the Complex engineering functions

* Fix ImConjugate test

* Fix parseComplex test

* Fix parseComplex test

* More of the complex number function unit tests refactored

* Finish refactoring of the complex number function unit tests

* Newer phpunit assertions

* Add parsecomplex unit test back until we're ready to drop the deprecated function; but as it doesn't use the specified data provider at all, drop reference to that
2019-07-25 21:02:41 +02:00
Adrien Crivelli fa54ca79a3
Migrate away from deprecated PHPUnit asserts 2019-07-25 10:15:53 -07:00
Adrien Crivelli b2070fd181
Upgrade to phpunit 7.5 2019-07-24 23:45:43 -07:00
Adrien Crivelli 7faee3d6cc
Take advantage of PHP 7.1 syntax 2019-07-24 23:43:28 -07:00
Adrien Crivelli 454d942c13
Drop PHP 5.6 and 7.0
This is according to our formal, published, policy to only support
eol PHP after 6 months.

See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
2019-07-24 23:12:45 -07:00
JeongHean Kim dbc8777c43 Fix failed stat when using setEmbedImagesin HTML writer
Fixes #1084 
Closes #1085
2019-07-24 23:00:23 -07:00
Andrey Bolonin 8a1cb04830 Test PHP 7.4snapshot
For now allow failure for PHP 7.4 because it's not released yet
2019-07-24 22:17:55 -07:00
Dominik Businger 98a1f0a8cf
Fix for worksheet lookup for worksheets with spaces in the title
Sheet titles containing " " or "!" will be quoted in formulas. This commit
fixes the lookup of sheets with this kind of title by trimming the quotes
during the lookup.

Without this any defined range referencing a sheet with " " or "!" in the title
name will be lost when reading the workbook from file.

Fixes #928
Closes 930
2019-07-24 22:15:35 -07:00
Cody Snider f6f1ef2893 remove uneccessary C# files 2019-07-24 21:59:56 -07:00
Mark Baker 342ffb629b
Refactoring of math trig tests (#1102)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* First pass at moving MathTrig tests into individual test files

* Appeasement to the great goddess PHPCS

* Appeasement to the great goddess PHPCS

* Minor scrutinizer issue resolved

* More refactoring of tests into individual test files fr each math/trig function

* More work on the math/trig test refactoring, plus a bit of tidyup of date/time tests as well

* Fix test

* Fix docblock in test

* Finish refactoring Math/Trig tests into separate files

* Fix SubTotal Test

* Import additional classes for SubTotal test
2019-07-23 00:50:30 +02:00
Mark Baker 9ad6de620e
Refactoring of date time tests (#1101)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Separate out date/time tests into individual tests

* Need to update the version of phpunit at some point to deal with the new assertions and deprecated assertions

* Appease the CS Gods

* More refactoring of Date/Time tests

* Replace self assertions with instance assertions (looking forward to upgrading phpunit)

* Finish refactoring of date/time tests as individual tests

* Test for DateTimeInterface rather than for DateTime

* A few strict comparisons

* Fix to test names
2019-07-21 20:55:41 +02:00
Mark Baker ba2b74c222
Statistics functions extended tests (#1099)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Further statistical tests

* Additional BINOMDIST tests
Extract boolean and string checking for Average and Count functions into separate methods

* Appease the great god PHPCS

* Yet more appeasement of the great god PHPCS

* Beginning to get really cheesed off with PHPCS, pulling me up over full stops in comments... I want to see this completed before going to bed; but it's nearly half past one in the morning, and phpcs has been pulling me up over trivialities for the past f***ing hour

* And a spurious line

* Further work on statistical tests
2019-07-21 13:07:18 +02:00
Mark Baker 554684720d
Statistical issues (#1098)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Adjusted logic for COUNT() function to handle differences in EXCEL, GNUMERIC and OPENOFFICE modes for cells and for literal values

* Fix case-sensitivity in filenames

* Appeasing Codesniffer

* Resolve COUNTA() differences between cell values and literals

* Style fixes

* Start refactoring statistical function tests into individual tests rather than having a single, giant test for all statistical functions.... first step toward doing this for all tests

* More refactoring into separate tests
If all functions have their own individual test files, it should be a lot easier to identify which functions aren't covered by tests yet

* Missing last lines in files
2019-07-20 18:40:05 +02:00
Mark Baker a367f35438
Trend function unit tests (#1089)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* More trend function unit tests

* Yet more trend function unit tests
2019-07-16 23:51:48 +02:00
Mark Baker 6d739f1fe6
Additional statistical work (#1088)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* More statistical tests

* Further statistical tests

* Unit tests for some of the trend functions

* resolve scrutiniser objections

* Fix order of @return types :-(
2019-07-16 20:35:48 +02:00
Mark Baker f1e82a212f
Extended unit tests (#1087)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Additional unit tests for average functions, and fix to AVERAGEIF() function if third argument is passed

* Update change log

* Stricter typed comparisons in AVERAGEIF() conditions

* Unit tests for BETADIST() and BETAINV()
2019-07-16 16:18:42 +02:00
Mark Baker 5f7ed98aa6
Prevent duplicate no fills (#1086)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Ignore colours for hash generation when fill style in NONE

* Update changelog
2019-07-16 11:00:00 +02:00
Mark Baker 987147e916
Number formatting further refactoring (#1082)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* further refactoring of number formatting logic
2019-07-15 23:51:04 +02:00
Mark Baker 20f36ccd79
Number formatting minor refactoring (#1081)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Handle literal (non-decimal) dots in complex number format masks

* Minor refactoring nd reformatting

* Appease CS

* Update changelog
2019-07-15 22:05:59 +02:00
Mark Baker ab1c6e53b6
Number format with colours (#1080)
* Fix number formatting using named colours in format masks

* Handle number formatting with ful substitution of values by a string

* Update changelog
2019-07-14 19:36:34 +02:00
Mark Baker a91acec5d9
Countif strict comparison (#1078)
* Stricter-typed comparison testing in COUNTIF() and COUNTIFS() evaluation [Issue #1046](https://github.com/PHPOffice/PhpSpreadsheet/issues/1046)

* Codestyle

* Codestyle

* Codestyle in tests
2019-07-14 16:22:31 +02:00
MarkBaker 36135a4c05 Use empty to check for empty array 2019-07-14 13:36:23 +02:00
MarkBaker 6500128451 Update calculation functions implemented lists 2019-07-14 13:12:43 +02:00
Juluan 7505638dc8 Fix 1055 (#1076)
* Fix #1055 : Make hlookup require ordered list only if asking for not exact match

* Added test for #1055
2019-07-14 12:56:17 +02:00
Zdeněk Drahoš 42fc71f314 Calculation/Statistical :: Add MAXIFS, MINIFS, COUNTIFS and Remove MINIF, MAXIF (#1059)
* #1056 - replace invalid minif/maxif functions by not implemented minifs/maxifs

minif/maxif is not support in Excel, Google Spreadsheets, Libreoffice
https://support.office.com/en-us/article/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188#bm13

* #1056 - implement minifs/maxifs

Copy-pasted sumifs...
https://github.com/PHPOffice/PhpSpreadsheet/blob/1.8.1/src/PhpSpreadsheet/Calculation/MathTrig.php#L1254

* #1056 - implement countifs

* #1056 - fix code style

composer check
composer fix

* #1056 - update changelog
2019-07-14 12:55:42 +02:00
Mr Maker 22190615ce When <br> appears in a table cell, set the cell to wrap. (#1070)
* When <br> appears in a table cell, set the cell to wrap.

If the cell is not set to wrap, it appears as a single line when first
displayed in Excel, although editing the cell will cause Excel to wrap
it.

* fix whitespace

Upstream has a coding standard that includes whitespace
2019-07-12 07:53:07 +02:00
Mark Baker bf59cf0cbc
Html cellwrapping (#1075)
* When <br> appears in a table cell, set the cell to wrap.

If the cell is not set to wrap, it appears as a single line when first
displayed in Excel, although editing the cell will cause Excel to wrap
it.

* fix whitespace

Upstream has a coding standard that includes whitespace

* Add Unit tests for cell wrapping

* Update changelog
2019-07-12 07:52:03 +02:00
Mark Baker de3f948b27
Coupnum fix (#1069)
* New Unit Tests for COUPNUM()

* COUPNUM should not return zero when settlement is in the last period

* Additional tests and fixes for COUPNCD() and COUPPCD() functions

* Additional tests and fixes for COUPNCD() and COUPPCD() functions
2019-07-10 22:41:28 +02:00
Mark Baker 0ea97f14e1
Fixes to coupon functions (#1068)
* New Unit Tests for COUPNUM()

* COUPNUM should not return zero when settlement is in the last period

* Additional tests and fixes for COUPNCD() and COUPPCD() functions
2019-07-10 21:22:16 +02:00
MarkBaker 38e71a1210 Fix Documentation type 2019-07-09 19:39:12 +02:00
MarkBaker 0c1346a195 Update changelog with fixes implemented in 1.8.2 release 2019-07-08 23:21:25 +02:00
Mark Baker 094933164d
Ods reader fix for property reader when none set (#1064)
* Fix for Ods Property Reader when no core properties are defined

* Fix for Ods Property Reader when no meta properties are defined
2019-07-08 22:35:08 +02:00