Commit Graph

180 Commits

Author SHA1 Message Date
Jens Hassler 55209424b2 support "showZeros" setting in Excel advanced worksheet options (#1199)
* support "showZeros" setting in Excel advanced worksheet options

* add changelog entry

* change isShowZeros to getShowZeros
2019-10-28 21:52:30 +01:00
David Arenas 89066d2568 Bugfix/remove column out of range (#1197)
* Call garbage collector after removing a column

Otherwise callers of getHighestColumn get stale values

* Update changelog

* Fix remove a column out of range removes the last column

Given:
+---+---+
| A | B |
+---+---+
Attempting to remove 'D', should not alter the worksheet

* Avoid side effects when trying to remove more columns than exists
2019-10-28 18:52:06 +01:00
David Arenas b82afe37dc Bugfix/invalid cached highest column after column removed (#1195)
* Call garbage collector after removing a column

Otherwise callers of getHighestColumn get stale values

* Update changelog
2019-10-28 18:42:56 +01:00
Adrien Crivelli ee5134a954
Merge branch 'master' into Further-Test-Refactoring 2019-09-20 16:04:36 -07:00
Adrien Crivelli a972943ac5
Mention PHP version change in changelog 2019-08-24 12:42:22 -07:00
Adrien Crivelli 48ccdc2716
Prepare for next version 2019-08-17 15:28:41 -07:00
Adrien Crivelli 8dea03eaf6
1.9.0 2019-08-17 15:24:35 -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
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
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
MarkBaker 905a697639 More work on refactoring Excel Calculation Function Unit Tests 2019-07-27 16:02:58 +02: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
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 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 6500128451 Update calculation functions implemented lists 2019-07-14 13:12:43 +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
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 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 0c1346a195 Update changelog with fixes implemented in 1.8.2 release 2019-07-08 23:21:25 +02:00
MarkBaker 352c7002fe Allow nullable theme for Xlsx Style Reader class 2019-07-01 22:46:51 +02:00
Mark Baker 0e6238c69e
CVE-2019-12331 (#1041)
* Detect doubly-encoded xml to hide XXE attacks
Correct use of LibXml_Disable_Entity_Loader

* New test for double-encoded xml in security scanner
2019-07-01 00:55:25 +02:00
MarkBaker 9ba96efc97 Still test against 5.6, but with allowed failures, and skip tests explicitly for features that require PHP >= 7.0.0 2019-05-30 12:11:49 +02:00
MarkBaker fc78cd5422 Minimum PHP 7.0 and updated travis 2019-05-30 11:59:01 +02:00
Aleksandr Borovikov 53ac682ba7 Fix #956: Incorrectly handled backslash-escaped space characters within number formats (#957)
Backslash-escaped space characted sometimes not converted to quoted strings, so formatted string contains extra slashes.
2019-05-30 11:37:48 +02:00
MarkBaker c783c3443e Updates to changelog 2019-05-30 10:06:05 +02:00
MarkBaker fd7d19f90b Updates to changelog 2019-05-30 10:05:37 +02:00
Harry Gulliford 0b3deeaac5 Add accounting number format style (#974) 2019-05-30 09:18:03 +02:00
Fräntz Miccoli 9a208b31d8
Fix a SUMIF warning when having different length of arrays provided as input
Closes #873
2019-05-26 20:58:00 +12:00
Adrien Crivelli 27255ce808
Whitelist `tsv` extension when opening CSV files
Fixes #429
2019-05-26 20:07:01 +12:00
Adrien Crivelli 84e09df798
1.7.0 2019-05-26 14:50:36 +12:00
phinor 98d1782bbb Xls(x) Readers now respect the readBlankCells setting. (#835)
* Prevented reading of blank cells.

The "readEmptyCells" attribute is ignored when reading spreadsheets, resulting in memory bloat.

* Included a test file for Unit Testing

A file that contains 100 referenced cells, one of which contains data.

* New test file for reading in empty cells

* Added test for reading in a blank cell

* Updated CHANGELOG

* Changed "s to 's

Change required for code style compliance

* Further Code Style Changes

Removed spaces after variable, before array indices.

* Further Code Style Changes

* Further Code Style Changes

Removed additional spaces.

* Updated reader and tests.
2019-04-15 21:40:20 +02:00
Michael Roth 15abdf43ad - Create unit test (#944)
- Add changelog entry for issue #700
2019-04-15 21:39:11 +02:00
Fräntz Miccoli ccebf0f288 Fix VLOOKUP whose return was impacted by order for a $not_exact_match (#854)
* Highlight VLOOKUP bug with a new test

* Remove useless statements + fix VLOOKUP bug

Please not that we have still inconsistencies in Excel (See LOOKUP and
VLOOKUP.php test files)

* Base strtolower on our StringHelper in LookupRef
2019-04-15 21:37:23 +02:00
MrCue 25c7187727 Fix return type hint (#947) 2019-04-15 21:33:07 +02:00
Fräntz Miccoli 8b589c4ef3 Fix MATCH an error was appearing when comparing strings against 0 (always true) + making a return statement a bit more explicit (#855) 2019-03-06 22:37:06 +01:00
Mark Baker 9b004b1e6a
Ignore escaped enclosures within an enclosure when inferring csv separator (#906) 2019-02-25 23:20:50 +01:00
Mark Baker 033ed16db5
Dde call safe handling (#891)
* Set handler for quoted text cells and DDE expressions in the Calculation engine
2019-02-18 22:56:32 +01:00
Patrick Brouwers 1c99f4999c [Feature] Html reader improvements (#884)
* Extract character set, so we can convert to UTF-8 if required

* Set column width and row height when defined on tr/td

* Parse align and valign on td

* Specify number format of cell via html attribute

* Formatting of b, strong, i and em tags

* Inserting image in cell when using img tag in html

* Add applying inline styles: border, fonts, alignment, dimensions

* Add tests for applying inline styles
2019-02-16 23:11:16 +01:00
Adrien Crivelli bf00f0cc5f
1.6.0 2019-01-02 15:42:54 +11:00
Adrien Crivelli 0e8fde9be6
`master` is the new default branch
`master` is now the only permanent branch. Features and fixes should be merged
into `master` when stable. Pull requests should be forked from `master`.

`develop` branch disappear entirely in favor of temporary features/fixes branches.
2019-01-02 15:28:38 +11:00
Adrien Crivelli 3b0c686630
Fix iconv unsupported `//IGNORE//TRANSLIT` on IBM i
Fixes #791
2019-01-02 14:23:34 +11:00