Commit Graph

2378 Commits

Author SHA1 Message Date
Guillaume RODRIGUEZ fdc224af7c
Fix print area parser for XLSX reader
XLSX workbook references may not contains quotes in print area

Fixes #733
Fixes #734
2018-10-28 14:37:05 +11:00
Laurent 79d86ef5cc
Csv reader avoid notice when the file is empty
Fixes #337
2018-10-28 14:16:53 +11:00
Adrien Crivelli 4e8e0dc01b
Fix Countable Int (bis) 2018-10-28 14:06:50 +11:00
Jean-Baptiste Noblot 6088f545b6 Add declaration of undefined variable 2018-10-28 14:03:24 +11:00
Jean-Baptiste Noblot 58268fe9b5 Fix Countable Int 2018-10-28 14:03:24 +11:00
Jon Dufresne 5b3870c508
Prefer https:// URLs when available in docs & comments
Fixes #737
2018-10-28 13:55:00 +11:00
marcusblevin 98d10475f2
SUMIFS sum values only once
Values were summed multiple times if it matched several conditions
whereas it should only be summed once.

Fixes #704
Fixes #710
2018-10-28 13:09:08 +11:00
Sreten Ilić ed6a3a0148
Support numeric condition in SUMIF, SUMIFS, AVERAGEIF, COUNTIF, MAXIF and MINIF
Fixes #683
Fixes #701
2018-10-28 12:47:53 +11:00
MarkBaker 90bb4df777 Tweaks to composer to support version compatibility check and credit Adrien in the authors list (long overdue) 2018-10-21 14:56:23 +02:00
Adrien Crivelli 2dfd06c598
1.5.0 2018-10-21 21:04:54 +11:00
Jon Dufresne f5c800c360 Correct typo: "they are" -> "there are" (#725) 2018-10-21 18:28:39 +11:00
Paul Barton 813855b2b2
Fix CSV delimiter detection on line breaks
The CSV Reader can now correctly ignore line breaks inside
enclosures which allows it to determine the delimiter
correctly.

Fixes #716
Fixes #717
2018-10-21 18:23:55 +11:00
Adrien Crivelli 54efe8824e
Fix unit tests 2018-10-21 17:55:31 +11:00
Adrien Crivelli 09eb05f367
OFFSET should allow omitted height and width
Commit 8dddf56 inadvertently removed the ability to omit the width
and height arguments to the OFFSET function. And #REF! is returned
because the function is validating that the new $pCell argument
is present. It is present, but it has been passed in the $height position.

We fixed this by always passing $pCell at the last position and filling
missing arguments with NULL values.

Fixes #561
Fixes #565
2018-10-21 17:45:02 +11:00
Adrien Crivelli 7b362bd9de
Move PHP-CS-Fixer cache file out of the project to avoid IDE annoyance 2018-10-21 15:34:33 +11:00
Biser Antonov 2c981e47a1
Added the DAYS() function
https://support.office.com/en-us/article/days-function-57740535-d549-4395-8728-0f07bff0b9df
2018-10-21 15:26:46 +11:00
MarkBaker a1e8c843b7 Moved codestyle, coverage and API documentation checks to PHP run against 7.2 2018-10-14 17:39:08 +01:00
MarkBaker 0ef1b55106 Need to version compare against PHP 7.2.99 for PHP 7.3.0 release candidates 2018-10-14 16:35:38 +01:00
MarkBaker 874467d7c1 DomPDF doesn't yet support PHP 7.3.0, so suppress tests for that combination of version and library dependency 2018-10-14 16:21:40 +01:00
MarkBaker 467c9664a8 Add PHP 7.3 to travis checks 2018-10-14 14:20:18 +01:00
Adrien Crivelli 925205ed59
Remove exception that can never happen
Because of type hinting in the constructor the spreadsheet object
can never be null anymore.
2018-10-08 10:50:54 +11:00
Adrien Crivelli edc608782f
Avoid warning on PHP 7.3 2018-10-07 20:28:04 +11:00
Adrien Crivelli f25d8b72c0
Move changelog entry under unreleased 2018-10-07 18:50:31 +11:00
bayzhanov 08b4456641
Xls file threw exception during open by Xls reader
Ignore some exception in property, if stream is empty

Fixes #402
Fixes #659
2018-10-07 18:49:01 +11:00
Scorty ae9dd13aa0 Skip non numeric value in SUMIF
MS Excel skip non numeric values also. PhpSpreadsheet used to fail on string value with: Warning: A non-numeric value encountered.

Fixes  #618
2018-10-07 17:24:23 +11:00
Adrien Crivelli 5e5be142f6
Fix incorrect docblock 2018-10-05 11:18:21 +10:00
Adrien Crivelli 1e5be30290
Remove dead code 2018-10-05 11:08:51 +10:00
Timur 50a9bc83ab Sheet title can contain exclamation mark (in formulas)
When extracting sheet title from string reference (like `"Work!sheet1!A1"`), PHP function `explode()` divide this string into three parts: `['Work', 'sheet1', 'A1']`. And then these wrong values are used in formulas, ranges, etc.

This change fix that problem by using special function `Worksheet::extractSheetTitle()`. This function also has been changed to make sure that worksheet title can contain "!" character. So, that function search last position of "!" in reference string and divide it to 2 parts correctly: `['Work!sheet1', 'A1']`.

Fixes #325
Fixes #662
2018-10-03 12:52:51 +09:00
Adrien Crivelli 57404f4374
1.4.1 2018-09-30 12:57:24 +09:00
Roland Eigelsreiter 9022c39dd8 fixes for continue inside switch statement (#660)
This a bugfix for php 7.3 related errors where using continue inside a switch raises a PHP warning. Either use continue 2 or break. Previously continue behaves like break but the intended usage is to continue the for loop instead.
2018-09-30 01:11:24 +09:00
Derek Bonner 01501b6ff2 Remove locale from format string to prevent formatting error (#644)
When a formatting string has a locale in it an error can occur when outputting. For example when the format string with a locale such as `[$-1010409]#,##0.00;-#,##0.00` appears, a value of 9.98 comes back as $9.98. This is because at https://github.com/PHPOffice/PhpSpreadsheet/blob/1.4.0/src/PhpSpreadsheet/Style/NumberFormat.php#L711 the numberFormat regex will match to the zeros inside the locale ([$-1010409]). Attempts to adjust the numberFormat regex caused regressions in other tests. Adding another step to filter out the locale caused no regression.
2018-09-28 21:28:40 +09:00
jalgaba 9fa8a02fe3 Fix broken sample links on windows due to $baseDir having backslash (#653) 2018-09-28 21:25:50 +09:00
Phil Taylor a98d885830 Typo (#652)
environnement = environment
2018-09-28 20:57:30 +09:00
AegirLeet bebfb1e41a Fix warning when reading xlsx without styles
Fixes https://github.com/PHPOffice/PHPExcel/issues/1134
Fixes #631
2018-08-19 15:43:54 +09:00
Davis Devasia 62f4b7c8cf Change the tcpdf composer suggestion (#628)
The previous address tecnick.com/tcpdf shows a warning that it is abandoned.
The correct address tencickcom/tcpdf
2018-08-19 15:22:21 +09:00
Dalibor Karlović 5e090d1af0
Allow iterators to go out of bounds with prev()
Iterators prev() behavior is now consistent with next(), meaning
that it can go out of bounds and it must be validated with valid()
before using it.

Fixes #587
Fixes #627
2018-08-19 14:02:17 +09:00
Adrien Crivelli 125f462a71
1.4.0 2018-08-06 11:58:06 +09:00
Adrien Crivelli b0004cdabf
Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
Julian Kern c04b92198e
Column dimensions are read by Reader\Xlsx
Fixes #596
Fixes #616
2018-08-06 10:33:27 +09:00
Adrien Crivelli 98c55b0f88
Migrator only replaced "PHPExcel" 2018-08-05 23:03:04 +09:00
Daniel 46eabbad60
Rowspans/colspans were incorrect when adding worksheet using loadIntoExisting
Rowspans/colspans are now respected for each HTML document added to an existing
spreadsheet as a new worksheet. The protected $rowspan class property should
be emptied on each call to `loadIntoExisting`.

Fixes #619
Fixes #620
2018-08-05 13:41:06 +09:00
Andrew Siegman adf95bcc0e
Migration tool keep variables containing $PHPExcel untouched
Fixes #598
Fixes #609
2018-08-05 13:27:55 +09:00
Walter Nasich 048947e390
Avoid memory exhaustion when cloning worksheet with a drawing
When cloning `BaseDrawing`, its worksheet will be set as null and thus be
orphaned. But when cloning the worksheet, it will re-assign itself as the
new worksheet for the BaseDrawing.

That way we avoid recursive cloning of a Worksheet that would clone a
BaseDrawing that would clone a Worksheet etc.

Fixes #437
Fixes #613
2018-08-05 13:21:01 +09:00
Mark Baker 1b96c95a44
Add new Complex Number Functions introduced in MS Excel 2013 (#601)
* - Refactored Complex Engineering Functions to use external complex number library
- Added calculation engine support for the new complex number functions that were added in MS Excel 2013
    - IMCOSH()  Returns the hyperbolic cosine of a complex number
    - IMCOT()   Returns the cotangent of a complex number
    - IMCSC()   Returns the cosecant of a complex number
    - IMCSCH()  Returns the hyperbolic cosecant of a complex number
    - IMSEC()   Returns the secant of a complex number
    - IMSECH()  Returns the hyperbolic secant of a complex number
    - IMSINH()  Returns the hyperbolic sine of a complex number
    - IMTAN()   Returns the tangent of a complex number
* Simplified the parseComplex() method in the PhpOffice\PhpSpreadsheet\Calculation\Engineering class, using Complex\Complex; and docblock flagged as deprecated
2018-07-25 14:38:44 +01:00
Adrien Crivelli 57a0297011
HTML entities should not be escaped in Markdown 2018-07-24 10:13:58 +09:00
Mark Baker 67cdee6033
Add new Bitwise Functions introduced in MS Excel 2013 (#603)
* - Added calculation engine support for the new bitwise functions that were added in MS Excel 2013
  - BITAND()     Returns a Bitwise 'And' of two numbers
  - BITOR()      Returns a Bitwise 'Or' of two number
  - BITXOR()     Returns a Bitwise 'Exclusive Or' of two numbers
  - BITLSHIFT()  Returns a number shifted left by a specified number of bits
  - BITRSHIFT()  Returns a number shifted right by a specified number of bits
2018-07-22 22:16:34 +01:00
Mark Baker 9b44cf3418
Add further new Functions introduced in MS Excel 2013 and 2016 (#608)
- Fix ISFORMULA() function to work with a cell reference to another worksheet
 - Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016
   - Text Functions
     - CONCAT()     Synonym for CONCATENATE()
     - NUMBERVALUE()  Converts text to a number, in a locale-independent way
     - UNICHAR()    Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
     - UNIORD()     Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
     - TEXTJOIN()   Joins together two or more text strings, separated by a delimiter
   - Logical Functions
     - XOR()        Returns a logical Exclusive Or of all arguments
   - Date/Time Functions
     - ISOWEEKNUM()  Returns the ISO 8601 week number of the year for a given date
   - Lookup and Reference Functions
     - FORMULATEXT()  Returns a formula as a string
   - Engineering Functions
     - ERF.PRECISE()   Returns the error function integrated between 0 and a supplied limit
     - ERFC.PRECISE()  Synonym for ERFC
   - Math and Trig Functions
     - SEC()          Returns the secant of an angle
     - SECH()         Returns the hyperbolic secant of an angle
     - CSC()          Returns the cosecant of an angle
     - CSCH()         Returns the hyperbolic cosecant of an angle
     - COT()          Returns the cotangent of an angle
     - COTH()         Returns the hyperbolic cotangent of an angle
     - ACOT()         Returns the cotangent of an angle
     - ACOTH()        Returns the hyperbolic cotangent of an angle
  - Financial Functions
    - PDURATION()    Calculates the number of periods required for an investment to reach a specified value
    - RRI()          Calculates the interest rate required for an investment to grow to a specified future value
2018-07-22 19:17:04 +01:00
Adrien Crivelli 3028c60656
Remove unnecessary docs 2018-07-15 13:23:46 +09:00
Adrien Crivelli 863fb86925
Remove file header 2018-07-15 13:23:23 +09:00
yuzhakov 17d4a54666
Read and write hyperlink for drawing image
Fixes #490
2018-07-15 13:00:30 +09:00