Commit Graph

383 Commits

Author SHA1 Message Date
Greg Woolsey
e1f37388fc Fix data validation value list evaluation
One of my users found that my initial implementation was lacking a core distinction - most evaluations expect a single result, and "unwrap" 2/3D ValueEval results to a single value based on the input row/column.

However, data validation list formulas explicitly are expected to return a 2D ValueEval.  This worked when the formula was simple and evaluated to a single Ptg, but only returned one value when the formula was more complex, or referenced a named range defined as a complex formula.

This change teaches WorkbookEvaluator about the distinction, by way of a new attribute for FormulaType.

There is room for discussion over how it is implemented, but this works for me.

Includes the failing workbook we had as a new unit test.

While I was in FormulaType I went ahead and removed the deprecated, unused, and redundant code marked for removal in 3.17.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803121 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 22:19:58 +00:00
Tim Allison
408e236553 bug 61300 -- prevent really long (infinite?) loop on corrupt file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801989 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 20:47:40 +00:00
Tim Allison
93b1f0664c bug 61286/bug 61287 -- allow WriteProtectRecord to have 2 bytes, and allow for HeaderFooter to be empty.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801966 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 13:54:06 +00:00
Tim Allison
278a235b08 bug 61294 -- prevent infinite loop in IOUtils' skipFully.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801844 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 16:20:28 +00:00
PJ Fanning
1f8de11b31 [Bug-61281] guard against index out of bounds in XSSFExportToXml column mapping
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801634 13f79535-47bb-0310-9956-ffa450edef68
2017-07-11 16:38:49 +00:00
Greg Woolsey
972d561897 Add file that failed regression tests as a unit test.
Adjust table style processing to allow for AlternateContent wrappers for table element style definitions.  


git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799733 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 05:55:45 +00:00
Tim Allison
649280df8c bug 61045 -- allow for (and log!) extra bytes in FormatRecord.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799360 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 18:11:34 +00:00
Dominik Stadler
128ba623f8 Don't try to clone a chart, this makes integration-tests work for a few more documents, also the one added via bug 56557
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799037 13f79535-47bb-0310-9956-ffa450edef68
2017-06-18 05:59:25 +00:00
Dominik Stadler
b1ed57750d Add missing file for test for bug 56557
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798926 13f79535-47bb-0310-9956-ffa450edef68
2017-06-16 13:26:50 +00:00
Nick Burch
2ce00a5a78 XSSFTable should format numeric/date cells when used as Column Header names as Excel does, see https://stackoverflow.com/questions/44407111/apache-poi-cant-format-filled-cells-as-numeric
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797914 13f79535-47bb-0310-9956-ffa450edef68
2017-06-07 12:39:41 +00:00
Greg Woolsey
586cf38f1c Bug 60898 - XSSFColor's getARGB() method returns a wrong color value when a workbook has a custom indexed color
teach XSSFColor and most things that create instances about indexed colors.

Null is a valid value for IndexedColorMap instances - the existing built-in default colors are used.

Whenever a workbook style is accessible in the call hierarchy its color mappings are passed down now.

Thanks for the unit test in the issue, it now passes.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796359 13f79535-47bb-0310-9956-ffa450edef68
2017-05-26 23:14:48 +00:00
Dominik Stadler
d868026959 Bug 61063: Add a RefListEval to handle UnionPtg and implement it for Rank(), may be missing for other functions where ArrayEval is currently handled
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795963 13f79535-47bb-0310-9956-ffa450edef68
2017-05-23 21:13:02 +00:00
Andreas Beeker
c45c64ae3a removed invalid test file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795122 13f79535-47bb-0310-9956-ffa450edef68
2017-05-14 22:24:07 +00:00
Greg Woolsey
0cdc064b0c git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795002 13f79535-47bb-0310-9956-ffa450edef68 2017-05-12 18:01:32 +00:00
Greg Woolsey
18d107d974 61060 - teach DataFormatter about conditional formatting rules with number formats
Currently only implemented for XSSF, as there is no API available for HSSF conditional formatting rule number formats (if it is even in the files).

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1794084 13f79535-47bb-0310-9956-ffa450edef68
2017-05-05 17:44:58 +00:00
Javen O'Neal
e39ae9cd30 bug 61034: Call to XSSFReader.getSheetsData() returns duplicate sheets.
Thanks to Mauricio Eastmond for the Excel test file and unit test.
Thanks to Sebastian Wikalinski for isolating the problem and providing a patch.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793223 13f79535-47bb-0310-9956-ffa450edef68
2017-04-29 17:27:17 +00:00
Greg Woolsey
6163e4ca45 Issue #60971, handle formula chart titles
implemented per issue, breaking out static text vs. formula based title getters and setters, with unit test updates and additions.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791025 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 20:27:23 +00:00
Andreas Beeker
1f41c31984 Fix AIOOBE while extracting hssf pictures which are externally linked
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1790897 13f79535-47bb-0310-9956-ffa450edef68
2017-04-10 21:43:22 +00:00
Dominik Stadler
77614b8c49 Test for another type of xml-bomb
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1790473 13f79535-47bb-0310-9956-ffa450edef68
2017-04-06 21:50:03 +00:00
Dominik Stadler
0f193371ea Fix issue found via large corpus tests: HSSFPicture in a HSSFShapeGroup might not have a patriarch set, so let's walk up the parents to try to find one.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1790472 13f79535-47bb-0310-9956-ffa450edef68
2017-04-06 21:49:53 +00:00
Tim Allison
69c3311a98 60881 and 60891 -- on further look, no need to throw an exception for an encrypted xlsb. On the second, let's fix readFully to read fully.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1787846 13f79535-47bb-0310-9956-ffa450edef68
2017-03-20 20:47:15 +00:00
Dominik Stadler
e78eb68b10 60823: DGET function, correct behavior with multiple result entries but only one non-blank
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1787658 13f79535-47bb-0310-9956-ffa450edef68
2017-03-19 20:29:55 +00:00
Tim Allison
730f394261 60826 -- add initial support for streaming reading of xlsb files.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1787228 13f79535-47bb-0310-9956-ffa450edef68
2017-03-16 18:37:13 +00:00
Greg Woolsey
123c0e1e6c Fixed #60858, which showed a regression of the fix for #56420 introduced by my refactoring to fix #56822.
Includes new unit test based on the bug sample file.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1786954 13f79535-47bb-0310-9956-ffa450edef68
2017-03-14 21:40:32 +00:00
Dominik Stadler
abc3d37adc Add tests from bug 45353 to show that this now works fine
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1786432 13f79535-47bb-0310-9956-ffa450edef68
2017-03-10 20:14:00 +00:00
Tim Allison
5bb1195606 51519 -- allow users to ignore or include the <rPh> (phonetic run) element in the ReadOnlySharedStringsTable used in the SAX/streaming xlsx reader.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1785965 13f79535-47bb-0310-9956-ffa450edef68
2017-03-08 13:41:07 +00:00
Greg Woolsey
7dfa32c28b Bug #56822 fix COUNTIFS()
includes unit test from the issue.  Verified unit test results in Excel vs. incorrect previous POI results.  Test passes new code, as do existing tests.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1783037 13f79535-47bb-0310-9956-ffa450edef68
2017-02-14 22:05:49 +00:00
Greg Woolsey
b0d0d0fda5 Add evaluation of data validation rules and conditional formatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782894 13f79535-47bb-0310-9956-ffa450edef68
2017-02-13 22:51:30 +00:00
Javen O'Neal
c2d3025161 bug 59983: correctly update shared formulas when shifting rows. Thanks to Luca Martini for the initial failing unit test with test file and Chiara Marcheschi for the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782111 13f79535-47bb-0310-9956-ffa450edef68
2017-02-08 07:20:31 +00:00
Tim Allison
f6388c2fff Bug 60570 - Add rudimentary EMF read-only capability
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1779493 13f79535-47bb-0310-9956-ffa450edef68
2017-01-19 16:22:29 +00:00
Javen O'Neal
726fe10074 bug 60260: parse unicode sheet names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1778418 13f79535-47bb-0310-9956-ffa450edef68
2017-01-12 10:39:26 +00:00
Andreas Beeker
1d9c74b1bf #60519 - Extractor for *SSF embeddings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1776819 13f79535-47bb-0310-9956-ffa450edef68
2016-12-31 21:50:47 +00:00
Dominik Stadler
12e2fa39fa Bug 60512: Add missing XSSFRelation.CUSTOM_PROPERTY
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1776606 13f79535-47bb-0310-9956-ffa450edef68
2016-12-30 16:55:19 +00:00
Dominik Stadler
d47fff6e1c Bug 59026: Add two null-checks to make exporting XLSX to XML work
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1767057 13f79535-47bb-0310-9956-ffa450edef68
2016-10-28 18:24:04 +00:00
Dominik Stadler
3f91e44380 Bug 60289: Fix handling of unicode escapes with lowercase hex-chars
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1766065 13f79535-47bb-0310-9956-ffa450edef68
2016-10-21 16:31:51 +00:00
Tim Allison
9c455cb5c9 BUG-60285 avoid NPE if missing relationship id
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765861 13f79535-47bb-0310-9956-ffa450edef68
2016-10-20 18:45:03 +00:00
Tim Allison
d233f7c348 BUG-60284 -- throw EncryptedDocumentException for password protected OldExcel files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765829 13f79535-47bb-0310-9956-ffa450edef68
2016-10-20 15:13:16 +00:00
Tim Allison
17d4d76f4f BUG 60273 -- Use codepageutil to get correct charset in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765490 13f79535-47bb-0310-9956-ffa450edef68
2016-10-18 18:24:39 +00:00
Tim Allison
c878e39b55 BUG 59830 -- incorrect reading of unicode stream name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765468 13f79535-47bb-0310-9956-ffa450edef68
2016-10-18 15:47:38 +00:00
Nick Burch
a1800650d9 Test file for #60255
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1764859 13f79535-47bb-0310-9956-ffa450edef68
2016-10-14 10:39:16 +00:00
Javen O'Neal
551d46f3c1 bug 59687: add failing unit test showing that comments when the row that contains the comment is deleted; patch and file contributed by Greg Woolsey
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761860 13f79535-47bb-0310-9956-ffa450edef68
2016-09-22 07:36:52 +00:00
Javen O'Neal
a09fe683dd bug 45565: add failing unit test for bug 45565
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761841 13f79535-47bb-0310-9956-ffa450edef68
2016-09-22 03:29:00 +00:00
Javen O'Neal
cbeddd0d11 bug 59983: add failing unit test demonstrating formula shifting is apply twice to shared formulas; patch from Luca Martini
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761673 13f79535-47bb-0310-9956-ffa450edef68
2016-09-21 05:20:36 +00:00
Nick Burch
5fc5680d15 Patches from Patrick Zimmermann from bugs #60130 and #60131 - DGET fix for empty cells and D* coding improvements
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760717 13f79535-47bb-0310-9956-ffa450edef68
2016-09-14 14:59:00 +00:00
Javen O'Neal
abe46f40ed bug 52425: Error adding Comments into cloned Sheets; patch from Daniel
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760221 13f79535-47bb-0310-9956-ffa450edef68
2016-09-11 04:05:42 +00:00
David North
82829925fb Remove incorrectly set svn:executable flags
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1755847 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 20:32:20 +00:00
Dominik Stadler
bbfb783a57 Bug 59736: Incorrect evaluation of SUBTOTAL with composite interval
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1754674 13f79535-47bb-0310-9956-ffa450edef68
2016-07-31 17:19:27 +00:00
Javen O'Neal
50d1788d3d bug 59881: fix D* functions for blank cells in headers in database; patch from Patrick Zimmermann
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753346 13f79535-47bb-0310-9956-ffa450edef68
2016-07-19 08:02:41 +00:00
Dominik Stadler
0bf845e0cc 59106: WorkdayFunction does not read the area with holidays correctly to calculate work days
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753125 13f79535-47bb-0310-9956-ffa450edef68
2016-07-17 21:18:27 +00:00
Javen O'Neal
285bedac9e bug 59775: correctly create XSSFHyperlinks when target is a URL containing a hash mark; patch contributed by Guillermo Alvarez
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753013 13f79535-47bb-0310-9956-ffa450edef68
2016-07-17 05:43:03 +00:00