Compare commits

...

979 Commits

Author SHA1 Message Date
8dec89756a Bug #61136 - Improve Common SS formula evaluation speed by implementing lazy evaluation 2019-03-25 14:13:48 -04:00
d472f88a42 Add GenericSSEvaluationWorkbook that has XSSF row/column size limits but cannot output a file, for much faster calculations 2019-03-25 14:05:24 -04:00
Andreas Beeker
3ad99da86e tag r1847494 as 4.0.1
git-svn-id: https://svn.apache.org/repos/asf/poi/tags/REL_4_0_1@1847495 13f79535-47bb-0310-9956-ffa450edef68
2018-11-26 21:27:30 +00:00
Andreas Beeker
f9eeca37c3 release prepare for 4.0.1 - updating build.xml and changes.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847494 13f79535-47bb-0310-9956-ffa450edef68
2018-11-26 21:26:55 +00:00
Andreas Beeker
03f1baf019 exclude sha256 for nexus upload
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847493 13f79535-47bb-0310-9956-ffa450edef68
2018-11-26 21:24:46 +00:00
Andreas Beeker
746e22ea88 Fix exception for old powerpoint documents without the usual stream name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847487 13f79535-47bb-0310-9956-ffa450edef68
2018-11-26 20:54:43 +00:00
Dominik Stadler
1468ede3ae Fix TestFileMagic
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847454 13f79535-47bb-0310-9956-ffa450edef68
2018-11-26 06:28:17 +00:00
Andreas Beeker
c3af0776ec Fix exception for old powerpoint documents without the usual stream name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847442 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 23:01:54 +00:00
Andreas Beeker
d3d80e1b4a #60713 - (S)XSSFWorkbook/POIXMLDocument.write(OutputStream) closes the OutputStream
regression

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847438 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 22:05:02 +00:00
Dominik Stadler
e75a0b9e89 Add test for FileMagic
JavaDoc warning fixes
Remove some IDE warnings
Reformat code of sample application

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847437 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 21:56:43 +00:00
Dominik Stadler
56e8509223 Exclude ooxml-testlib from src-zip/tar.gz
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847436 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 21:56:26 +00:00
Andreas Beeker
25a698f76b #62951 - FileMagic not correctly identified
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847429 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 20:50:13 +00:00
Andreas Beeker
8b781ed03e #62949 - SlideShow rendering - keyframe fractions must be increasing
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847428 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 19:25:35 +00:00
PJ Fanning
43e30f090b fixed escaping of sheet names. Thanks to gallonfizik. This closes #134
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847418 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 16:13:17 +00:00
Tim Allison
b76bf26677 bug 60316 -- skip the glossary document, not the template document.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847263 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 13:32:22 +00:00
PJ Fanning
df83dab1a4 add missing classes to poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847083 13f79535-47bb-0310-9956-ffa450edef68
2018-11-21 09:10:19 +00:00
Andreas Beeker
c1ee4b0833 Remove duplicated .jar extension when crafting the maven-jar name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847068 13f79535-47bb-0310-9956-ffa450edef68
2018-11-20 22:11:58 +00:00
PJ Fanning
1c47fcb3e5 tidy up code formatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847012 13f79535-47bb-0310-9956-ffa450edef68
2018-11-20 14:31:49 +00:00
PJ Fanning
f28629f10d [bug-62929] add null check for blip fill. Thanks to Mate Borcsok
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847004 13f79535-47bb-0310-9956-ffa450edef68
2018-11-20 14:15:14 +00:00
Andreas Beeker
52f0b3b63d prepare for 4.0.2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846951 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 21:25:14 +00:00
Andreas Beeker
4f3e9134fd tag r1846949 as 4.0.1
git-svn-id: https://svn.apache.org/repos/asf/poi/tags/REL_4_0_1@1846950 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 21:24:58 +00:00
Andreas Beeker
e0d74718a5 release prepare for 4.0.1 - updating build.xml and changes.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846949 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 21:24:24 +00:00
Andreas Beeker
af5b9d959c Remove commented out System.out calls / Move DummyGraphics2d to testcase area, as it's not used by production code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846946 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 20:48:10 +00:00
Andreas Beeker
0beee42a19 Try to workaround/ignore kept open files of JaCoCo ant task
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846945 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 20:47:03 +00:00
Andreas Beeker
d6cc11ed7a Remove/Minimize references to Scratchpad module from other modules
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846931 13f79535-47bb-0310-9956-ffa450edef68
2018-11-19 18:00:42 +00:00
Andreas Beeker
b3ac6e905e #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846870 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 22:09:44 +00:00
Andreas Beeker
c9ce7ff48a #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846849 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 16:03:20 +00:00
Andreas Beeker
4acbc16f93 #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846824 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 11:06:28 +00:00
Andreas Beeker
87a811997e #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846811 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 00:49:54 +00:00
Andreas Beeker
7d53738154 #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846810 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 00:23:49 +00:00
Andreas Beeker
0d052def85 #62921 - Provide OOXMLLite alternative for Java 12+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846809 13f79535-47bb-0310-9956-ffa450edef68
2018-11-18 00:01:40 +00:00
Andreas Beeker
84cc4cc1f2 Multiproject test including Windows slaves
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846773 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 22:28:23 +00:00
Andreas Beeker
faa0c84517 exclude H35 because of strange file permission errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846746 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 18:49:26 +00:00
Andreas Beeker
31d9ee1a6d exclude H35 because of strange file permission errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846744 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 18:41:46 +00:00
Andreas Beeker
1a040e4b0a Try to fix ImageIO cache error
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846723 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 15:39:51 +00:00
Dominik Stadler
95416d6f05 One more try to avoid the test-failures related to ImageIO-cache dir
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846719 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 15:08:59 +00:00
Dominik Stadler
d1642a89a9 Try to create the temporary directory for ImageIO to see if that makes
the tests work again when built with Maven

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846706 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 11:25:59 +00:00
PJ Fanning
6a198bf5f2 put back XSSFColor(java.awt.Color clr) constructor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846701 13f79535-47bb-0310-9956-ffa450edef68
2018-11-16 07:57:49 +00:00
PJ Fanning
ccfd27dfc3 remove duplicate attempt to add column headers
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846549 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 21:34:03 +00:00
PJ Fanning
2fd720be3f remove unused import
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846548 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 21:30:49 +00:00
PJ Fanning
d64003436f [bug-62908] populate NamedColors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846520 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 16:08:11 +00:00
PJ Fanning
3885cb0839 fix typo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846497 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 09:19:05 +00:00
PJ Fanning
e6505d0e10 add testcase for https://bz.apache.org/bugzilla/show_bug.cgi?id=62906
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846492 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 08:37:11 +00:00
PJ Fanning
6b7e322227 add testcase for https://bz.apache.org/bugzilla/show_bug.cgi?id=62906
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1846489 13f79535-47bb-0310-9956-ffa450edef68
2018-11-13 08:20:47 +00:00
Andreas Beeker
0aa9b34d08 Bug 62872 - Writing large files with 800k rows gives java.io.IOException: This archive contains unclosed entries.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845629 13f79535-47bb-0310-9956-ffa450edef68
2018-11-02 22:59:58 +00:00
Yegor Kozlov
4d3719144e Bug 62836: Implementation of Excel TREND function
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845586 13f79535-47bb-0310-9956-ffa450edef68
2018-11-02 13:34:28 +00:00
Tim Allison
1cd3f7b14e bug 60316 -- until we can implement it properly, gracefully skip the glossary document in XWPF.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845517 13f79535-47bb-0310-9956-ffa450edef68
2018-11-01 21:14:03 +00:00
Tim Allison
70db618688 bug 62624 -- further cleanup
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845511 13f79535-47bb-0310-9956-ffa450edef68
2018-11-01 20:31:42 +00:00
Dominik Stadler
40a5e940c1 Remove JavaDoc warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845435 13f79535-47bb-0310-9956-ffa450edef68
2018-11-01 10:30:16 +00:00
Dominik Stadler
0cc8ec178f IDE warnings, tried to reproduce Bug 58927, but could not
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845434 13f79535-47bb-0310-9956-ffa450edef68
2018-11-01 10:29:54 +00:00
Nick Burch
1d3abff9cb Allow the forrest task to be called from the site sub-project
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845343 13f79535-47bb-0310-9956-ffa450edef68
2018-10-31 16:26:52 +00:00
Tim Allison
fd125b9e4e bug 62624 -- ensure streams are closed...thanks to LGTM, and PJ!
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845300 13f79535-47bb-0310-9956-ffa450edef68
2018-10-31 00:59:16 +00:00
Tim Allison
c257dd71f9 bug 62624 -- fix loop identified as dodgy by FindBugs; add a other sanity checks.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845299 13f79535-47bb-0310-9956-ffa450edef68
2018-10-31 00:47:51 +00:00
Tim Allison
9229cab9bc bug 62624 -- fix recursion
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845284 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 21:30:57 +00:00
Nick Burch
24ddbdfdf4 List additional dependencies from the Ant build file in Eclipse
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845255 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 16:39:33 +00:00
Tim Allison
9ab4318ade bug 62625 -- clean up imports
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845246 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 15:45:00 +00:00
Tim Allison
1db334a6fd bug 62625 -- add special handling for REFERENCE_NAME record that may only
contain an ascii string, against the spec in VBAMacroReader

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845238 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 13:25:20 +00:00
Nick Burch
409514452f More javadoc updates
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845227 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 11:55:11 +00:00
Nick Burch
0baf6c59ff Update for latest/dev javadocs at /apidocs/dev/
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845222 13f79535-47bb-0310-9956-ffa450edef68
2018-10-30 11:00:35 +00:00
Tim Allison
0fd3027a67 bug 62624 -- fix npe by adding processing of module name mapping in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1845138 13f79535-47bb-0310-9956-ffa450edef68
2018-10-29 15:48:44 +00:00
PJ Fanning
e469f49aeb update xmlbeans to 3.0.2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844955 13f79535-47bb-0310-9956-ffa450edef68
2018-10-27 11:52:26 +00:00
Tim Allison
ad52c65f70 bug 62859 -- fix two potential NPEs when initializing XWPFSDTContent
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844920 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 19:06:18 +00:00
Dominik Stadler
b0f5c2ca7b IDE warnings, slightly more tests and fix test to not leave a modified file behind
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844894 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 10:58:37 +00:00
Dominik Stadler
232616f44d Adjust sample for creating comments to also create a .xlsx file
Enhance workbook factory to allow to create new empty workbooks as well

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844881 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:57 +00:00
Dominik Stadler
2148b7f278 Typos and IDE warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844879 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:43 +00:00
Dominik Stadler
8f11f0010e Set NOSONAR, adjust test slightly and reformat code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844878 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:30 +00:00
Dominik Stadler
f5af163b04 Ignore directory ooxml-testlib
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844877 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:24 +00:00
Dominik Stadler
8bf6a26751 Set NOSONAR and reformat code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844876 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:19 +00:00
Dominik Stadler
e0ad9625f5 Jenkins DSL: Adjust the view-description, but it is still commented out
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844875 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:13 +00:00
Dominik Stadler
50bc5c8d6f Remove the workaround for a bug in JDK 11 which was fixed in ea+28
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844874 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:01 +00:00
PJ Fanning
1f9a0caf2e fix class cast issur recently introduced in BaseXSSFFormulaEvaluator
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844311 13f79535-47bb-0310-9956-ffa450edef68
2018-10-19 07:43:04 +00:00
Greg Woolsey
d24b4492f0 #62834 FormulaEvaluator.evaluateInCell() throws Exception
added cell type = formula check when looping through the shared formula range, to ignore any non-formula cells.

Also refactored a bit to enable passing in the evaluation context, as getCellFormula() uses it behind the scenes when evaluating a shared formula cell (has to shift the formula references based on the master cell).  Review of these changes is welcome, as always.

Checked all other code referencing the "SHARED" enum, and didn't see anything else that dealt with formula cell values and thus would need to notice non-formula cells.

Added unit test based on the failing file from Bugzilla.  Test failed until the fixed code was in place.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844295 13f79535-47bb-0310-9956-ffa450edef68
2018-10-19 01:11:47 +00:00
Yegor Kozlov
c7111f562c Bug 62373: Support for FREQUENCY function
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844238 13f79535-47bb-0310-9956-ffa450edef68
2018-10-18 13:46:04 +00:00
Nick Burch
290e9c4087 #62831 Fix WorkbookFactory.create with a subclass of File, eg from JFileChooser
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844116 13f79535-47bb-0310-9956-ffa450edef68
2018-10-17 14:24:59 +00:00
Nick Burch
ba71f90c32 Failing unit test for bug #62831
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844115 13f79535-47bb-0310-9956-ffa450edef68
2018-10-17 14:20:02 +00:00
Alain Béarez
5a53f36391 fix more LGTM alerts, in tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843557 13f79535-47bb-0310-9956-ffa450edef68
2018-10-11 14:50:27 +00:00
Tim Allison
fcbed10cfc 62815 -- some numeric values not correctly extracted from xlsb
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843553 13f79535-47bb-0310-9956-ffa450edef68
2018-10-11 14:14:07 +00:00
Alain Béarez
ead92fbe9a fix most alerts reported by LGTM on OOXML
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843481 13f79535-47bb-0310-9956-ffa450edef68
2018-10-10 17:49:53 +00:00
Andreas Beeker
5f0cff9eed add ignored resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843354 13f79535-47bb-0310-9956-ffa450edef68
2018-10-09 22:18:55 +00:00
PJ Fanning
94168f60c6 [bug-62807] fix typo in XSLFTableCell#removeBorder
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843180 13f79535-47bb-0310-9956-ffa450edef68
2018-10-08 18:38:19 +00:00
PJ Fanning
9f106fe8ec add stax entries to forbidden apis due to android issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1843009 13f79535-47bb-0310-9956-ffa450edef68
2018-10-06 09:38:58 +00:00
PJ Fanning
5baa52f86e small adjustments to byte sizes in TestPackage zip-bomb tests to try fix test that fails on old-xerces harness
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842980 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 20:17:39 +00:00
PJ Fanning
88fd68050f use jaxp transformer instead of dom serializer to try fix old-xerces test failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842979 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 20:09:45 +00:00
PJ Fanning
268c9230cd use jaxp transformer instead of dom serializer to try fix old-xerces test failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842974 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 19:52:24 +00:00
Alain Béarez
b326a5cd01 adding tricks from other answers on StackOverflow
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842959 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 18:07:55 +00:00
Alain Béarez
c66af5c21e example from StackOverflow question 47065690
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842925 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 14:36:18 +00:00
Alain Béarez
01b780666b more XDDF improvements based on SO examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842876 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 09:59:32 +00:00
PJ Fanning
01ad2f9d1a [bug-62800] Fix null pointer exception if a picture shape has no blip id
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842782 13f79535-47bb-0310-9956-ffa450edef68
2018-10-04 07:47:27 +00:00
Alain Béarez
5430141cfb XDDF improvements based on StackOverflow examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842728 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 14:32:34 +00:00
Alain Béarez
6673fe7ad1 fix lgtm alerts in examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842707 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 11:51:41 +00:00
Alain Béarez
e88fc19ca4 change chart data to experiment diverse scripts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842687 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 08:20:50 +00:00
PJ Fanning
f3a1ed5a45 deprecate unused Nullable class
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842684 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 07:42:33 +00:00
PJ Fanning
6b4094650f change method to get XMLEventFactory due to issues seen on Android SDK
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842683 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 07:36:12 +00:00
PJ Fanning
dc45ce9410 disable junit xml collection
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842668 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 22:47:57 +00:00
PJ Fanning
bd16d310b9 get xmlbeans job to build dist artifacts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842667 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 22:43:09 +00:00
PJ Fanning
92669a72bf get xmlbeans job to build dist artifacts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842666 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 22:36:25 +00:00
PJ Fanning
ef397c0158 rename xmlbeans job
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842663 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 22:24:09 +00:00
PJ Fanning
46b1833bfc [bug-62796] remove use of Stax Namespace class from PackagePropertiesMarshaller
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842647 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 19:16:00 +00:00
PJ Fanning
b869085731 try to fix xmlbeans jenkins job
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842629 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 14:55:09 +00:00
PJ Fanning
f4428349c6 try to set up xmlbeans build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842599 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 08:15:41 +00:00
Alain Béarez
72d02f0c1c extract valuable code from 54470 submitted patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842548 13f79535-47bb-0310-9956-ffa450edef68
2018-10-01 19:27:32 +00:00
PJ Fanning
11dee9b086 use StaxHelper to get event factory
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842402 13f79535-47bb-0310-9956-ffa450edef68
2018-09-30 18:14:46 +00:00
PJ Fanning
4833c25d32 lgtm issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842302 13f79535-47bb-0310-9956-ffa450edef68
2018-09-29 09:33:52 +00:00
Dominik Stadler
9e7b1969f9 Jenkins DSL: Remove JDK 9 and adjust location of image for the project-logo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842275 13f79535-47bb-0310-9956-ffa450edef68
2018-09-28 17:43:07 +00:00
Dominik Stadler
9f2892e97e Remove outdated comment for japicmp
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842274 13f79535-47bb-0310-9956-ffa450edef68
2018-09-28 17:43:02 +00:00
PJ Fanning
00715c8d89 fix lgtm issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842218 13f79535-47bb-0310-9956-ffa450edef68
2018-09-28 07:48:29 +00:00
PJ Fanning
8dad927a8c fix gradle build issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842217 13f79535-47bb-0310-9956-ffa450edef68
2018-09-28 07:42:47 +00:00
PJ Fanning
500c64e657 fix lgtm issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842216 13f79535-47bb-0310-9956-ffa450edef68
2018-09-28 07:33:59 +00:00
PJ Fanning
e505160716 make OPCPackage#close() unsynchronized and add javadoc note saying method is not thread-safe
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842171 13f79535-47bb-0310-9956-ffa450edef68
2018-09-27 21:22:24 +00:00
PJ Fanning
5c1a036de2 [bug-62768] synchronize OPCPackage#close()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842142 13f79535-47bb-0310-9956-ffa450edef68
2018-09-27 19:06:06 +00:00
PJ Fanning
19baa76652 [bug-62736] Relations on XSLFPictureShape are removed unconditionally. Thanks to Mate Borcsok
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842055 13f79535-47bb-0310-9956-ffa450edef68
2018-09-26 21:42:21 +00:00
Alain Béarez
e159d4e179 adapting some contributions by Axel Richter on SO
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841988 13f79535-47bb-0310-9956-ffa450edef68
2018-09-26 00:30:33 +00:00
PJ Fanning
6af2173f93 fix javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841987 13f79535-47bb-0310-9956-ffa450edef68
2018-09-25 22:36:36 +00:00
PJ Fanning
7c243f3d76 lgtm warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841984 13f79535-47bb-0310-9956-ffa450edef68
2018-09-25 22:07:56 +00:00
PJ Fanning
f4aef7afca [bug-62747] bouncycastle 1.60
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841394 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 21:49:55 +00:00
PJ Fanning
67df2dc64a [bug-62742] add commons-compress jar to bin zip
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841360 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 18:15:30 +00:00
Greg Woolsey
891deb3967 Bug 62740 - XSSFTable constructor automatically assigns invalid (non-unique) column IDs
fix the logic and update the unit test to check for and catch the problem.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841357 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 17:42:43 +00:00
PJ Fanning
74c07d5307 [bug-62738] make int cast a long cast in randbetween
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841321 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 12:18:56 +00:00
PJ Fanning
c11d29c72b add reflections jar to mvn sonar build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841308 13f79535-47bb-0310-9956-ffa450edef68
2018-09-19 10:15:52 +00:00
PJ Fanning
2b236a4c41 fix forbidden-apis check
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841275 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 23:25:49 +00:00
PJ Fanning
e930d76d7b add ooxml-schemas enum classes to poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841274 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 23:21:00 +00:00
PJ Fanning
c18375a4d0 [bug-62730] include all inner list classes in poi-ooxml-schemas.jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841270 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 22:09:15 +00:00
PJ Fanning
5f33759568 update commons-codec dependency in pom.xml to 1.11 (to match compile time)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841246 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 18:00:53 +00:00
PJ Fanning
3f92a35a26 move commons-math3 dependency to poi pom.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841245 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 17:53:30 +00:00
PJ Fanning
e5b871e8bf [bug-62690] change poi-ooxml pom.xml to have explicit dependency on commons-math3 3.6.1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841244 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 17:39:23 +00:00
PJ Fanning
5f8b952dfa [bug-62735] change poi-ooxml pom.xml to have dependency on curvesapi 1.05
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841243 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 17:36:28 +00:00
PJ Fanning
74f788358a [bug-62733] XSLFBackground setFill() can corrupt the document
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1841240 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 16:55:29 +00:00
PJ Fanning
b7c7301941 handle test issues when running with old xerces
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840386 13f79535-47bb-0310-9956-ffa450edef68
2018-09-08 22:28:02 +00:00
Andreas Beeker
2f8ef557a4 #62699 - Download page must link to https://www.apache.org/dist/poi/KEYS
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840383 13f79535-47bb-0310-9956-ffa450edef68
2018-09-08 21:23:19 +00:00
Dominik Stadler
f183b4f543 Use different directory for xerces-jar so we do not remove it again as part of check-jars
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840321 13f79535-47bb-0310-9956-ffa450edef68
2018-09-07 20:47:08 +00:00
Andreas Beeker
6eae655f81 update 3.17 leftovers and provide a new build target to update those in the next release
remove final / beta tags, as we (try to) use semver now

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840318 13f79535-47bb-0310-9956-ffa450edef68
2018-09-07 19:25:02 +00:00
PJ Fanning
ff7fe79e19 [bug-62692] issue when using widlfy xml parser
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840304 13f79535-47bb-0310-9956-ffa450edef68
2018-09-07 14:57:09 +00:00
Andreas Beeker
d45915478c update docs to 4.0.0
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840167 13f79535-47bb-0310-9956-ffa450edef68
2018-09-05 23:00:15 +00:00
Alain Béarez
5abdfcb0a6 import existing chart on current drawing
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1840076 13f79535-47bb-0310-9956-ffa450edef68
2018-09-05 01:00:45 +00:00
Andreas Beeker
a8d1307025 update docs to Java 1.8
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839863 13f79535-47bb-0310-9956-ffa450edef68
2018-09-01 23:43:43 +00:00
Andreas Beeker
0495770104 remove reference to Piccolo parser
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839862 13f79535-47bb-0310-9956-ffa450edef68
2018-09-01 23:12:56 +00:00
Andreas Beeker
491295aa64 Add SHA256 to release-prep and legal/* to ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839861 13f79535-47bb-0310-9956-ffa450edef68
2018-09-01 22:58:51 +00:00
Andreas Beeker
4a187ed9ac prepare for 4.0.1-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839750 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 12:10:00 +00:00
Andreas Beeker
a0679c4a16 release prepare for 4.0.0 - updating build.xml and changes.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839748 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 12:09:06 +00:00
Andreas Beeker
72ab5887bd fix changes.xml entries in build.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839747 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 12:08:40 +00:00
Andreas Beeker
3c3f2a3fe3 sonar fixes - blocker
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839745 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 11:56:18 +00:00
Andreas Beeker
14335fd152 #62108 - ArrayIndexOfBounds exception when getColumnWidth()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839710 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 00:28:17 +00:00
Andreas Beeker
2044779351 #62649 - Remove OPOIFS* / rename NPOIFS* to POIFS*
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839709 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 00:25:50 +00:00
PJ Fanning
fcd7242389 remove ref to staging repo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839423 13f79535-47bb-0310-9956-ffa450edef68
2018-08-28 11:08:15 +00:00
PJ Fanning
45d85a05af remove stray stacktrace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839385 13f79535-47bb-0310-9956-ffa450edef68
2018-08-28 01:49:16 +00:00
PJ Fanning
45558cda65 add missing classes to poi-ooxml-schema.jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839384 13f79535-47bb-0310-9956-ffa450edef68
2018-08-28 01:38:34 +00:00
Alain Béarez
5b8f5a69db rebase XDDF text package
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839369 13f79535-47bb-0310-9956-ffa450edef68
2018-08-27 19:25:34 +00:00
Alain Béarez
85e2e8616d test integration of XDDF text entities
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839259 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 21:33:16 +00:00
Alain Béarez
0f9247a088 complete body properties with insets
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839256 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 21:19:07 +00:00
Alain Béarez
05a2a922fa fill in the text body, its paragraphs and text runs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839255 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 21:18:54 +00:00
Alain Béarez
303cc5ddc5 add warning message to help reduce duplicates of bug 60102
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839252 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 21:15:38 +00:00
Andreas Beeker
e4bd5e838f #62649 - Remove OPOIFS
Fix HPSF UTF-8 encoding error with Bug52311.doc while refactoring CopyCompare/EntryUtils

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839201 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:55:00 +00:00
Dominik Stadler
63d904acb2 Set locale provider to JRE,CLDR for tests to have compatible date formatting in JDK 9+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839199 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:41:31 +00:00
Dominik Stadler
de6280700b Enable periodic run of build against JDK 11
Add build for JDK 12, but still disabled because there is no JDK 12 in CI availalbe yet

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839198 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:41:25 +00:00
Dominik Stadler
522c33358b Ensure that file handles are closed for encrypted files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839197 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:41:20 +00:00
Dominik Stadler
eaea81bfa8 Use any version of xmlbeans in the assemble step to reduce the number of places that need to be updated
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839196 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:41:13 +00:00
Dominik Stadler
71002b2491 Adjust test for JDK 9, 10 and 11
fix some IDE/Javadoc warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839195 13f79535-47bb-0310-9956-ffa450edef68
2018-08-26 11:41:09 +00:00
PJ Fanning
876a783aee fix accidental change in test file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838919 13f79535-47bb-0310-9956-ffa450edef68
2018-08-24 17:58:30 +00:00
PJ Fanning
f82d679413 use released version of xmlbeans 3.0.1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838918 13f79535-47bb-0310-9956-ffa450edef68
2018-08-24 17:57:06 +00:00
Dominik Stadler
5f15047629 Also update asm to 6.2.1, this is required for JaCoCo 0.8.2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838787 13f79535-47bb-0310-9956-ffa450edef68
2018-08-24 06:48:39 +00:00
Dominik Stadler
301832620b Exclude some test-suites in build.gradle to not execute tests multiple times
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838765 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 20:23:30 +00:00
Dominik Stadler
d351a24e5c Update JaCoCo to 0.8.2 in build.gradle to make it work with JDK 10+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838764 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 20:23:25 +00:00
Dominik Stadler
4663238bb8 Adjust for JDK 11 ea-26 build, need to add jaxb via normal jar dependency now as it was removed from the JDK
Also needed to remove a few uses of Mockito which fail now with certain abstract classes
Update to Mockito 2.21

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838763 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 20:23:20 +00:00
Dominik Stadler
5acb18ac04 Remove some IDE warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838733 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 13:34:25 +00:00
Dominik Stadler
78dac9bd50 Update to latest Mockito 2.21
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838731 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 13:25:53 +00:00
Dominik Stadler
ba258c675e Add staging repo in one more place in Gradle build to make compile succeed on a fresh machine
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838729 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 13:22:34 +00:00
Dominik Stadler
c9dad04072 Disable some machines that do not yet have JDK 11 installed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838705 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 09:26:25 +00:00
Dominik Stadler
b2e81ecad9 Try to make target "docs" work on Windows again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838703 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 09:06:34 +00:00
Dominik Stadler
1d9568899d Adjust job for JDK 11 to not require module java.xml.bind any more
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838702 13f79535-47bb-0310-9956-ffa450edef68
2018-08-23 09:03:49 +00:00
PJ Fanning
179e81c4a4 [github-122] XWPF: Set table and table cell widths to percentage, twips, or auto. This closes #122
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838449 13f79535-47bb-0310-9956-ffa450edef68
2018-08-20 18:12:37 +00:00
PJ Fanning
a611b66fd1 [bug-62639] make private constructor on DateFormatter public
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838420 13f79535-47bb-0310-9956-ffa450edef68
2018-08-20 10:03:49 +00:00
PJ Fanning
71f2298b9a allow access to apache staging repo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838379 13f79535-47bb-0310-9956-ffa450edef68
2018-08-19 13:17:43 +00:00
PJ Fanning
37a3a769fe uptake xmlbeans 3.0.1 (staging version, pre-release)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838366 13f79535-47bb-0310-9956-ffa450edef68
2018-08-19 09:08:00 +00:00
Dominik Stadler
2ef660bf97 Adjust list of nodes for testing environment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838360 13f79535-47bb-0310-9956-ffa450edef68
2018-08-19 05:58:31 +00:00
Dominik Stadler
1b77f54b3c Add Job for testing with JDK 11, no trigger yet as it does not fully work yet
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838359 13f79535-47bb-0310-9956-ffa450edef68
2018-08-19 05:58:27 +00:00
PJ Fanning
8a417fe39d fix issue with commons-compress URL
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838237 13f79535-47bb-0310-9956-ffa450edef68
2018-08-17 07:53:10 +00:00
Tim Allison
99a27862ae 62630 -- upgrad commons-compress
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838214 13f79535-47bb-0310-9956-ffa450edef68
2018-08-16 18:36:47 +00:00
Tim Allison
5a2090fe9d entity_expansion
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838135 13f79535-47bb-0310-9956-ffa450edef68
2018-08-15 19:20:11 +00:00
PJ Fanning
ae13b034fe [github-121] Fix issue with setting vertical alignment and emphasis mark. This closes #121
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838133 13f79535-47bb-0310-9956-ffa450edef68
2018-08-15 18:31:36 +00:00
Tim Allison
fa0d9edebd improve sax reading
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838048 13f79535-47bb-0310-9956-ffa450edef68
2018-08-14 20:03:14 +00:00
Tim Allison
2942b66e7a bug 62597 -- bump max record length for ExOleObjStg based on regression corpus
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1838047 13f79535-47bb-0310-9956-ffa450edef68
2018-08-14 19:29:03 +00:00
Andreas Beeker
1407ace4f7 #61589 - Importing content does not copy hyperlink address
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837909 13f79535-47bb-0310-9956-ffa450edef68
2018-08-12 22:35:02 +00:00
PJ Fanning
1691c2372a disable dtd processing
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837850 13f79535-47bb-0310-9956-ffa450edef68
2018-08-11 09:22:05 +00:00
Andreas Beeker
d21c3d50ee #62587 - repeated call to XSLFSheet.removeShape leads to java.lang.IllegalArgumentException: partName
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837839 13f79535-47bb-0310-9956-ffa450edef68
2018-08-11 01:55:39 +00:00
Tim Allison
5e241fdd3c bug 62591 -- revert to ignoring place holders even if they contain metroblobs in ppt
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837742 13f79535-47bb-0310-9956-ffa450edef68
2018-08-09 15:50:34 +00:00
PJ Fanning
7b8ff720f4 try to fix TestAllFiles
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837716 13f79535-47bb-0310-9956-ffa450edef68
2018-08-09 11:09:45 +00:00
Tim Allison
2bb839edd7 bug 62608 -- avoid ioobe in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837664 13f79535-47bb-0310-9956-ffa450edef68
2018-08-08 17:30:02 +00:00
Tim Allison
070e815109 bug 62592 -- prevent StackOverflowError on corrupt thmx
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837658 13f79535-47bb-0310-9956-ffa450edef68
2018-08-08 16:06:18 +00:00
Tim Allison
c709b0c5d5 bug 62597 -- bump max record sizes up based on new failures in regression set. I typically bumped to 2x the max found in regression set.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837387 13f79535-47bb-0310-9956-ffa450edef68
2018-08-03 17:14:34 +00:00
PJ Fanning
cad6c1701f fix build issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837349 13f79535-47bb-0310-9956-ffa450edef68
2018-08-03 07:41:22 +00:00
PJ Fanning
c456c2fbe6 [github-119] extra xpwf formatting support. This closes #119
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837336 13f79535-47bb-0310-9956-ffa450edef68
2018-08-02 21:28:47 +00:00
PJ Fanning
9a6fde7673 [github-120] rename some new xpwf abstract classes. This closes #120
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837335 13f79535-47bb-0310-9956-ffa450edef68
2018-08-02 20:04:49 +00:00
PJ Fanning
361117c17a add CTEm class to poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837197 13f79535-47bb-0310-9956-ffa450edef68
2018-07-31 23:45:18 +00:00
PJ Fanning
e05b80f7dc [github-118] Added get/set for mirror margins setting. This closes #118
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837093 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 22:23:25 +00:00
PJ Fanning
bfc79d5169 add new public method to expose cell addresses that have comments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837082 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 18:44:58 +00:00
PJ Fanning
6e0a009b8f ensure xssfsheet getCellComments returns comments with client anchors set
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837014 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 02:08:37 +00:00
PJ Fanning
f84dc3885c exclude broken pptx file from integration test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837013 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 01:55:09 +00:00
PJ Fanning
857f4a5ad4 add null guard in XSSFComment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837012 13f79535-47bb-0310-9956-ffa450edef68
2018-07-30 01:45:29 +00:00
PJ Fanning
51b4e33a62 add 1 of the pptx files failing in centic regression tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837010 13f79535-47bb-0310-9956-ffa450edef68
2018-07-29 23:19:07 +00:00
PJ Fanning
3be215e070 Handle NPE issues in POIXMLProperties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837007 13f79535-47bb-0310-9956-ffa450edef68
2018-07-29 23:05:01 +00:00
PJ Fanning
83b60f4777 [bug-62275] in vlooup function, treat optional 4th param as true if the value is not provided
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836857 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 21:26:31 +00:00
PJ Fanning
3c4d0086fa add test case
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836856 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 21:00:36 +00:00
PJ Fanning
d2d9202772 make xssf streaming code more extensible
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836795 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 09:19:58 +00:00
PJ Fanning
ad4f5ea6d2 add missing licenses
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836779 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 06:59:13 +00:00
PJ Fanning
2900fcf9af start process of introducing an interface for Styles and Themes Tables
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836732 13f79535-47bb-0310-9956-ffa450edef68
2018-07-26 14:18:13 +00:00
PJ Fanning
577be83a1d reduce dependence on CTComment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836730 13f79535-47bb-0310-9956-ffa450edef68
2018-07-26 13:41:11 +00:00
PJ Fanning
afd75ffaa3 reduce dependence on CTComment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836723 13f79535-47bb-0310-9956-ffa450edef68
2018-07-26 12:30:32 +00:00
PJ Fanning
ba4c6093f6 start process of introducing an interface for Comments Table
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836721 13f79535-47bb-0310-9956-ffa450edef68
2018-07-26 12:12:39 +00:00
PJ Fanning
826c15ef59 add SharedStrings interface to allow our XSSF code to more easily extended by external projects
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836674 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 21:24:29 +00:00
PJ Fanning
c4290ae2be [github-117] Add getStyleWithName() to XWPFStyles. This closes #117
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836649 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 17:21:58 +00:00
PJ Fanning
2b3c415909 make ReadOnlySharedStringsTable subclassable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836627 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 13:09:54 +00:00
Andreas Beeker
d3b5a0141e #62564 - replace Thread.currentThread().getContextClassLoader() with getClass().getClassLoader()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836590 13f79535-47bb-0310-9956-ffa450edef68
2018-07-24 22:57:18 +00:00
PJ Fanning
54b8260ccc Add missing apache licenses. This closes #116
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836558 13f79535-47bb-0310-9956-ffa450edef68
2018-07-24 14:48:01 +00:00
PJ Fanning
e3ae88792b [github-115] implement endnote. This closes #115
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836538 13f79535-47bb-0310-9956-ffa450edef68
2018-07-24 09:46:44 +00:00
Andreas Beeker
f4decbdb32 Added missing reference to commons-compress JAR
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836433 13f79535-47bb-0310-9956-ffa450edef68
2018-07-22 12:01:37 +00:00
PJ Fanning
c1fc95c517 [github-114] Extend docx footnote support. Thanks to Eliot Kimber. This closes #114
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836415 13f79535-47bb-0310-9956-ffa450edef68
2018-07-21 21:30:52 +00:00
Andreas Beeker
fc044c7840 replaced forrest ant integration with ant invocation - copying xml-resolver.jar in $ANT_HOME/lib isn't necessary anymore
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836402 13f79535-47bb-0310-9956-ffa450edef68
2018-07-21 10:28:53 +00:00
Andreas Beeker
eca7a55932 fix forrest path on windows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836305 13f79535-47bb-0310-9956-ffa450edef68
2018-07-19 22:55:51 +00:00
Andreas Beeker
1ce9611415 fix new javadocs location in build dir
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836304 13f79535-47bb-0310-9956-ffa450edef68
2018-07-19 21:49:49 +00:00
Andreas Beeker
9e076beb5b update forrest version info / set FORREST_HOME environment variable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836303 13f79535-47bb-0310-9956-ffa450edef68
2018-07-19 21:28:38 +00:00
Andreas Beeker
327c68a50a Update to Apache Forrest 0.90
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836243 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 23:24:53 +00:00
PJ Fanning
df77071378 upgrade commons-collections4 to 4.2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835913 13f79535-47bb-0310-9956-ffa450edef68
2018-07-14 15:49:49 +00:00
PJ Fanning
3aeee6987d add retest-ooxml target that can be used to verify if we have all the necessary classes in poi-ooxml-schemas jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835852 13f79535-47bb-0310-9956-ffa450edef68
2018-07-13 18:09:56 +00:00
PJ Fanning
37cf867cc1 add retest-ooxml target that can be used to verify if we have all the necessary classes in poi-ooxml-schemas jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835850 13f79535-47bb-0310-9956-ffa450edef68
2018-07-13 17:51:55 +00:00
PJ Fanning
b167994f49 try to get more generated classes into poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835687 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 23:24:27 +00:00
PJ Fanning
8c4833a108 try to get more generated classes into poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835685 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 22:55:03 +00:00
PJ Fanning
20dc9dc714 code formatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835674 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 21:32:55 +00:00
PJ Fanning
61a25d079b more usage of shared rebuildRows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835494 13f79535-47bb-0310-9956-ffa450edef68
2018-07-09 20:49:21 +00:00
PJ Fanning
6f3cc9ed80 update indents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835482 13f79535-47bb-0310-9956-ffa450edef68
2018-07-09 19:58:33 +00:00
Andreas Beeker
7dc47ceefe changed expiry date of kiwiwings entry
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835328 13f79535-47bb-0310-9956-ffa450edef68
2018-07-07 18:54:40 +00:00
PJ Fanning
f818ef2d35 update PGP key
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835302 13f79535-47bb-0310-9956-ffa450edef68
2018-07-07 11:38:10 +00:00
PJ Fanning
b1780a5f1a add pgp key
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835301 13f79535-47bb-0310-9956-ffa450edef68
2018-07-07 11:23:35 +00:00
PJ Fanning
75d1771f49 [bug-62522] include partName in exception message
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835276 13f79535-47bb-0310-9956-ffa450edef68
2018-07-06 19:07:22 +00:00
Dominik Stadler
0c3e972a71 Gradle: Define japicmp settings only once, but still fails due to removed classes in 4.0.0
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835185 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:55:12 +00:00
Dominik Stadler
8e9ccfaacd Regression tests: Add test which triggers reading header/footer of PPTX files so that we include the related CT classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835184 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:54:24 +00:00
Dominik Stadler
a4251b706b Adjust comments and IDE warnings, duplicate code reduction
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835183 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:53:52 +00:00
Dominik Stadler
d2c3c7e004 Add a test with a threaded TempFileCreationStrategy, remove duplicated constant.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835182 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:53:44 +00:00
Dominik Stadler
834f34c41d Java 9: Add Automatic-Module-Name in Jars built via Gradle
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835181 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:53:36 +00:00
PJ Fanning
4c97e2daa5 try to get CTPhonetic included in poi-ooxml-schemas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1835048 13f79535-47bb-0310-9956-ffa450edef68
2018-07-04 11:38:32 +00:00
PJ Fanning
f68e8e2c07 mark constructor as public
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834879 13f79535-47bb-0310-9956-ffa450edef68
2018-07-02 20:01:11 +00:00
Andreas Beeker
7e74865f8c Fix gradle add maven repo again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834764 13f79535-47bb-0310-9956-ffa450edef68
2018-06-30 20:40:53 +00:00
Andreas Beeker
6193f895ba Fix gradle ant-junit dependencies when not using the gradle wrapper / update ant version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834762 13f79535-47bb-0310-9956-ffa450edef68
2018-06-30 20:36:47 +00:00
PJ Fanning
31674ea13b try to get CTPhoneticRun added to poi-ooxml-schemas jar (referenced in excel-streaming-reader codebase)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834745 13f79535-47bb-0310-9956-ffa450edef68
2018-06-30 14:49:31 +00:00
Andreas Beeker
9b50601458 #62513 - Don't try to parse embedded package relationships
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834729 13f79535-47bb-0310-9956-ffa450edef68
2018-06-30 11:20:23 +00:00
PJ Fanning
8313053332 belated ref to 3.17 in doap file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834711 13f79535-47bb-0310-9956-ffa450edef68
2018-06-29 22:40:13 +00:00
Dominik Stadler
e6157c5b13 Slightly adjust afew tests some more
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834654 13f79535-47bb-0310-9956-ffa450edef68
2018-06-29 08:13:22 +00:00
PJ Fanning
214ad2a5b5 update xmlbeans repo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834639 13f79535-47bb-0310-9956-ffa450edef68
2018-06-28 20:06:24 +00:00
Dominik Stadler
88de42971d Somehow the WordToHtml converter now produces slightly more than 6000 chars before the <table element for me
As there is no description why this substring was in the test in the first place I removed it to make
the test less flaky.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834621 13f79535-47bb-0310-9956-ffa450edef68
2018-06-28 15:47:16 +00:00
Dominik Stadler
602b6d451e Gracefully close resources in test if first line in setup causes a problem
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834412 13f79535-47bb-0310-9956-ffa450edef68
2018-06-26 10:12:52 +00:00
Andreas Beeker
f509d1deae #59268 - adapt xml schema changes to maven build and add apache staging repository temporarily
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834257 13f79535-47bb-0310-9956-ffa450edef68
2018-06-24 18:53:14 +00:00
Andreas Beeker
2d046ec2ae #59268 - cache typeloader because of OOMs in the jenkins tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834236 13f79535-47bb-0310-9956-ffa450edef68
2018-06-24 07:30:20 +00:00
Andreas Beeker
eb03fc42be #59268 - remove duplicated typeloader in POI and use fixed XmlBeans implementation instead
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834229 13f79535-47bb-0310-9956-ffa450edef68
2018-06-23 22:56:34 +00:00
PJ Fanning
c88e551e05 add repo definition to pom.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834187 13f79535-47bb-0310-9956-ffa450edef68
2018-06-23 09:25:42 +00:00
Andreas Beeker
e87f0cb68d #59268 - add license header / escape unicode string
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834168 13f79535-47bb-0310-9956-ffa450edef68
2018-06-22 22:24:27 +00:00
Andreas Beeker
18db483a72 #59268 - Work on providing an updated version of XMLBeans
(imported from https://github.com/apache/poi/pull/113)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1834165 13f79535-47bb-0310-9956-ffa450edef68
2018-06-22 21:25:00 +00:00
Andreas Beeker
0a999d8cd3 #62451 - Document last printed in the year 27321
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833668 13f79535-47bb-0310-9956-ffa450edef68
2018-06-17 16:59:48 +00:00
Andreas Beeker
de9b2e0481 #60713 - (S)XSSFWorkbook/POIXMLDocument.write(OutputStream) closes the OutputStream
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833566 13f79535-47bb-0310-9956-ffa450edef68
2018-06-14 22:25:26 +00:00
Andreas Beeker
5169036f66 #62452 - Extract configuration while verifying XML signatures
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833477 13f79535-47bb-0310-9956-ffa450edef68
2018-06-13 20:06:08 +00:00
PJ Fanning
d101d9100c [bug-62438] remove nullable class (and use java.util.Optional). This closes #111
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833459 13f79535-47bb-0310-9956-ffa450edef68
2018-06-13 12:18:32 +00:00
PJ Fanning
57fe16be66 add back xmlbeans jar manipulation due to build issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833303 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 21:58:18 +00:00
Andreas Beeker
13e8752c37 Disabled API-Check for 4.0.0 because of incompatible breaking changes - enable it again, after 4.0.0 is released
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833302 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 20:42:19 +00:00
PJ Fanning
7c2677632e update license notice based on https://apache.org/legal/release-policy.html
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833298 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 19:51:23 +00:00
Dominik Stadler
4c6b940223 Fix some IDE warnings, Javadoc, useless asserts, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833293 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 18:55:33 +00:00
Dominik Stadler
574937ca00 Update Gradle wrapper to 4.6
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833292 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 18:54:06 +00:00
Dominik Stadler
1a6be199a2 Remove the older version of commons-compress and some possible remnants of xmlbeans-2.3.0
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833291 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 18:53:20 +00:00
PJ Fanning
c1ca3233c9 remove unnecessary xmlbeans jar manipulation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833288 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 17:19:54 +00:00
PJ Fanning
4c4c7d92ae update property names in build.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833287 13f79535-47bb-0310-9956-ffa450edef68
2018-06-10 16:39:24 +00:00
PJ Fanning
e908117b0b fix some deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833218 13f79535-47bb-0310-9956-ffa450edef68
2018-06-08 23:15:46 +00:00
Andreas Beeker
3245d7c809 remove obsolete dev classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833217 13f79535-47bb-0310-9956-ffa450edef68
2018-06-08 22:31:39 +00:00
PJ Fanning
74ff20d363 fix some deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833116 13f79535-47bb-0310-9956-ffa450edef68
2018-06-07 12:01:49 +00:00
PJ Fanning
232bf3a776 fix some javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833106 13f79535-47bb-0310-9956-ffa450edef68
2018-06-07 08:37:28 +00:00
PJ Fanning
726c7b3245 fix some javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833101 13f79535-47bb-0310-9956-ffa450edef68
2018-06-07 07:40:09 +00:00
PJ Fanning
e2195c505f use try with resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833096 13f79535-47bb-0310-9956-ffa450edef68
2018-06-07 06:03:35 +00:00
PJ Fanning
3581bba521 use spaces as indents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833095 13f79535-47bb-0310-9956-ffa450edef68
2018-06-07 05:58:10 +00:00
PJ Fanning
e59255c99d [bug-62435] Rename getAllEmbedds method to getAllEmbeddedParts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833090 13f79535-47bb-0310-9956-ffa450edef68
2018-06-06 22:30:57 +00:00
PJ Fanning
53bb443e64 [bug-62435] Rename getAllEmbedds method to getAllEmbeddedParts (getAllEmbedds is retained but deprecated)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833059 13f79535-47bb-0310-9956-ffa450edef68
2018-06-06 16:51:13 +00:00
PJ Fanning
fd90cb4ea7 fix test class name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1833056 13f79535-47bb-0310-9956-ffa450edef68
2018-06-06 16:27:02 +00:00
Andreas Beeker
a5b66c34a6 fix slaves
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832980 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 23:39:26 +00:00
Andreas Beeker
f72fc1d5f3 fix forbidden-apis for jdk10+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832979 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 23:29:09 +00:00
Andreas Beeker
fc2998c82e javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832978 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 22:44:18 +00:00
Andreas Beeker
792f556ded add beam slaves or politically correct "proud followers" :)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832977 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 22:16:18 +00:00
Andreas Beeker
2fb04cf51d #62187 - missing lib reference on integration build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832974 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 21:22:33 +00:00
Andreas Beeker
d8d076b73a #62187 - Compiling with Java 10 fails with ClassCastException / use commons-compress for zipbomb detection
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832789 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 22:09:11 +00:00
Andreas Beeker
611c15f412 sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832748 13f79535-47bb-0310-9956-ffa450edef68
2018-06-02 21:28:06 +00:00
Andreas Beeker
7088a68f1d sonar fixes and
disable closing of outputstream in ZipPackage.saveImpl() - see https://stackoverflow.com/questions/50646538/stream-close-exception-occures

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832746 13f79535-47bb-0310-9956-ffa450edef68
2018-06-02 20:29:35 +00:00
Andreas Beeker
d09cb8f9d8 sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832735 13f79535-47bb-0310-9956-ffa450edef68
2018-06-02 13:01:14 +00:00
Andreas Beeker
6ecad91893 sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832719 13f79535-47bb-0310-9956-ffa450edef68
2018-06-01 23:54:19 +00:00
Andreas Beeker
a6f20de472 #62355 - fix class names in maven build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832417 13f79535-47bb-0310-9956-ffa450edef68
2018-05-28 20:05:50 +00:00
Andreas Beeker
0551a75e82 clean ooxml-lib jars before build, because the typeloader class has been moved via #62355
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832414 13f79535-47bb-0310-9956-ffa450edef68
2018-05-28 19:43:19 +00:00
Andreas Beeker
09fa9890a6 #62355 - unsplit packages - 4 - open HPSF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832361 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 22:15:59 +00:00
Andreas Beeker
e2ec4ebe95 #62355 - unsplit packages - 3 - only imports
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832360 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 22:13:31 +00:00
Andreas Beeker
1c0834c436 #62355 - unsplit packages - 2 - modified classes (not only imports)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832359 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 22:01:33 +00:00
Andreas Beeker
54f191b613 #62355 - unsplit packages - 1 - moved classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832358 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 21:59:18 +00:00
PJ Fanning
748c8f2583 fix spelling
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832357 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 21:34:42 +00:00
PJ Fanning
54c4c5829a [githib-110] rename text segment class. This closes #110
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832354 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 20:59:52 +00:00
PJ Fanning
917dace980 [githib-110] rename text segment class. This closes #110
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832352 13f79535-47bb-0310-9956-ffa450edef68
2018-05-27 20:58:21 +00:00
PJ Fanning
70055b806d remove xmlbeans source
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832256 13f79535-47bb-0310-9956-ffa450edef68
2018-05-25 17:29:39 +00:00
Andreas Beeker
8c06c5f51a sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832229 13f79535-47bb-0310-9956-ffa450edef68
2018-05-25 10:20:44 +00:00
Andreas Beeker
24020f66af sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832131 13f79535-47bb-0310-9956-ffa450edef68
2018-05-23 22:29:40 +00:00
Andreas Beeker
b144ace936 sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832067 13f79535-47bb-0310-9956-ffa450edef68
2018-05-22 22:39:22 +00:00
Andreas Beeker
1d6a1c4072 sonar fixes - null dereference
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831992 13f79535-47bb-0310-9956-ffa450edef68
2018-05-21 23:17:57 +00:00
Andreas Beeker
e268b16754 #62393 - Inconsistent slide import behavior depending on Mac OS X Version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831974 13f79535-47bb-0310-9956-ffa450edef68
2018-05-21 14:20:11 +00:00
Andreas Beeker
04bbc80292 #62041 - TestFonts fails on Mac
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831948 13f79535-47bb-0310-9956-ffa450edef68
2018-05-20 22:22:58 +00:00
Andreas Beeker
5c71e10c46 #62051 - Two shapes have the same shapeId within the same slide.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831947 13f79535-47bb-0310-9956-ffa450edef68
2018-05-20 22:00:14 +00:00
Andreas Beeker
0be1b75834 #61633 - Zero width shapes aren't rendered
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831923 13f79535-47bb-0310-9956-ffa450edef68
2018-05-19 21:05:10 +00:00
Andreas Beeker
508e6da4e5 remove test code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831754 13f79535-47bb-0310-9956-ffa450edef68
2018-05-17 05:35:58 +00:00
Andreas Beeker
f35e818fa2 #62037 - SlideNames should not be null but have a default as if accessed by VBA
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831745 13f79535-47bb-0310-9956-ffa450edef68
2018-05-16 21:57:49 +00:00
Andreas Beeker
0e8736dcda #62381 - Fix rendering of AutoShapes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831743 13f79535-47bb-0310-9956-ffa450edef68
2018-05-16 20:30:53 +00:00
Nick Burch
c079795f4e List a few more missing functions as inline-comments, based on definitions from functionMetadata.txt
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831572 13f79535-47bb-0310-9956-ffa450edef68
2018-05-14 14:25:00 +00:00
Andreas Beeker
5bc002c749 Ignore IntelliJ project files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831324 13f79535-47bb-0310-9956-ffa450edef68
2018-05-10 10:14:23 +00:00
Greg Woolsey
bf17600457 A few more places I should never have introduced Cell as a parameter, sine CellReference is all that is needed, faster, and allows for undefined cells.
Backward compatible for the few people using it so far, with comments to point to the faster methods.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831203 13f79535-47bb-0310-9956-ffa450edef68
2018-05-08 19:03:52 +00:00
Andreas Beeker
02178bac2b Random test value/file length resulted in occasionally failures
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831127 13f79535-47bb-0310-9956-ffa450edef68
2018-05-07 20:50:32 +00:00
Andreas Beeker
5961b640a5 add convenience method for files to FileMagic
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830782 13f79535-47bb-0310-9956-ffa450edef68
2018-05-02 18:33:23 +00:00
Andreas Beeker
17fdb3188c add additional exception info to failing IOUtils.toByteArray
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830779 13f79535-47bb-0310-9956-ffa450edef68
2018-05-02 17:29:24 +00:00
Andreas Beeker
066a8a0b42 add license header
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830725 13f79535-47bb-0310-9956-ffa450edef68
2018-05-02 05:36:15 +00:00
Andreas Beeker
83eb0ca821 Cleanup Biff8EncryptionKey usage and use HPSF constants instead of duplicated strings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830705 13f79535-47bb-0310-9956-ffa450edef68
2018-05-01 18:22:00 +00:00
PJ Fanning
32b370fb67 [githib-107] add areas function support. Thanks to Inji Hanbin. This closes #107
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830685 13f79535-47bb-0310-9956-ffa450edef68
2018-05-01 14:47:29 +00:00
Dominik Stadler
8fc6199641 Allow one more add-opens to silence one more warning seen in Java 9/Java 10 currently
Use latest JDK 10 versions

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830551 13f79535-47bb-0310-9956-ffa450edef68
2018-04-30 11:21:31 +00:00
Dominik Stadler
0106bb30e8 Need to switch to ASM 6.0 as well to make the coverage reports to work, unfortunately the asm-all package seems to be gone, so we need to use three jar files now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830542 13f79535-47bb-0310-9956-ffa450edef68
2018-04-30 09:40:36 +00:00
Dominik Stadler
d7b3f79da8 Update to JaCoCo 0.8.1 to support Java 10 for JaCoCo runs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830535 13f79535-47bb-0310-9956-ffa450edef68
2018-04-30 07:59:14 +00:00
Andreas Beeker
34c9cffe5d disable ImageIO cache - probably need to set it in every test class or disable it in the beginning of all tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830520 13f79535-47bb-0310-9956-ffa450edef68
2018-04-29 21:12:06 +00:00
Andreas Beeker
e0f7014503 #59893 - Forbid calls to InputStream.available
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830400 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 21:38:19 +00:00
Dominik Stadler
2574fd2d3d Streamline assertion-usage in some tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830296 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 06:15:05 +00:00
Dominik Stadler
d219fe085a Update to forbidden-apis 2.5
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830131 13f79535-47bb-0310-9956-ffa450edef68
2018-04-26 04:11:10 +00:00
Dominik Stadler
ad92fcca9e Fix setting active cell in .xls by populating field_6_refs whenever row/column changes, this fixes bug 61905
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830115 13f79535-47bb-0310-9956-ffa450edef68
2018-04-25 20:14:07 +00:00
Andreas Beeker
2d6380833a Bug 62187 - commit Commons Compress unrelated changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1830061 13f79535-47bb-0310-9956-ffa450edef68
2018-04-25 10:03:39 +00:00
Andreas Beeker
6dc8c3034e #61459 - handle slide layouts in extractor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829677 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 20:00:46 +00:00
Andreas Beeker
5189313eb4 #61459 - HSLFShape.getShapeName() returns name of shapeType and not the shape name
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829656 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 13:45:18 +00:00
Andreas Beeker
ab390ce170 #62319 - Decommission XSLF-/PowerPointExtractor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829653 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 12:52:59 +00:00
Dominik Stadler
bc436fcc3d OOXMLLite: improve progress output: count test-classes, not single test-methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829641 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 09:46:47 +00:00
Dominik Stadler
2d7fdbc4bc Fix unit test broken with previous check-in
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829640 13f79535-47bb-0310-9956-ffa450edef68
2018-04-20 09:45:28 +00:00
Andreas Beeker
15de4bf7a9 Nullpointer fix for slideshow extractor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829538 13f79535-47bb-0310-9956-ffa450edef68
2018-04-19 13:34:52 +00:00
Dominik Stadler
8632f0c47e Add some unit-tests for setActiveCell(), although bug 61905 reports that Excel still does not read this correctly for HSSF workbooks
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829518 13f79535-47bb-0310-9956-ffa450edef68
2018-04-19 08:37:17 +00:00
Greg Woolsey
edd87f05b7 add some javadoc to warn that stale cached formula cell values may result in incorrect evaluations, and what to do about it (evaluate formula cells before asking the rule if it applies).
Doing it for the user turns out to not be that easy, as the FormulaEvaluator instance in use is not known in this context.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829471 13f79535-47bb-0310-9956-ffa450edef68
2018-04-18 18:25:08 +00:00
Andreas Beeker
4ba2d64a50 Bug 62092 - Text not extracted from grouped text shapes in HSLF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1829453 13f79535-47bb-0310-9956-ffa450edef68
2018-04-18 15:02:02 +00:00
Dominik Stadler
6829dbd447 Close resources correctly when opening encrypted documents in the TextExtractor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828378 13f79535-47bb-0310-9956-ffa450edef68
2018-04-04 19:41:16 +00:00
Dominik Stadler
e9121036cc Bug 62165: Do not close stream when opening succeeds
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828377 13f79535-47bb-0310-9956-ffa450edef68
2018-04-04 19:41:10 +00:00
Dominik Stadler
971c52347e Create some directories if not existing in testcoveragereport
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828376 13f79535-47bb-0310-9956-ffa450edef68
2018-04-04 19:41:03 +00:00
Dominik Stadler
eb4e20cd69 Try to avoid one NPE that popped up in commoncrawl-corpus tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828375 13f79535-47bb-0310-9956-ffa450edef68
2018-04-04 19:40:54 +00:00
PJ Fanning
af19295590 fix error message
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828364 13f79535-47bb-0310-9956-ffa450edef68
2018-04-04 16:55:46 +00:00
PJ Fanning
16d25b62af [bug-62254] update offset function to support optional offset values
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828288 13f79535-47bb-0310-9956-ffa450edef68
2018-04-03 21:51:30 +00:00
Dominik Stadler
2ce07693c5 Add unit tests to include more required classes in poi-ooxml-schemas, add test for bug 62174 so additional schema-classes are included
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828180 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 17:16:16 +00:00
Dominik Stadler
9af2dd7824 OOXMLLite: IDE warnings and add an additional listener to print out progress during running tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828179 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 17:16:07 +00:00
Dominik Stadler
f440933277 Close resources in tests and in case of Exceptions and use try-with-resources. Close the socket-connection during encrpyting/decrypting as soon as it is not needed any more.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828178 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 17:16:01 +00:00
Dominik Stadler
48c8b9af81 Update excludes in OOXMLLite
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828177 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 17:15:49 +00:00
Dominik Stadler
2be766f267 Bug 61267: detect Word v2 files and report that they are not supported in Apache POI
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828176 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 17:15:42 +00:00
PJ Fanning
35fd4f85aa [bug-62216] add test case
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828174 13f79535-47bb-0310-9956-ffa450edef68
2018-04-02 15:59:21 +00:00
PJ Fanning
0ec274d46e [bug-62216] Fix issue with SXSSF error cells
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828144 13f79535-47bb-0310-9956-ffa450edef68
2018-04-01 16:16:37 +00:00
PJ Fanning
54e533889a [bug-62121] Fixed Power function of negative numbers. Thanks to Bob van den Berge. This closes #104
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828143 13f79535-47bb-0310-9956-ffa450edef68
2018-04-01 15:52:13 +00:00
PJ Fanning
3f19729834 [github-103] take latest changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1828142 13f79535-47bb-0310-9956-ffa450edef68
2018-04-01 15:37:14 +00:00
PJ Fanning
6ca71f0bb9 add missing license
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1827177 13f79535-47bb-0310-9956-ffa450edef68
2018-03-19 09:22:46 +00:00
PJ Fanning
aea347d94a [github-103] hsmf: support writing properties. Thanks to Dominik Hölzl. This closes #103
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1827173 13f79535-47bb-0310-9956-ffa450edef68
2018-03-19 09:10:38 +00:00
PJ Fanning
47fb3691f7 [bug-62176] synchronize temp dir creation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1826655 13f79535-47bb-0310-9956-ffa450edef68
2018-03-13 15:12:00 +00:00
Dominik Stadler
fd39985247 Add test for setters/getters of XWPFRun to include morre generated classes in poi-ooxml-schemas.
See also https://github.com/centic9/poi-on-android/issues/31

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1826464 13f79535-47bb-0310-9956-ffa450edef68
2018-03-11 21:11:11 +00:00
Andreas Beeker
58a0a100f5 #62159 - Support XML signature over windows certificate store
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825948 13f79535-47bb-0310-9956-ffa450edef68
2018-03-06 00:07:20 +00:00
Dominik Stadler
ff96f4c64d Reduce testcase some more, add missing license header
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825851 13f79535-47bb-0310-9956-ffa450edef68
2018-03-05 05:14:56 +00:00
Dominik Stadler
feace0e745 Add unit test which verifies that ThresholdInputStream can be used. This currently fails with Java 10 because the reflection relies on internals of class ZipFile that were changed.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825818 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 13:33:38 +00:00
Dominik Stadler
fb2f23678f Some IntelliJ and Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825817 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 13:33:31 +00:00
Dominik Stadler
f3addac5e0 Fix compiling with current JDK 10 RC build, OOXML-Tests are still failing due to ThresholdInputStream, though.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825816 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 13:33:20 +00:00
Dominik Stadler
582c21ce86 Add job to build with latest available JDK 10 early access build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825815 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 13:33:12 +00:00
PJ Fanning
aee50698a4 use xmlunit for xml diffs in unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825810 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 12:24:44 +00:00
PJ Fanning
3716f4a556 remove some deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825807 13f79535-47bb-0310-9956-ffa450edef68
2018-03-04 11:47:21 +00:00
Dominik Stadler
d720ad82b6 Add JDK 10 and new slaves to job POI-DSL-Test-Environment
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825782 13f79535-47bb-0310-9956-ffa450edef68
2018-03-03 19:05:58 +00:00
PJ Fanning
8d4f3fde68 remove some casts to short
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825749 13f79535-47bb-0310-9956-ffa450edef68
2018-03-03 01:48:46 +00:00
PJ Fanning
2688ce9d82 fix license check failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825547 13f79535-47bb-0310-9956-ffa450edef68
2018-02-28 10:30:05 +00:00
PJ Fanning
b7aafa03fb fix problematic javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825542 13f79535-47bb-0310-9956-ffa450edef68
2018-02-28 10:01:52 +00:00
PJ Fanning
dcbe14abd0 remove XDDFChart workaround that saved workbook to temp file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825541 13f79535-47bb-0310-9956-ffa450edef68
2018-02-28 09:54:58 +00:00
PJ Fanning
590f27e86d [github-98] write data in respective Column in case of XDDFChart. Thanks to Sandeep Tiwari. This closes #98
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825521 13f79535-47bb-0310-9956-ffa450edef68
2018-02-27 23:12:53 +00:00
PJ Fanning
daeea27e14 use Integer.toString to convert ints to strings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825457 13f79535-47bb-0310-9956-ffa450edef68
2018-02-27 14:24:50 +00:00
PJ Fanning
fef8c69085 tidy up API for font index
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825409 13f79535-47bb-0310-9956-ffa450edef68
2018-02-26 20:26:48 +00:00
PJ Fanning
4221ccebda [bug-62055] Fix XSSFImportFromXML table resize. Thanks to Leonard Kappe. This closes #99
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825315 13f79535-47bb-0310-9956-ffa450edef68
2018-02-25 17:06:19 +00:00
Greg Woolsey
d144f09d2f Fix for bug #62130. Turns out there were cases when a workbook with multiple edit/save cycles on the same instance would save stale cell data, resulting in incorrect copies.
Includes new unit test.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825277 13f79535-47bb-0310-9956-ffa450edef68
2018-02-24 21:30:47 +00:00
Greg Woolsey
9dff7e2f09 The table auto-filter range should not include table footer rows, while the table range does. POI was using the same for both regardless of footers.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825182 13f79535-47bb-0310-9956-ffa450edef68
2018-02-23 23:37:04 +00:00
PJ Fanning
753f6f9dc6 further uptake of int methods for font lookups
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825103 13f79535-47bb-0310-9956-ffa450edef68
2018-02-22 22:32:25 +00:00
PJ Fanning
104d4dac06 [bug-62018] use ints to index fonts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824826 13f79535-47bb-0310-9956-ffa450edef68
2018-02-20 00:25:43 +00:00
PJ Fanning
1f0cf7d6e2 apply changes from com.github.pjfanning:xmlbeans
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824564 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 22:55:05 +00:00
PJ Fanning
5543eb9de8 add xmlbeans code (latest from xmlbeans svn)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824563 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 22:41:27 +00:00
PJ Fanning
47c1695a08 add apache license to new examples due to rat check failures
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824489 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 14:08:28 +00:00
Nick Burch
24120f228b Unit test to try to reproduce bug #62108 (currenly works though...)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824451 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 11:47:24 +00:00
Nick Burch
269ea2617f Add some write/change code as well for Groovy
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824378 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 22:16:07 +00:00
Nick Burch
8417d99ee6 Commit examples from the JVM Languages page
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824371 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 21:45:47 +00:00
PJ Fanning
51f99aa616 [github-94] Add Range Copier. Thanks to Dragan Jovanović. This closes #94
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824266 13f79535-47bb-0310-9956-ffa450edef68
2018-02-14 20:30:01 +00:00
Dominik Stadler
afc3085684 Fix some IntelliJ warnings in XDGF area
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823988 13f79535-47bb-0310-9956-ffa450edef68
2018-02-12 15:34:11 +00:00
Alain Béarez
2603eccc96 [bug-57369] support for major and minor unit on XDDFChart axes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823963 13f79535-47bb-0310-9956-ffa450edef68
2018-02-12 12:59:38 +00:00
Mark Murphy
0f4c54023e #55953 Added methods to position a table
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823920 13f79535-47bb-0310-9956-ffa450edef68
2018-02-12 04:12:06 +00:00
Andreas Beeker
b6fc14300b Update JAXB classes with fixed javadocs for java 8 doclint
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823910 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 22:09:58 +00:00
Mark Murphy
ac7311994a Added missing table border types to XWPF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823904 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 21:31:32 +00:00
Andreas Beeker
11522974cf #61947 - Remove deprecated classes (POI 4.0.0)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823894 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 20:45:38 +00:00
Andreas Beeker
22659beef2 #62096 - Add support for tabstops
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823893 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 20:39:18 +00:00
Andreas Beeker
ae65b5cb4a FindBugs fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823892 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 20:35:11 +00:00
Mark Murphy
32f3b22d08 Add ability to set get and remove outer borders for tables
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823873 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 18:43:20 +00:00
Mark Murphy
11f79c30c9 Corrected spelling on a few classpath entries
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823799 13f79535-47bb-0310-9956-ffa450edef68
2018-02-10 22:16:32 +00:00
Dominik Stadler
316041521c Bug 62042: Adjust gradle build to properly set the locale
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823596 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 19:34:22 +00:00
Dominik Stadler
d0adab9aee Various smaller adjustments: Remove filename in test, remove unused parameters, fix a few simple typos in JavaDoc and add more JavaDoc and some more tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823595 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 19:34:16 +00:00
PJ Fanning
ac763a24ad fix further typo in exception message
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822948 13f79535-47bb-0310-9956-ffa450edef68
2018-02-02 11:59:58 +00:00
Dominik Stadler
a487bee768 Fix small typo, closes PR #97 on Github.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822937 13f79535-47bb-0310-9956-ffa450edef68
2018-02-02 10:35:48 +00:00
PJ Fanning
16c68a4f01 add mockito dependency to sonar pom.xml to fix maven-dsl build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822785 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 10:26:45 +00:00
PJ Fanning
940f438eaf fix findbug issues introduced recently
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822758 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 05:52:46 +00:00
PJ Fanning
3f2ae2ee4b fix use of forbidden apis in row shift code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822743 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 05:31:31 +00:00
PJ Fanning
5afe7c20ab use spaces for indents in some files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822720 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 00:09:51 +00:00
PJ Fanning
bf20eafa7d [bug-55713] Wrong ErrorStyle for DataValidations. Thanks to Philemon Schucker. This closes #95
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822719 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 00:00:17 +00:00
PJ Fanning
de2b6ba095 add missing licenses to source code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822641 13f79535-47bb-0310-9956-ffa450edef68
2018-01-30 13:31:16 +00:00
PJ Fanning
25634cf55f [github-81] Formula adjusting in context of column shifting. Thanks to Dragan Jovanović. This closes #81
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822639 13f79535-47bb-0310-9956-ffa450edef68
2018-01-30 13:16:49 +00:00
PJ Fanning
0acd091549 add byte-buddy and objenesis dependencies for mockito
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822636 13f79535-47bb-0310-9956-ffa450edef68
2018-01-30 12:57:47 +00:00
PJ Fanning
4637ffcbca [bug-62038] add mockito based unit test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822517 13f79535-47bb-0310-9956-ffa450edef68
2018-01-29 15:21:59 +00:00
PJ Fanning
6dc0f74269 ignore broken test temporarily
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822409 13f79535-47bb-0310-9956-ffa450edef68
2018-01-27 14:18:05 +00:00
PJ Fanning
ee8dc42e36 some changes to allow shared string table to be subclassed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822404 13f79535-47bb-0310-9956-ffa450edef68
2018-01-27 13:30:52 +00:00
PJ Fanning
a6faf34d92 [github-90] change default DSIG algorithm to SHA256. Thanks to Jörn Franke. This closes #90
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822293 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 13:30:32 +00:00
PJ Fanning
b2c0c7907c add gradle wrapper
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822290 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 12:53:02 +00:00
PJ Fanning
aca52d2a51 bouncycastle 1.59
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822285 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 12:38:49 +00:00
PJ Fanning
7e434aa155 [bug-62038] handle null font size in XSLFTextRun copy
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822253 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 07:51:57 +00:00
Alain Béarez
a5d2574538 code cleaning according to code review recommendations (closes #93)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822224 13f79535-47bb-0310-9956-ffa450edef68
2018-01-25 19:59:52 +00:00
Tim Allison
db3e8697f7 related to Bug 61991 -- include docx in test suite to trigger inclusion of CTPictureBase
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822033 13f79535-47bb-0310-9956-ffa450edef68
2018-01-23 18:05:23 +00:00
PJ Fanning
48a5e63ad7 [Bug 61972] Adding chart in Document of MS-Word File without reading Temp MS-Word File. Thanks to Sandeep Tiwari. This closes #91
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1821764 13f79535-47bb-0310-9956-ffa450edef68
2018-01-20 23:01:18 +00:00
PJ Fanning
f628f27f5b Remove use of xmlbeans 2.3.0 in build to simplify our build dependencies
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1820869 13f79535-47bb-0310-9956-ffa450edef68
2018-01-11 12:25:12 +00:00
PJ Fanning
0e8b027dbf Remove use of xmlbeans 2.3.0 in build to simplify our build dependencies
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1820868 13f79535-47bb-0310-9956-ffa450edef68
2018-01-11 12:17:46 +00:00
PJ Fanning
d12d1afa23 remove unnecessary test override
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1820652 13f79535-47bb-0310-9956-ffa450edef68
2018-01-09 12:23:37 +00:00
Alain Béarez
5f0072983b introduce XDDFShapeProperties as user model API (closes #72 from GitHub)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1820369 13f79535-47bb-0310-9956-ffa450edef68
2018-01-06 02:51:53 +00:00
PJ Fanning
d4df69570c [github-86] expose language for Text Runs. Thanks to Geoff Baskwill. This closes #86
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1820242 13f79535-47bb-0310-9956-ffa450edef68
2018-01-04 23:32:14 +00:00
Dominik Stadler
859ce548a4 Deprecate methods with typos and provide new ones.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819776 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:48 +00:00
Dominik Stadler
0fd44af52b Remove unused property in build.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819775 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:42 +00:00
Dominik Stadler
6ac8433953 Bug 61937: Add more javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819774 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:38 +00:00
Dominik Stadler
214695e09c Bug 61543: do not fail with "part already exists" when tables are created/removed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819773 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:33 +00:00
Dominik Stadler
e05a94e8ee Bug 61550: Add more information to exception text and verify that it is thrown
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819772 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:26 +00:00
Dominik Stadler
3072fd0674 Add .gitattribute file and set lf for one sample-file, see bug 61609
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819771 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:19 +00:00
Dominik Stadler
33d5bf0961 Bug 61648: Test Sheet.setArrayFormula for SXSSF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819770 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:15 +00:00
Dominik Stadler
bc4eb140c5 Add test which verifies that bug 61652 is not appearing any more on latest trunk
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819769 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:39:08 +00:00
Dominik Stadler
d4e89724c7 Update some tests and IntelliJ warnings
Ignore disabled test instead of not listing it in the test-report at all

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819768 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 14:38:58 +00:00
PJ Fanning
d10ec59751 Bug-61947 remove deprecated method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819766 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 13:05:31 +00:00
PJ Fanning
272e33e4a8 Bug-61947 remove deprecated method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819763 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 12:23:06 +00:00
PJ Fanning
822608f1a6 Bug-61947 remove deprecated method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819762 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 12:13:53 +00:00
PJ Fanning
ef89809723 Bug-61947 add back deprecated methods (removed by accident)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819761 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 11:54:01 +00:00
PJ Fanning
0f390dab17 Bug-61947 remove deprecated method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819759 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 11:47:53 +00:00
PJ Fanning
186736ce11 Bug-61947 remove deprecated method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819758 13f79535-47bb-0310-9956-ffa450edef68
2018-01-01 11:42:43 +00:00
Andreas Beeker
95bbbe5678 #61797 - Embed Excel / Ole objects into powerpoint
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819710 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 01:14:08 +00:00
Andreas Beeker
45c73e1741 #61943 - SL Common: narrow generics definition because of tighter java9 checks
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819709 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 01:05:59 +00:00
Andreas Beeker
2a18d2d4db #61942 - Refactor PackagePartName handling and add getUnusedPartIndex method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819708 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 00:56:07 +00:00
Andreas Beeker
2dc2933f9a #61941 - Move Ole marker generation to Ole10Native
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819706 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 00:22:43 +00:00
Andreas Beeker
7d3876cf12 #61940 - Replace ClassID statics with enum
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819705 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 00:13:38 +00:00
Andreas Beeker
4073f568cd #61939 - Provide schema for AlternateContent - provide new ooxml-schemas-1.4.jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819704 13f79535-47bb-0310-9956-ffa450edef68
2017-12-31 00:01:04 +00:00
Andreas Beeker
e262b250d7 #61939 - Provide schema for AlternateContent - provide new ooxml-schemas-1.4.jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819690 13f79535-47bb-0310-9956-ffa450edef68
2017-12-30 22:17:55 +00:00
Yegor Kozlov
ca7549131b Bug 58106: when a cell with a 'master' shared formula is removed, the next cell in the range becomes the master
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819623 13f79535-47bb-0310-9956-ffa450edef68
2017-12-30 16:34:57 +00:00
Yegor Kozlov
ff6f06cc27 Bugzilla 61116: Formula evaluation fails when using matrix addition within index function call
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819596 13f79535-47bb-0310-9956-ffa450edef68
2017-12-30 13:11:56 +00:00
Dominik Stadler
24c2b4fabe Disable test which currently breaks with every little change to the resulting XML
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819424 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 13:46:00 +00:00
Dominik Stadler
7a50340cbf Bug 61665: Enhance SSPerformanceTest some more to add a warmup run and allow to run with unsynchronized XmlBeans
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819417 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 10:53:40 +00:00
Dominik Stadler
9eb8fedf5d Fix bug 61787, which was introduced by bug 58067: Change how deleted content is detected to not incorrectly see too much text as deleted.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819405 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 08:45:51 +00:00
Dominik Stadler
451c26874a Bug 61798: Fix usage of getLastCellNum(), unfortunately this is a bit misleading compared to getFirstCellNum()...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819404 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 08:45:43 +00:00
Dominik Stadler
eb8fac4f77 Bug 61911: Avoid IndexOutOfBounds access when reading pictures
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819403 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 08:45:36 +00:00
Dominik Stadler
822188c49a Fix IntelliJ warnings and code formatting, generalize ExcelToHtmlUtils, use try-with-resources, update/enhance JavaDoc somewhat
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819402 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 08:45:26 +00:00
Greg Woolsey
31ae97e748 Added a couple missing null checks.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819398 13f79535-47bb-0310-9956-ffa450edef68
2017-12-28 08:17:33 +00:00
Greg Woolsey
a7a3293fb9 Implement DMAX and DSUM functions, following the pattern from DMIN.
Refactored the D* function enum to have instances return the function implementation instances rather than using a case construct, now that Java 8 is required.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819376 13f79535-47bb-0310-9956-ffa450edef68
2017-12-27 22:33:03 +00:00
PJ Fanning
50c0ba01c6 Remove misleading SXSSF logging
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819282 13f79535-47bb-0310-9956-ffa450edef68
2017-12-26 11:02:45 +00:00
Yegor Kozlov
64d98e7872 Bug 61869: updating a cell with shared formula produces an unreadable file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818818 13f79535-47bb-0310-9956-ffa450edef68
2017-12-20 16:30:13 +00:00
PJ Fanning
12f82dd617 use try with resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818786 13f79535-47bb-0310-9956-ffa450edef68
2017-12-20 12:15:35 +00:00
PJ Fanning
7cdaeba856 use try with resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818781 13f79535-47bb-0310-9956-ffa450edef68
2017-12-20 11:47:52 +00:00
PJ Fanning
57dcaedde7 use StandardCharsets
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818629 13f79535-47bb-0310-9956-ffa450edef68
2017-12-19 00:33:16 +00:00
PJ Fanning
bfff3c7bd8 use StandardCharsets
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818628 13f79535-47bb-0310-9956-ffa450edef68
2017-12-19 00:23:52 +00:00
PJ Fanning
af11cb1023 use non deprecated method for adding string to shared strings table
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818623 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 20:54:39 +00:00
Yegor Kozlov
1ccc7bfd46 Bug 61859: support for evaluating comparison operators in array mode, detect array mode from formula ptgs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818587 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 15:54:50 +00:00
PJ Fanning
9ab4245730 Bug-61906 fix javadoc issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818248 13f79535-47bb-0310-9956-ffa450edef68
2017-12-15 09:13:16 +00:00
PJ Fanning
e34387b2cf Bug-61906 add API for working with RichStringText and deprecate API methods that use CTRst
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818247 13f79535-47bb-0310-9956-ffa450edef68
2017-12-15 09:09:50 +00:00
PJ Fanning
b3e2c19784 Bug-61792 simplify sxssf code that writes chars
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818223 13f79535-47bb-0310-9956-ffa450edef68
2017-12-15 00:54:52 +00:00
Javen O'Neal
525952b625 delete commented out code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817976 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 06:39:01 +00:00
Javen O'Neal
5530f8a831 bug 57423: add unit test demonstrating corrupted workbook where CTRow xmlbeans are not in ascending order in the CTWorksheet; unit test adapted from Luca
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817975 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 06:21:19 +00:00
Nick Burch
8498e4d88c #61765 Another HSSF Workbook name found from (unknown) third party software produced files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817812 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 19:52:53 +00:00
Greg Woolsey
08e25fe46e Bug 61882 - Some paths can create an XSSFColor instance with a null CTColor reference
test file

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817797 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 17:33:00 +00:00
Greg Woolsey
11e60eb77e Bug 61882 - Some paths can create an XSSFColor instance with a null CTColor reference
Protect against this in the future by introducing a factory method to create XSSFColor instances from a CTColor instance and the associated workbook style indexed color map.

If the CTColor instance is null, the factory returns null.  All callers already are prepared for a null instance, but many had their own null check on the CTColor object.  This centralizes that.

This also further forces the requirement for the indexed color map.  Any time a color is created, the workbook or styleTable is available in the same context, so passing this is extra parameter is trivial and allows XSSFColor to properly reference custom/themed indexed colors.

Did not remove any methods yet, only deprecated them.  Changed the signature to one internal test-only constructor.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817796 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 17:30:04 +00:00
Andreas Beeker
185a66aed5 remove package name to ease the output
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817600 13f79535-47bb-0310-9956-ffa450edef68
2017-12-09 12:06:59 +00:00
Andreas Beeker
2c2028ede6 #61881 - handle invalid font names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817599 13f79535-47bb-0310-9956-ffa450edef68
2017-12-09 11:44:19 +00:00
Greg Woolsey
41981a4ac9 #61841
Add @Override annotations, clean up imports

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817331 13f79535-47bb-0310-9956-ffa450edef68
2017-12-07 01:54:21 +00:00
Greg Woolsey
cbd17b9320 #61841 fix typo in method name
Fixing the typo pointed out by PJ Fanning, thanks for the proof read!

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817325 13f79535-47bb-0310-9956-ffa450edef68
2017-12-06 23:53:25 +00:00
Greg Woolsey
94c2b64692 Bug #61841 - Unnecessary long computation when evaluating VLOOKUP on all column reference
always with the missing license...

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817254 13f79535-47bb-0310-9956-ffa450edef68
2017-12-06 00:46:42 +00:00
Greg Woolsey
6390202491 Bug #61841 - Unnecessary long computation when evaluating VLOOKUP on all column reference
Found some optimizations in the general evaluation framework related to blank cells in rows beyond the last defined row of a sheet.

I don't see any issue with passing a bit of context down deeper into this framework, as it's all POI-internal and only had one calling path.

See the above bug for the performance analysis.  Not specifically related to VLOOKUP, but improves that case by more than 2/3 as well.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817252 13f79535-47bb-0310-9956-ffa450edef68
2017-12-06 00:15:51 +00:00
PJ Fanning
5f4f1b5846 use try-with-resources in more places
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817247 13f79535-47bb-0310-9956-ffa450edef68
2017-12-05 22:31:59 +00:00
PJ Fanning
89a788ea5b use try-with-resources in more places
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1817238 13f79535-47bb-0310-9956-ffa450edef68
2017-12-05 21:23:44 +00:00
Javen O'Neal
58114c6d8c bug 61840: close workbook to prevent resource leak in unit test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816893 13f79535-47bb-0310-9956-ffa450edef68
2017-12-01 17:51:19 +00:00
Javen O'Neal
79250e916f bug 61840: add unit test showing that shiftRows does not produce #REF! formula errors if cells are not shifted above the first row
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816892 13f79535-47bb-0310-9956-ffa450edef68
2017-12-01 17:47:29 +00:00
Nick Burch
e8234fd032 Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816453 13f79535-47bb-0310-9956-ffa450edef68
2017-11-27 14:05:17 +00:00
Nick Burch
b967299429 Bump library version to match Ant defined version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816445 13f79535-47bb-0310-9956-ffa450edef68
2017-11-27 12:42:47 +00:00
Alain Béarez
c795f2e793 XDDF usermodel for Charts closes #68 on GitHub
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816383 13f79535-47bb-0310-9956-ffa450edef68
2017-11-26 14:03:01 +00:00
Andreas Beeker
2cda98a4aa #61809 - Infinite loop in SectionIDMap.get() and .put()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816205 13f79535-47bb-0310-9956-ffa450edef68
2017-11-24 01:02:20 +00:00
PJ Fanning
76a16ba175 use try with resources in examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816189 13f79535-47bb-0310-9956-ffa450edef68
2017-11-23 20:03:25 +00:00
PJ Fanning
3e4e43b28b use try with resources in examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816187 13f79535-47bb-0310-9956-ffa450edef68
2017-11-23 19:28:36 +00:00
Dominik Stadler
7367d2f1a3 Don't try to collect junit results for Maven when we only run Sonar-tasks and thus skip unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816186 13f79535-47bb-0310-9956-ffa450edef68
2017-11-23 18:54:17 +00:00
Dominik Stadler
d77e980e44 Change order of handling shape-types in copy() as FreeFormShape derives from AutoShape and thus would have not been copied correctly currently
Fix some Javadoc, some warnings and code duplications

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816185 13f79535-47bb-0310-9956-ffa450edef68
2017-11-23 18:54:11 +00:00
Dominik Stadler
d6f97af799 Ensure that the tempdir exists when we use ImageIO in one of the tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816046 13f79535-47bb-0310-9956-ffa450edef68
2017-11-22 12:25:11 +00:00
PJ Fanning
e22d67682f add TestStringCodepointsIterable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816020 13f79535-47bb-0310-9956-ffa450edef68
2017-11-22 09:57:45 +00:00
PJ Fanning
d695f8ad68 use codepoint iterator in a few places
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815998 13f79535-47bb-0310-9956-ffa450edef68
2017-11-22 01:07:24 +00:00
PJ Fanning
268bcdbc2d add forbidden api checks for non-Locale toLowerCase and toUpperCase
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815994 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 22:10:48 +00:00
PJ Fanning
0675acb64a add forbidden api checks for non-Locale toLowerCase and toUpperCase
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815989 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 21:33:51 +00:00
PJ Fanning
2b02a97d6a remove more uses of Character.toUpperCase
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815988 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 21:11:07 +00:00
Dominik Stadler
5bf0a46aec Try to set java.io.tmpdir for tests to avoid the strange permission errors that we see in CI-builds
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815963 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 17:32:48 +00:00
Dominik Stadler
90e72ea9fc Ensure that no old version of commons-codec is lingering around and causes hard to find build errors locally
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815952 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 16:29:01 +00:00
Dominik Stadler
2f755d8d9b Try if using a local temporary directory avoids the permission errors in unit tests in the Maven runs:
* Collect JUnit results
* Set java.io.tmpdir in Maven unit test runs

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815951 13f79535-47bb-0310-9956-ffa450edef68
2017-11-21 16:28:07 +00:00
PJ Fanning
c1ae77c8ce [bug-61792] basic test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815873 13f79535-47bb-0310-9956-ffa450edef68
2017-11-20 23:58:13 +00:00
PJ Fanning
d4f15fafa9 [bug-61792] some changes to avoid iterating over chars of Strings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815871 13f79535-47bb-0310-9956-ffa450edef68
2017-11-20 23:35:36 +00:00
PJ Fanning
d99e4ea649 upgrade to commons-codec 1.11
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815852 13f79535-47bb-0310-9956-ffa450edef68
2017-11-20 20:46:16 +00:00
Dominik Stadler
9a7358e348 Handle case where the JaCoCo zip file is available, but the extracted files are missing, not sure how that happens, but we see it on some CI machines...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815755 13f79535-47bb-0310-9956-ffa450edef68
2017-11-19 19:53:44 +00:00
Mark Murphy
c37a85d974 javadocs and Quick page improvements for XSSF Header/Footer
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815706 13f79535-47bb-0310-9956-ffa450edef68
2017-11-19 01:35:07 +00:00
Greg Woolsey
9d11d1c3ea add Locale awareness to case insensitive conditional comparisons in formatting rule logic. Needed anyway, and removes forbidden API issues.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815404 13f79535-47bb-0310-9956-ffa450edef68
2017-11-16 01:22:52 +00:00
Greg Woolsey
963a8fedae ignore a unit test that snuck in. It was created to investigate an open bug report. It fails, as expected, which broke the build.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815336 13f79535-47bb-0310-9956-ffa450edef68
2017-11-15 16:34:14 +00:00
Greg Woolsey
ff034f6a20 Fixes Bug 61764 Conditional formatting rules don't evaluate properly for some multi-range rule definitions
Fixes Bug 61761 Conditional formatting rule evaluation doesn't like comparing cells of different types

fixed, with unit tests.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815298 13f79535-47bb-0310-9956-ffa450edef68
2017-11-15 08:35:17 +00:00
Dominik Stadler
3e70d22cbc Fix setting a font-color if no previous color is defined for the font
Add unit-test to verify this

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815086 13f79535-47bb-0310-9956-ffa450edef68
2017-11-13 11:46:04 +00:00
Dominik Stadler
1b9d599882 Fix tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815085 13f79535-47bb-0310-9956-ffa450edef68
2017-11-13 11:44:50 +00:00
Javen O'Neal
f062e7f1c2 bug 61745: remove String#toString() usage found by forbidden apis check
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815048 13f79535-47bb-0310-9956-ffa450edef68
2017-11-13 00:51:41 +00:00
Javen O'Neal
a1b8f3ff14 bug 61745: add support for charts in XWPF/docx. Thanks to Sandeep Tiwari for the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815047 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 21:48:41 +00:00
Javen O'Neal
bac484ba37 +svn:eol-style native *.java
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815002 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 06:52:38 +00:00
Javen O'Neal
fbccf3066c github #81: sheet names are case insensitive
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1815001 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 06:14:43 +00:00
Javen O'Neal
1bc1bdb58b XWPFTable#getRows() should return an unmodifiable list unless the method can correctly update xmlbeans in response to modifying the list
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814999 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 01:34:52 +00:00
Javen O'Neal
fd29e87402 make tableRows final; initialize where defined rather than in constructor.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814998 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 01:32:43 +00:00
Javen O'Neal
c1e6c2eef7 deprecate XWPFTable#addNewRowBetween(int,int), which has not been implemented since 2008 when this class was first authored. (Unrelated: This closes #82 on github).
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814997 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 01:30:42 +00:00
Mark Murphy
70fdcdf848 Surface XSSF Header/Footer Attributes (60887)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814950 13f79535-47bb-0310-9956-ffa450edef68
2017-11-11 14:18:24 +00:00
Dominik Stadler
2d5b6457c6 Some JavaDoc adjustments, typos, IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814587 13f79535-47bb-0310-9956-ffa450edef68
2017-11-08 14:59:08 +00:00
Javen O'Neal
8b0145c6e0 bug 61730: remove asSet function from unit test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814462 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 07:26:48 +00:00
Javen O'Neal
163673a7aa bug 61730: remove CellRangeAddressBase which is eager. The lazy iterator is safer, less likely to cause an OOM/DoS.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814461 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 07:21:24 +00:00
Javen O'Neal
841cc75ee4 bug 61730: add javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814451 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 01:54:25 +00:00
Javen O'Neal
fb321255e8 bug 61730: add iterator interface to CellRangeAddressBase for iterating over CellAddresses
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814448 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 00:29:09 +00:00
Javen O'Neal
baec676cd0 bug 61727: make TestCellRangeUtil unit tests more explicit
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814444 13f79535-47bb-0310-9956-ffa450edef68
2017-11-06 22:19:06 +00:00
Dominik Stadler
7eb0187a5a Enhance unit-test to Verify that bug 58785 is already via via some other change
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814440 13f79535-47bb-0310-9956-ffa450edef68
2017-11-06 20:26:32 +00:00
Javen O'Neal
047dcc60ca bug 61727: CellRangeUtil Merge cell ranges broken. Thanks for Sven Rieckhoff for the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814432 13f79535-47bb-0310-9956-ffa450edef68
2017-11-06 19:51:41 +00:00
Dominik Stadler
ba7c278a0e Adjust some tests to properly close resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814374 13f79535-47bb-0310-9956-ffa450edef68
2017-11-05 20:33:35 +00:00
Dominik Stadler
e54892912e Bug #57517: Fix various things in HSSFOptimiser to make many more cases work fine: Column styles, row styles, user defined styles, ...
Also call optimise in integration-tests and handle some cases of invalid content in files.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814373 13f79535-47bb-0310-9956-ffa450edef68
2017-11-05 20:33:28 +00:00
Dominik Stadler
4d13aefd6e Add test-case which shows that bug 55814 is fixed already by other changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814290 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 13:45:12 +00:00
Dominik Stadler
48d6e6c9cf Fix some IntelliJ and JavaDoc warnings and avoid code-duplication and duplicated test-methods
Adjust tests slighlty, close resources

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814289 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 13:45:04 +00:00
Javen O'Neal
673e558b7a bug 61474, github #81: add ShiftMode#ColumnCopy for FormulaShifter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814268 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 10:11:20 +00:00
Javen O'Neal
6234d725e6 bug 61474, github #81: add shiftMergedRegions to BaseRowColShifter interface
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814264 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 09:32:05 +00:00
Javen O'Neal
9375ae7873 bug 61474, github #81: bump visibility of abstract methods in BaseRowColShifter abstract class
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814262 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 09:17:09 +00:00
Javen O'Neal
6fcacf21f3 bug 61474, github #81: pull up methods from RowShifter to BaseRowColShifter, since both row and column shifting should be able to shift formulas, comments, merged regions, conditional formatting, etc; add @since decorators for new *ColumnShifter and *RowColShifter classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814261 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 09:07:32 +00:00
Javen O'Neal
ec8b13c3a8 bug 61474, github #81: remove @Internal RowShifter#updateRowFormulas, move to XSSFRowColShifter; implement ColumnShifter#updateFormulas; remove duplicated JavaDocs (better to inherit)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814260 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 08:54:20 +00:00
Javen O'Neal
4d526bfd01 bug 61474, github #81: implement updateConditionalFormatting for ColumnShifter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814259 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 07:58:41 +00:00
Javen O'Neal
7c88f32408 bug 61474, github #81: implement updateNamedRanges for ColumnShifter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814258 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 07:42:33 +00:00
Javen O'Neal
607ca594b1 bug 61474, github #81: fix ColumnShifter#removalNeeded to use columns instead of rows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814257 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 07:29:53 +00:00
Javen O'Neal
4b92e7c67a bug 61474, github #81: add ColumnShifter interface; deduplicate some code in RowShifter, CFRecordsAggregate
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814256 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 07:17:44 +00:00
Javen O'Neal
b671199b40 bug 61474, #81 on github: add @Override annotation; rename FormulaShifter shifter to FormulaShifter formulaShifter to reduce confusion with the shifter variable referring to the RowShifter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814255 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 05:48:18 +00:00
Javen O'Neal
0e540db89b bug 61474,github-81: add FormulaShifter.createForColumnShift and ShiftMode.ColumnMove
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814254 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 05:29:52 +00:00
Javen O'Neal
40ae87fd36 github-81: extract routines in HSSFRow#shiftRows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814253 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 04:29:45 +00:00
Javen O'Neal
59594b6030 rename ambiguous variable name shifter -> formulaShifter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814247 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 02:57:01 +00:00
Javen O'Neal
4b2f709551 whitespace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814245 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 02:49:52 +00:00
Andreas Beeker
388c491135 #61671 - XSLFSlide does not contain isHidden and setHidden like HSLFSlide does
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1814122 13f79535-47bb-0310-9956-ffa450edef68
2017-11-02 23:15:19 +00:00
Nick Burch
bae303a412 Javadoc fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813966 13f79535-47bb-0310-9956-ffa450edef68
2017-11-01 11:21:25 +00:00
Javen O'Neal
925a296cc3 eventually we want to forbid StringBuffer usage
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813875 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 11:10:08 +00:00
PJ Fanning
34006a542e use StringBuilder in more places
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813869 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 10:24:47 +00:00
Javen O'Neal
bf5a0c4c9e github-68: add @Override to o.a.p.ss.usermodel.charts.DataSources. Thanks to Alain-Bearez.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813868 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 10:17:38 +00:00
PJ Fanning
5402bcdd49 add test case for bug 61701
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813864 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 09:51:51 +00:00
PJ Fanning
e623808539 add test case for bug 61701 and use StringBuilder in more places
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813863 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 09:48:23 +00:00
Javen O'Neal
722ab2d4f1 github-77: Remove the 'public' modifier to make fields package protected (findbugs-MS_PKGPROTECT). Thanks to BruceKuiLiu for the PR. This closes #77 on github.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813859 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 09:38:03 +00:00
Javen O'Neal
729c86e82c consolidate duplicated code: XSSFWorkbook#setBookViewsIfMissing()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813841 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 01:45:03 +00:00
Javen O'Neal
d4a0dbc792 bump the Eclipse compile source to Java 1.8
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813840 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 01:08:43 +00:00
Javen O'Neal
1cea1c52fd bug 61630: Patch from Daniel to fix XSSFExportToXML IllegalArgumentException: Comparison method violates its general contract! (bug 61630, comment 17, attachment 35468). Found during manual testing.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813443 13f79535-47bb-0310-9956-ffa450edef68
2017-10-26 18:10:09 +00:00
Javen O'Neal
b88b245fb8 remove test-hssf ant target
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813351 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 20:19:23 +00:00
Javen O'Neal
52dfce033c remove test-ss and test-ooxml-ss ant targets, as these were causing problems with the build/ooxml-testokfile.txt being written, requiring test-ooxml to be rerun on subsequent ant calls even if had previously completed successfully and not modifications to the ooxml source had been made.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813342 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 18:59:54 +00:00
Javen O'Neal
2cf5a977aa bug 61630: further XSSFExportToXML performance improvements from Daniel (bug 61630 comment 15, attachment 35450)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813332 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 18:19:12 +00:00
Javen O'Neal
02093f59dc bug 61630: revert r1813240, which failed the integration test with org.apache.poi.stress.XSSFFileHandler on test-data/spreadsheet/59025.xlsx
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813243 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 23:44:21 +00:00
Javen O'Neal
87d9019713 bug 61630: further XSSFExportToXML performance improvements from Daniel (comment 9, bug 61630 attachment 35450)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813240 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 23:00:12 +00:00
PJ Fanning
95828710f1 Remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813102 13f79535-47bb-0310-9956-ffa450edef68
2017-10-23 21:17:49 +00:00
PJ Fanning
af2813634b Remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813092 13f79535-47bb-0310-9956-ffa450edef68
2017-10-23 20:39:27 +00:00
PJ Fanning
6c0ac68e05 Remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813085 13f79535-47bb-0310-9956-ffa450edef68
2017-10-23 20:27:47 +00:00
PJ Fanning
245d9b3b7f Introduce new BorderFormatting methods to expose border styles
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812917 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:53:42 +00:00
PJ Fanning
26cc1e4d32 Remove use of deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812911 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:03:33 +00:00
PJ Fanning
1ea1a692e0 Remove use of deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812907 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 12:45:35 +00:00
PJ Fanning
dfd5f07079 Remove use of deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812901 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 12:07:14 +00:00
Dominik Stadler
5d5ba1c767 Add getter/setter for ReadingOrder to XSSF, closes issue #73
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812558 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 18:26:41 +00:00
Nick Burch
68104817ec Bump up the Eclipse JVM version to 8 to match Ant
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812557 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 18:21:29 +00:00
Nick Burch
eb9f7bcbea Bump up the Eclipse JVM version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812556 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 18:16:48 +00:00
Javen O'Neal
79975dcfce bug 61630: performance improvements in XSSFExportToXml. Thanks to Daniel for the patch.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812546 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 16:04:06 +00:00
Javen O'Neal
22e4bc2399 cleanup for r1812470: avoid NPEs from string.isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812532 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 14:40:56 +00:00
Javen O'Neal
49add35f3b fix compile error
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812531 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 14:40:05 +00:00
Javen O'Neal
42c4e4909c cleanup for r1812475: avoid NPEs from string.isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812520 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 14:29:56 +00:00
Javen O'Neal
fc2bcfae9a cleanup for r1812476: avoid NPEs from string.isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812516 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 14:08:43 +00:00
Javen O'Neal
5fb4887907 replace "".equals(string) with string.isEmpty() to avoid null strings silently evaluating to false; most code should probably check string for null if it is not already
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812476 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 08:41:42 +00:00
Javen O'Neal
aba704b928 prefer literal.equals(variable) over variable.equals(literal)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812475 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 08:41:25 +00:00
Javen O'Neal
3a2ee5f4d1 convert "".equals(string) to string.isEmpty()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812470 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 08:22:51 +00:00
Javen O'Neal
21b65721e7 simplfy PackagingURIHelper#combine boolean logic using xor and replacing +FORWARD_SLASH_CHAR with FORWARD_SLASH_STRING
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812468 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 08:10:36 +00:00
Javen O'Neal
afa5be82d3 fix typo
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812464 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 07:47:25 +00:00
Javen O'Neal
cfac692a6a string.equals("") -> string.isEmpty() or "".equals(string)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812463 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 07:45:53 +00:00
Javen O'Neal
36dcbd7403 for -> foreach
string.equals() -> string.isEmpty() or .equals(string)
ArrayList -> List

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812461 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 07:33:07 +00:00
Javen O'Neal
bcbadce32e IntelliJ: simplify boolean logic
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812363 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 07:43:41 +00:00
Javen O'Neal
7eb6686b1d remove deprecated XSSFRowShifter.shiftMerged(int,int,int) method; replaced with RowShifter.shiftMergedRegions(int,int,int) in POI 3.15 beta 2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812354 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 07:10:25 +00:00
Javen O'Neal
e5f8463381 ignore gradle/, gradlew, and gradlew.bat
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812351 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 06:13:09 +00:00
Dustin Spicuzza
ab147e9998 Bug 61584: Fix XDGFPage variable typo causing crash
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812240 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 01:35:31 +00:00
Javen O'Neal
e593f50186 github-79: add String.toString() to forbidden API's
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812239 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 01:34:13 +00:00
PJ Fanning
16125ab3cc Make public static members final [thanks to Kui Liu]. This close #78.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812234 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 20:50:58 +00:00
PJ Fanning
e1571c9130 Remove unnecessary toString calls [thanks to Kui Liu]. This close #79.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812233 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 20:34:10 +00:00
PJ Fanning
229af142fc Remove unnecessary StringBuilder [thanks to Kui Liu]. This close #80.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812232 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 20:25:33 +00:00
Dominik Stadler
bc7d79a613 Fix some findbugs-issues and apply some code-cleanup and apply some smaller pull requests.
This closes #74, This closes #75, This closes #76

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812097 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 09:40:22 +00:00
Dominik Stadler
887ec868b7 Fix aparent copy/paste error in XSSFBorderFormatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811867 13f79535-47bb-0310-9956-ffa450edef68
2017-10-11 18:32:13 +00:00
Dominik Stadler
793938ecef Bug 58068: Add a method to pass the actual Color to StylesTable.findFont().
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811866 13f79535-47bb-0310-9956-ffa450edef68
2017-10-11 18:32:01 +00:00
Dominik Stadler
c05e07b55c adjust tests, javadoc, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811865 13f79535-47bb-0310-9956-ffa450edef68
2017-10-11 18:31:34 +00:00
Dominik Stadler
673b223f61 Remove "filling" in IntList as this has no effect whatsoever as far as I could see
Fix some IntelliJ warnings, missing JavaDoc, typos, Findbugs issues

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811793 13f79535-47bb-0310-9956-ffa450edef68
2017-10-11 05:32:05 +00:00
Dominik Stadler
a21c09fd61 Add more output to the pre-check to help in analysis some strange build-failures in CI, e.g. INFRA-15244
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811597 13f79535-47bb-0310-9956-ffa450edef68
2017-10-09 19:35:43 +00:00
Dominik Stadler
73443aacf6 Fix target compile-ooxml-ss, it needs the crypt-code now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811596 13f79535-47bb-0310-9956-ffa450edef68
2017-10-09 19:35:39 +00:00
Dominik Stadler
e24f25d0ef Add test which shows that bug 51262 is fixed now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811595 13f79535-47bb-0310-9956-ffa450edef68
2017-10-09 19:35:32 +00:00
Dominik Stadler
566789e983 Apply patch from bug 61096: Add support for modules in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811383 13f79535-47bb-0310-9956-ffa450edef68
2017-10-07 06:11:12 +00:00
Dominik Stadler
c2d09c0217 Bug 61586: Add test which shows that it works as expected
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811355 13f79535-47bb-0310-9956-ffa450edef68
2017-10-06 17:41:20 +00:00
Dominik Stadler
0e52f62a1e Bug 61564: Try to get rid of the Java 9 illegal access warning now that we run Java 8
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811145 13f79535-47bb-0310-9956-ffa450edef68
2017-10-04 19:54:41 +00:00
Dominik Stadler
dd23ba89a9 Add some more code from the separate integration test project to be able to publish the femaining functionality as separate project at some point
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811144 13f79535-47bb-0310-9956-ffa450edef68
2017-10-04 19:54:21 +00:00
Dominik Stadler
48613ee271 Bug 61064: Support behavior of function CEILING in newer versions of Microsoft Excel
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1810007 13f79535-47bb-0310-9956-ffa450edef68
2017-09-28 14:36:53 +00:00
Dominik Stadler
6450f1cc42 Bug 61082: Adjust JavaDoc for getFirst/LastRow/Cell to explain that there might be empty rows/cells included in the counts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809988 13f79535-47bb-0310-9956-ffa450edef68
2017-09-28 13:12:32 +00:00
Dominik Stadler
688d5072d1 Fix bug 61516: when copying cells with formulas we should properly check for references that are invalid afterwards.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809967 13f79535-47bb-0310-9956-ffa450edef68
2017-09-28 09:56:45 +00:00
Dominik Stadler
3adbe1f8c5 Adjust some unit-tests, use try-with-resource, enable test which works now, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809739 13f79535-47bb-0310-9956-ffa450edef68
2017-09-26 12:40:38 +00:00
Dominik Stadler
a751880c11 Replace "getEntry() plus catch" by "hasEntry()" in HSSFWorkbook
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809738 13f79535-47bb-0310-9956-ffa450edef68
2017-09-26 12:33:08 +00:00
Dominik Stadler
991fba37a2 Fixup change for CellReference to keep the behavior the same as before
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809737 13f79535-47bb-0310-9956-ffa450edef68
2017-09-26 12:31:51 +00:00
Dominik Stadler
5c90d94d8c Remove empty directories beneath "scratchpad"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809735 13f79535-47bb-0310-9956-ffa450edef68
2017-09-26 12:22:53 +00:00
Dominik Stadler
af1b1d619c Replace deprecated CellReference class and some other warnings fixed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809714 13f79535-47bb-0310-9956-ffa450edef68
2017-09-26 08:26:05 +00:00
Dominik Stadler
43717f6936 Fix some Sonar issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809636 13f79535-47bb-0310-9956-ffa450edef68
2017-09-25 15:10:40 +00:00
Dominik Stadler
61a281e790 Replace the incompatible new interface method endSheet() with a Java 8 default method so existing implementations do not need to be adjusted. Also use this for headerFooter() and remove the empty implementations that are now obsolete.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809635 13f79535-47bb-0310-9956-ffa450edef68
2017-09-25 14:45:14 +00:00
Tim Allison
7a2ce09761 Bug 61349 -- bump limits on classes that caused regressions in Dominik's regression corpus. Many thanks to Dominik Stadler for running the regression tests!!!
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809623 13f79535-47bb-0310-9956-ffa450edef68
2017-09-25 12:53:10 +00:00
PJ Fanning
3a622169d3 Remove more deprecated classes and methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809428 13f79535-47bb-0310-9956-ffa450edef68
2017-09-23 14:03:25 +00:00
Dominik Stadler
8e1b51128c Fix compiling Examples after adding new interface-method, fix compiler warnings and adjust some broken Javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809388 13f79535-47bb-0310-9956-ffa450edef68
2017-09-23 10:26:27 +00:00
Dominik Stadler
acb1772d4b Tried to enable this test, but it is broken since a long time and I am not sure how this is expected to behave...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809372 13f79535-47bb-0310-9956-ffa450edef68
2017-09-23 07:44:09 +00:00
Dominik Stadler
4a6bb031a0 Apply patch to add endSheet() to the XSSFEventBasedExcelExtractor, fixes bug 60737, thanks to user zakim for the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809371 13f79535-47bb-0310-9956-ffa450edef68
2017-09-23 07:41:27 +00:00
Dominik Stadler
5ed15ac7c2 More IntelliJ warnings fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809370 13f79535-47bb-0310-9956-ffa450edef68
2017-09-23 07:38:01 +00:00
Dominik Stadler
996010a3ca The Gradle-based Sonarqube job does not actually, it completes with success, but the data never appears on Sonarqube itself, we need to investigate this some more later, for now I enabled the Maven based job again.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809359 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 21:30:40 +00:00
Dominik Stadler
29dbeb51ad Bug 59747: Adjust order of first two entries in the resulting Zip to try to enable some external tools to auto-detect the file-type
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809357 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 21:19:39 +00:00
Dominik Stadler
e54490712a Adjust many examples for Java 8: try-with-resource, multi-catch and other code cleanup.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809354 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 21:16:09 +00:00
Dominik Stadler
79a039ec8d Fix some IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809349 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 20:07:56 +00:00
Dominik Stadler
4e76b65b17 Remove Jobs for JDK 1.6/1.7, this should also make the findbugs-hacks obsolete here
The jobs still need to manually removed in Jenkins, though!

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809348 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 20:06:31 +00:00
Nick Burch
dc9416ec4d Javadoc fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809171 13f79535-47bb-0310-9956-ffa450edef68
2017-09-21 15:09:50 +00:00
Tim Allison
9cade10fa4 Bug 61349 -- add more sanity checks when allocating byte[]
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809169 13f79535-47bb-0310-9956-ffa450edef68
2017-09-21 14:52:59 +00:00
Dominik Stadler
828fb9a86c Apply patch from bug 61033 to add a XSSFWorkbook.setCellFormulaValidation(false) to speed up some operations
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809071 13f79535-47bb-0310-9956-ffa450edef68
2017-09-20 19:08:57 +00:00
PJ Fanning
37b5ca2c31 Bug 61528 - Pivot Table enhancements, new example [Thanks to R Kietel]. This closes #71
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808946 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 21:21:37 +00:00
PJ Fanning
f13f0dfbbd Bug 61528 - Pivot Table enhancements, new example [Thanks to R Kietel]. This closes #71
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808945 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 21:18:09 +00:00
PJ Fanning
a9ec0770f0 tidy up some test code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808944 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 21:04:30 +00:00
Dominik Stadler
01b1005379 Add test to verify that bug 61532 is fixed as far as I see via the changes for bug 61148.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808932 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 19:19:30 +00:00
Dominik Stadler
1496e83eaa Adjust to make forbidden-api-check succeed again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808930 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 19:02:31 +00:00
Dominik Stadler
985af5304a Bug 61148: Fix calculating formula value, unfortunately we currently need to set the value twice
Also rework related tests to run more of the tests for HSSF, XSSF and SXSSF

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808929 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 19:02:22 +00:00
Dominik Stadler
d1d01bb632 IntelliJ warnings, deprecation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808928 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 19:02:06 +00:00
Dominik Stadler
c31d6686db Fix some IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808908 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 16:23:37 +00:00
Tim Allison
a59402a37f 60805 (partial) -- remove/suppress println in tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808903 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 15:52:21 +00:00
Dominik Stadler
d1765d7e76 While working on bug 61148 I found that getCellType() and setCellErrorValue() in SXSSFCell are doing different things than the ones in XSSFCell, tried to fix this by mimicking functionality of XSSF in SXSSF as well.
Reformating some small things as well.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808874 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 12:47:13 +00:00
Javen O'Neal
4835636fed bug 61454: add column width to example Spreadsheet ToHtml; thanks to Christian Froehler
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808817 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 03:27:40 +00:00
Javen O'Neal
7a52b8c93b bug 61454: add column width to example Spreadsheet ToHtml; thanks to Christian Froehler
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808816 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 03:26:20 +00:00
Dominik Stadler
357816942a Bug 61520: Add JavaDoc about name-references in Excel
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808763 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 18:55:07 +00:00
Dominik Stadler
c2132cf191 Add missing test.jar to test-hssf target
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808762 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 18:54:47 +00:00
PJ Fanning
51305b6260 use non-deprecated versions of getCellType
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808741 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 16:31:55 +00:00
PJ Fanning
e0ee55e75f change CellFormat.ultimateType to return CellType
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808739 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 16:06:54 +00:00
PJ Fanning
318fe3e597 change HyperLink getType to return HyperlinkType
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808737 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 15:55:48 +00:00
PJ Fanning
aaad224db9 fix compiler warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808722 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 14:15:15 +00:00
PJ Fanning
7dad60e9d4 update getCellType to return CellType enum instead of int
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808718 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 13:58:55 +00:00
PJ Fanning
4a4c428b6b update getCellType to return CellType enum instead of int
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808703 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 13:38:07 +00:00
PJ Fanning
d4486af6de update getCellType to return CellType enum instead of int
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808700 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 13:26:16 +00:00
PJ Fanning
d9b63eb569 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808687 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 12:27:36 +00:00
PJ Fanning
16d262d0b4 Change getCachedFormulaResultType to return CellType
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808678 13f79535-47bb-0310-9956-ffa450edef68
2017-09-18 10:50:50 +00:00
Andreas Beeker
a51bac65b7 #60499 - Deleting a picture that is used twice on a slide corrupt the slide
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808661 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 22:45:03 +00:00
Dominik Stadler
71cfb659a1 Remove deprecated methods from NPOIFSFileSystem/OPOIFSFileSystem
IntelliJ warnings/suggestions

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808622 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:08:45 +00:00
Dominik Stadler
2917583bd2 Fix some warnings in OOXMLLite and move copyFile to IOUtils
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808621 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:08:31 +00:00
Dominik Stadler
b644047b70 Various code cleanups, "final" for static methods is useless, for-loops, simplify boolean conditions, try-with-resource, javadoc, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808620 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:08:23 +00:00
Dominik Stadler
75c63b6bbe Some more code cleanup
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808619 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:07:48 +00:00
Dominik Stadler
f770381956 Change version to 4.0.0-SNAPSHOT as discussed on the mailing-list
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808618 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:07:37 +00:00
Dominik Stadler
7c21c8761a MaxPermSize is not used any more in Java 8, so remove it everywhere
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808617 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:07:28 +00:00
Dominik Stadler
bbd9adc5f0 Disable Maven-Sonar run to check if the Gradle-Sonar job is working, some more comments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808616 13f79535-47bb-0310-9956-ffa450edef68
2017-09-17 11:07:21 +00:00
Andreas Beeker
a9c8beac4c wrong release-notes link
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808594 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 21:38:43 +00:00
Dominik Stadler
2395c89b45 Sonar-Maven: Switch to UTF-8 for source files to silence some warnings in the build.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808540 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 13:39:29 +00:00
Dominik Stadler
a5044f502b Jenkins DSL: Remove timeout from Jenkins Jobs for now, it seems this plugin is currently missing in the Apache Jenkins instance
Adjust nodes for OpenJDK build after requiring OpenJDK 8 instead of 6

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808539 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 13:39:25 +00:00
Dominik Stadler
e6dae10d47 Jenkins DSL: Use JDK 1.8 for more projects, fix listing of slaves in Test-Environment job
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808537 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 13:06:59 +00:00
PJ Fanning
0b7774a452 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808535 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 12:16:29 +00:00
Dominik Stadler
9ed85b0484 Jenkins DSL:
* Enable SCM-retry to see if that helps against the frequent SVN update failures
* Add a POI-DSL-Test-Environment to have this Job also defined via DSL

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808525 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 09:08:45 +00:00
Dominik Stadler
51826d781b Jenkins DSL: Use OpenJDK 8 and latest JDK 1.9
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808524 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:29:33 +00:00
Dominik Stadler
1f4344a048 Fix some compiler warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808523 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:29:28 +00:00
Dominik Stadler
2600c60fb5 Use Integer.compare() where possible
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808522 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:29:20 +00:00
Dominik Stadler
8b564f1185 Fix some warnings in unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808521 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:29:06 +00:00
Dominik Stadler
b7547a01f6 Use Collections.singleton() where applicable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808520 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:28:56 +00:00
Dominik Stadler
356d4a77cb Fix some warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808519 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:28:50 +00:00
Dominik Stadler
5341a131de Remove unnecessary local variables
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808518 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:28:38 +00:00
Dominik Stadler
7937da6a10 Remove unnecessary type arguments (Java 8)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808516 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:27:23 +00:00
Dominik Stadler
d4070f05e7 Remove unnecessary type arguments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808515 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:24:05 +00:00
Dominik Stadler
50beafbb47 Suppress some warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808514 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:23:57 +00:00
Dominik Stadler
87f5a0c7cd Remove unused imports
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808513 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:23:48 +00:00
Dominik Stadler
8ca329e08b Remove unnecessary casts and toString() calls
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808512 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:23:30 +00:00
Dominik Stadler
0ce7fff0be Remove unnecessary semicolons
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808511 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:23:15 +00:00
Dominik Stadler
f27cb3354d Remove unnecessary initialization of members
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808510 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:22:59 +00:00
Dominik Stadler
ba5f686a06 Fix typos and warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808509 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:21:35 +00:00
Dominik Stadler
e57e73fe38 Let IntelliJ cleanup some code-warnings across the whole code-base: unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808508 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:21:28 +00:00
Dominik Stadler
51944a4e82 Detect some HTML files as separate invalid filetype
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808507 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:56 +00:00
Dominik Stadler
92ae9ce5e0 Allow to produce a jar for the integration-test-code so we can use it directly in the mass-regression tests without having to copy it for every run.
Enable some forbidden-api-checks for integration-test code

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808506 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:50 +00:00
Dominik Stadler
6044d4629c Adjust local test in integration-test file-handler
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808505 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:44 +00:00
Dominik Stadler
ee35ccda7f Add .git as excluded dir for integration-tests and add a local test for XSSFBFileHandler to be able to manually test single files quickly
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808504 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:38 +00:00
Dominik Stadler
23c2850586 Add additional check as mentioned in bug 50060
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808503 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:32 +00:00
Dominik Stadler
445852e773 Tried to reproduce bug 61300, but could not.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808502 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:25 +00:00
Dominik Stadler
f839090fe6 At least print out correct offset information for PtrRefN if it has offset values set
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808501 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:17 +00:00
Dominik Stadler
c9151662e8 Add test for question on the mailing-list
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808500 13f79535-47bb-0310-9956-ffa450edef68
2017-09-16 08:20:06 +00:00
PJ Fanning
6998fe1ea6 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808483 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 20:17:21 +00:00
Dominik Stadler
667fe38bf7 Java 8: Disable Jobs using Java 1.6 and 1.7 for now, they can be removed soon.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808476 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 18:39:47 +00:00
Dominik Stadler
f947ab760d Java 8: Deprecate some methods in IOUtils
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808475 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 18:39:43 +00:00
Dominik Stadler
e9876165d3 Adjust Maven pom.xml for 4.0, Java 8 and newer third party libs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808474 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 18:39:37 +00:00
Dominik Stadler
6592bf6fbe Adjust some more places for the new versions of some third party libraries
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808473 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 18:39:29 +00:00
Dominik Stadler
276c8c89de Update third party libs to latest versions
Start updating build to Java 8
Set version to 4.0-beta1

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808472 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 18:39:18 +00:00
PJ Fanning
8f53bd94a6 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808455 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 12:29:35 +00:00
Nick Burch
e4fc7ff5a7 Remove javadoc references to removed classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808436 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 09:03:56 +00:00
PJ Fanning
7863d0b312 remove deprecated inner classes from HSFColor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808432 13f79535-47bb-0310-9956-ffa450edef68
2017-09-15 08:29:31 +00:00
PJ Fanning
19d58f3657 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808403 13f79535-47bb-0310-9956-ffa450edef68
2017-09-14 23:44:47 +00:00
PJ Fanning
4d1907b447 remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808402 13f79535-47bb-0310-9956-ffa450edef68
2017-09-14 23:09:08 +00:00
PJ Fanning
320d9735ca remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808400 13f79535-47bb-0310-9956-ffa450edef68
2017-09-14 22:19:16 +00:00
PJ Fanning
18e53b3bef add missing licenses on test classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808315 13f79535-47bb-0310-9956-ffa450edef68
2017-09-14 07:21:33 +00:00
Tim Allison
4852228f3f 60279 -- back off to brute-force search for macro content if offset information is not correct
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808301 13f79535-47bb-0310-9956-ffa450edef68
2017-09-14 02:22:55 +00:00
PJ Fanning
5ef2f1636c Numeric Array Formula and Matrix Function [from Bob95132] This closes #69
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808297 13f79535-47bb-0310-9956-ffa450edef68
2017-09-13 23:54:36 +00:00
PJ Fanning
e726dd68de [bug-61515] fix xlsf issue with relationships [from Alain Bearez] This closes #70
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808294 13f79535-47bb-0310-9956-ffa450edef68
2017-09-13 23:10:44 +00:00
Andreas Beeker
0aaff6b21d prepare for 3.18-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807827 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 21:04:13 +00:00
Andreas Beeker
8e0f3bd12d release prepare for 3.17 - updating build.xml and status.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807825 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 21:03:20 +00:00
Dominik Stadler
b3b5add581 Remove incorrect copy-include in pom.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807822 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 20:42:24 +00:00
Andreas Beeker
a2a4007a17 Add Removal annotation to xmlbeans generation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807817 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 20:27:49 +00:00
Dominik Stadler
d4e621caba Add Removal.java to fix Maven compilation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807797 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 18:30:39 +00:00
Andreas Beeker
794716b0c0 Add Removal annotation to xmlbeans generation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807653 13f79535-47bb-0310-9956-ffa450edef68
2017-09-07 22:01:41 +00:00
Nick Burch
526dc01a50 Copy over and tweak PicturesSource from Apache Tika
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807651 13f79535-47bb-0310-9956-ffa450edef68
2017-09-07 21:36:15 +00:00
Andreas Beeker
8d17a69005 prepare for 3.18-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807430 13f79535-47bb-0310-9956-ffa450edef68
2017-09-05 22:49:57 +00:00
Andreas Beeker
ce7446c76a release prepare for 3.17 - updating build.xml and status.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807428 13f79535-47bb-0310-9956-ffa450edef68
2017-09-05 22:49:04 +00:00
Andreas Beeker
d17deb6185 #61478 - POI OOXML-Schema lookup uses wrong classloader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1807418 13f79535-47bb-0310-9956-ffa450edef68
2017-09-05 21:30:29 +00:00
Tim Allison
60176900fc While working on 61475, need to add a new line after picture text...not worth separate ticket.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806843 13f79535-47bb-0310-9956-ffa450edef68
2017-08-31 20:20:24 +00:00
Tim Allison
235d102f26 61475 -- append text from pictures only once...bug from my work on 61470.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806839 13f79535-47bb-0310-9956-ffa450edef68
2017-08-31 19:14:43 +00:00
Tim Allison
3b32a00aa7 61470 -- add extraction of content within ruby elements; allow users to concatenate or not concatenate phonetic strings. Default is to concatenate.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806712 13f79535-47bb-0310-9956-ffa450edef68
2017-08-30 16:29:52 +00:00
Greg Woolsey
914ae602b1 Fixes bug #61468, caused by a confusing OOXML spec design as noted in JavaDocs added in r1795648.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806623 13f79535-47bb-0310-9956-ffa450edef68
2017-08-29 17:14:52 +00:00
Andreas Beeker
de89d4cdc4 prepare for 3.18-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806509 13f79535-47bb-0310-9956-ffa450edef68
2017-08-28 20:53:19 +00:00
Andreas Beeker
c9eff2a2bb release prepare for 3.17 - updating build.xml and status.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806507 13f79535-47bb-0310-9956-ffa450edef68
2017-08-28 20:52:23 +00:00
Andreas Beeker
eedd4cf7f9 sha512 checksums aren't yet supported by Nexus
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806505 13f79535-47bb-0310-9956-ffa450edef68
2017-08-28 20:41:16 +00:00
Dominik Stadler
20fa8328f4 Verify that bug 61294 is fixed now, add some more coverage for IOUtils in general
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806162 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 11:51:18 +00:00
Dominik Stadler
34f35b2d0e Revert performance tuning done via Bug 61350 as it lead to problems when running multi-threaded large regression tests.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1806077 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 19:46:39 +00:00
Andreas Beeker
f7b7c8e89d prepare for 3.18-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805582 13f79535-47bb-0310-9956-ffa450edef68
2017-08-20 19:18:48 +00:00
Andreas Beeker
bc839b285b release prepare for 3.17 - updating build.xml and status.xml
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805580 13f79535-47bb-0310-9956-ffa450edef68
2017-08-20 19:17:37 +00:00
Dominik Stadler
2108f82449 Fix 60384 and 60709: When shifting with merged regions we should correctly check if the region is moved along or needs to be removed because it is not fully kept via the shifting. This was broken by the fix for bug 59740, now additional unit tests ensure that it works better.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805518 13f79535-47bb-0310-9956-ffa450edef68
2017-08-19 16:31:45 +00:00
Dominik Stadler
68a829067a Add more --add-opens for JDK 9
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805517 13f79535-47bb-0310-9956-ffa450edef68
2017-08-19 16:31:33 +00:00
Dominik Stadler
b233345510 Add more non-test classes in OOXMLLite and add another font-metric that appears
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805516 13f79535-47bb-0310-9956-ffa450edef68
2017-08-19 16:31:28 +00:00
Greg Woolsey
5e5adc70e5 Bug 61431 - Conditional formatting evaluation ignores undefined cells
now evaluating based on cell references instead, and watching out for undefined cells in rules that require a cell.

Added unit test based on previously failing file.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805245 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 23:52:27 +00:00
Nick Burch
9bb61bfaef As per ".sha Release Distribution Policy" email, also generate .sha512 hashes for dist
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1805198 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 13:44:58 +00:00
Andreas Beeker
91e74a7498 exclude H21 from slave list
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1804897 13f79535-47bb-0310-9956-ffa450edef68
2017-08-13 11:42:35 +00:00
Andreas Beeker
6f341568b6 #61381 - PushbackInputStreams passed to ZipHelper may not hold 8 bytes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1804854 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 20:47:48 +00:00
Nick Burch
9ae6952845 Add an example of trying multiple passwords against an OOXML file. More a demo than anything, GPU enabled tools are much faster!
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1804667 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 12:43:16 +00:00
PJ Fanning
9fa3e36e9a [Bug-61048] SXSSF module writes wrong escape sequence for carriage returns
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1804596 13f79535-47bb-0310-9956-ffa450edef68
2017-08-09 18:37:14 +00:00
Andreas Beeker
ea97e64e0e notify dev@ when windows-1.7 fails
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1804211 13f79535-47bb-0310-9956-ffa450edef68
2017-08-05 19:47:32 +00:00
Andreas Beeker
848a77318e add findbugs3 prefetch to Windows / JDK1.7 build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803694 13f79535-47bb-0310-9956-ffa450edef68
2017-08-01 19:44:17 +00:00
Dominik Stadler
b3ad734de1 Assert on the contents of the byte-array to see if the problem happens during writing the data or reading it back in
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803614 13f79535-47bb-0310-9956-ffa450edef68
2017-08-01 06:26:44 +00:00
Dominik Stadler
8604525435 Jenkins DSL: Use latest available early access build of JDK 9 b179
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803613 13f79535-47bb-0310-9956-ffa450edef68
2017-08-01 06:26:39 +00:00
Dominik Stadler
c7e1fabf1c Reformat code slightly
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803612 13f79535-47bb-0310-9956-ffa450edef68
2017-08-01 06:26:27 +00:00
Andreas Beeker
ad9fa0cd2d Job DSL refactorings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803594 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 22:56:08 +00:00
Andreas Beeker
d24e0da38a Job DSL fix windows call / retrieve findbugs via powershell
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803559 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 18:21:48 +00:00
Andreas Beeker
18053658cc Add Windows jobs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803543 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 15:29:28 +00:00
Andreas Beeker
97f90ca839 Fix further Windows JVM 6 font rendering errors - OOM and EXCEPTION_ACCESS_VIOLATION
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803528 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 12:25:23 +00:00
Andreas Beeker
27fd9e4cbb remove invalid javadocs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803493 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 08:42:48 +00:00
Nick Burch
e34e286850 Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803488 13f79535-47bb-0310-9956-ffa450edef68
2017-07-31 06:36:10 +00:00
Andreas Beeker
ff2bcdf62d #61363 - Unify escher shape id allocation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803483 13f79535-47bb-0310-9956-ffa450edef68
2017-07-30 23:11:36 +00:00
Andreas Beeker
b3c111a283 Add handling of alternate content elements
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803397 13f79535-47bb-0310-9956-ffa450edef68
2017-07-29 23:08:15 +00:00
Dominik Stadler
24138ef615 Jenkins-DSL: Print out the exact version of java in the pre-steps
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803357 13f79535-47bb-0310-9956-ffa450edef68
2017-07-29 06:57:40 +00:00
Greg Woolsey
f9b9c0d18b Deleting a sheet did not delete table parts and relations. Deleting a table needs to also delete any queryTable relations and parts.
Previous behavior didn't result in documents Excel complained about, but left dead entries in the ZIP structure, which made it bigger and bugged me.

This change does not attempt to delete query connection definitions, as those aren't referenced as relations, and don't have a usage counter to ensure we only delete them if there are no other references.  In my samples I had query tables on multiple sheets using the same connection definition, and wanted to delete only one sheet/table but leave others.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803317 13f79535-47bb-0310-9956-ffa450edef68
2017-07-28 18:01:36 +00:00
PJ Fanning
9f28e36438 [Bug-61354] fix issue with extracting text from Word docs. This closes #66
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803250 13f79535-47bb-0310-9956-ffa450edef68
2017-07-28 07:42:23 +00:00
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
Andreas Beeker
49a222ecbc #61350 - Use unsynchronized xmlbeans
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803120 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 22:15:27 +00:00
Greg Woolsey
9e896b17ea Another font size variation. I suspect it is my Windows 10 scaling factor, set to 100% instead of the Windows 10 default 125%.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803117 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 22:00:23 +00:00
Tim Allison
16f331054f 61337 -- try to convert assertions to exceptions. I left in the assertions for the binary search components.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803092 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 18:43:27 +00:00
Tim Allison
21cbf101bc 61346 add more sanity checks before allocating byte arrays in emf/wmf
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803041 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 12:46:24 +00:00
Andreas Beeker
4ca2ad85b9 remove test leftover
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803024 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 08:13:16 +00:00
Andreas Beeker
d345faa025 Bug 61182 - Invalid signature created for streamed xlsx file
- add hashes for other linebreaks

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803011 13f79535-47bb-0310-9956-ffa450edef68
2017-07-25 22:42:22 +00:00
Tim Allison
a07ed9e864 61338 -- avoid infinite loop triggered by fuzzed wmf file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802997 13f79535-47bb-0310-9956-ffa450edef68
2017-07-25 20:26:57 +00:00
Tim Allison
df3910135f 61295 -- prevent potential oom in HPSF triggered by fuzzed file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802879 13f79535-47bb-0310-9956-ffa450edef68
2017-07-25 01:38:35 +00:00
Tim Allison
67719a8d4f augment expected sizes in TestFonts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802855 13f79535-47bb-0310-9956-ffa450edef68
2017-07-24 19:29:29 +00:00
Dominik Stadler
cc0294d58b Refactor test somewhat to make it easier to see what it actually verifies
Check some more to see why it fails sometimes in CI, e.g. on node qnode1

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802817 13f79535-47bb-0310-9956-ffa450edef68
2017-07-24 14:16:34 +00:00
Andreas Beeker
08b03d9547 Fonts bugfix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802751 13f79535-47bb-0310-9956-ffa450edef68
2017-07-24 05:39:33 +00:00
Andreas Beeker
2325cdb9e6 Bug 61331 - Font group handling / common font interface
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802741 13f79535-47bb-0310-9956-ffa450edef68
2017-07-23 22:45:47 +00:00
Dominik Stadler
8a95a71a48 My version of Java 6 chokes on Generics here
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802633 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 18:19:29 +00:00
Dominik Stadler
f28bbb750c Adjust TestFonts for my version of Ubuntu
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802632 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 18:19:22 +00:00
Dominik Stadler
ef99b6c6fd Add note that japicmp cannot be upgrade until Gradle 4 is used
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802631 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 18:19:17 +00:00
Dominik Stadler
c76672b8aa ExtractorFactory: Try to close resources also on Errors to avoid keeping files open too long
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802630 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 18:19:11 +00:00
Dominik Stadler
db1b62efe7 Fix some IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802629 13f79535-47bb-0310-9956-ffa450edef68
2017-07-21 18:19:03 +00:00
Dominik Stadler
2a2ef074a4 Exclude some more nodes for OpenJDK build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802425 13f79535-47bb-0310-9956-ffa450edef68
2017-07-19 19:02:53 +00:00
PJ Fanning
d4c9e0206a fix tests broken by <br/> doc changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802131 13f79535-47bb-0310-9956-ffa450edef68
2017-07-17 11:36:32 +00:00
PJ Fanning
810d03f499 javadoc: replace invalid self enclosing elements
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802110 13f79535-47bb-0310-9956-ffa450edef68
2017-07-17 08:24:24 +00:00
PJ Fanning
9b3812d027 some javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802035 13f79535-47bb-0310-9956-ffa450edef68
2017-07-15 22:31:09 +00:00
PJ Fanning
d5f043f732 try to fix build issues since namespaces constants were changed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802030 13f79535-47bb-0310-9956-ffa450edef68
2017-07-15 20:00:11 +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
2398bb7a60 clean up whitespace and indents
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801969 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 14:19:21 +00:00
Tim Allison
b0b3ad66ba avoid using non-ascii in unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801968 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 14:17:55 +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
c7db66a30d bug 61294 -- cleaned up based on PJ Fanning's code review. Went with a copy/paste from commons-io.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801952 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 12:48:28 +00:00
Javen O'Neal
a91c041c43 bug 61296: suggest de-duplication of purl dublin core namespace url
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801905 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 03:54:12 +00:00
Javen O'Neal
36e97a30e5 bug 61296: deduplicate ooxml schema constants
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801904 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 03:47:38 +00:00
Javen O'Neal
0a18068f0c bug 61296: consolidate some of the ooxml namespace uri copy-paste in POI, prepare to make these usable by downstream libraries like Tika
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801903 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 03:39:25 +00:00
Javen O'Neal
e8d59d0d7b bug 61296: consolidate some of the ooxml namespace uri copy-paste in POI, prepare to make these usable by downstream libraries like Tika
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801901 13f79535-47bb-0310-9956-ffa450edef68
2017-07-14 03:14:30 +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
d1a51f76f0 avoid unnecessary string concats in SXSSF SheetDataWriter
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801806 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 07:14:01 +00:00
Javen O'Neal
f1cf95ecb5 add 362px font height for my computer's configuration (high-dpi monitor)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801803 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 04:30:41 +00:00
Javen O'Neal
2b0ded5cb3 replace commented-out throw-away code that writes workbook to C:\temp\xxxxx.xlsx for manual review with XSSFTestDataSamples.writeOut(wb, "bug xxxxx for manual review")
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801801 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 04:19:20 +00:00
Javen O'Neal
dc869e5e4a replace return variable assignments with return statements
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801799 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 03:42:12 +00:00
Javen O'Neal
08a624f172 github #43: fix roundUp and roundDown.
Thanks to @FishMeat on github for the patch.
This closes #43 on github.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801798 13f79535-47bb-0310-9956-ffa450edef68
2017-07-13 03:35:06 +00:00
PJ Fanning
eddad11775 [Bug-61281] fix issue with export of table columns - Thanks to Daniel for the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801721 13f79535-47bb-0310-9956-ffa450edef68
2017-07-12 10:46:13 +00:00
PJ Fanning
748e0c4981 remove more deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801697 13f79535-47bb-0310-9956-ffa450edef68
2017-07-12 08:38:20 +00:00
PJ Fanning
f11bb182e9 remove deprecated methods from CommentsTable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801692 13f79535-47bb-0310-9956-ffa450edef68
2017-07-12 08:15:44 +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
PJ Fanning
9ae9aa0210 expand range of acceptable values in TestFonts
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801416 13f79535-47bb-0310-9956-ffa450edef68
2017-07-10 07:26:40 +00:00
Javen O'Neal
1137099aa3 bug 60685: ignore problems with HPBF Publisher Quill Contents PLC hyperlink records so that text extraction can continue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801405 13f79535-47bb-0310-9956-ffa450edef68
2017-07-10 01:34:30 +00:00
Javen O'Neal
0800702952 whitespace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801404 13f79535-47bb-0310-9956-ffa450edef68
2017-07-10 01:31:31 +00:00
Andreas Beeker
4c10645b48 font rendering - handle a few system dependent textbox sizes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801401 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 23:28:41 +00:00
PJ Fanning
e046241c30 [Bug-61268] avoid NegativeArraySizeException parsing doc file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801395 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 22:32:27 +00:00
PJ Fanning
9225a961a3 fix spelling
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801393 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 21:34:53 +00:00
Nick Burch
05c7c16308 #61266 Test for old unsupported MS Write WRI files, and give a more helpful exception if found, plus unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801376 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 16:26:33 +00:00
Andreas Beeker
0cac9103ba Rollback of r1801368 because of a generics bug with self-referenced types in Java6
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801373 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 15:27:29 +00:00
Andreas Beeker
04ffc95da7 SL Common: narrow generics definition because of tighter java9 checks
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801368 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 11:09:45 +00:00
Andreas Beeker
e3c7ef471a test environment via ant - not via the shell - hope that makes sense ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801341 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 23:44:35 +00:00
Andreas Beeker
edae42cb91 add .ttf to ignored test integration resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801339 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 23:15:21 +00:00
Andreas Beeker
377615e9cd #61169 - Text with Japanese characters overflows textbox
- add resize methods with Graphics argument

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801329 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 22:20:55 +00:00
PJ Fanning
cfc7aa4315 [Bug 58975] add test case for new function args default of 255
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1801307 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 18:15:49 +00:00
PJ Fanning
23567cd3a0 [github-25] support excel number trailing comma format - Thabks to Luca Martini for proving the patch
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800975 13f79535-47bb-0310-9956-ffa450edef68
2017-07-06 07:56:57 +00:00
PJ Fanning
a0aa8807b5 [Bug 58975] do not cast numberOfOperands to byte in AbstractFunctionPtg
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800949 13f79535-47bb-0310-9956-ffa450edef68
2017-07-05 22:56:32 +00:00
PJ Fanning
a33eef41a0 fix javadoc issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800717 13f79535-47bb-0310-9956-ffa450edef68
2017-07-03 22:18:25 +00:00
PJ Fanning
86f7d0b896 [Bug 60422] fix data formatter issue with specific format in German locale
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800713 13f79535-47bb-0310-9956-ffa450edef68
2017-07-03 20:56:02 +00:00
PJ Fanning
68be989d22 [Bug 61246] remove flush method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800712 13f79535-47bb-0310-9956-ffa450edef68
2017-07-03 20:32:55 +00:00
PJ Fanning
0c9a1ef203 [Bug 61246] fix issue where SXSSF sheet data has unicode surrogate chars replaced by '?'
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800705 13f79535-47bb-0310-9956-ffa450edef68
2017-07-03 18:49:25 +00:00
PJ Fanning
e02f6e038f Remove check for jdk1.5 in test because POI now only supports jre1.6 and up
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800696 13f79535-47bb-0310-9956-ffa450edef68
2017-07-03 16:16:35 +00:00
PJ Fanning
3cac752c89 Add missing deprecations for CellType methods that return ints
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800569 13f79535-47bb-0310-9956-ffa450edef68
2017-07-02 17:12:55 +00:00
PJ Fanning
0aa4406a08 add test case for date formatting using different locales
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800558 13f79535-47bb-0310-9956-ffa450edef68
2017-07-02 12:29:37 +00:00
Andreas Beeker
645aa063fa add version.id to release notes in update-download template
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800529 13f79535-47bb-0310-9956-ffa450edef68
2017-07-01 19:53:47 +00:00
Andreas Beeker
a09a3398cc #61243 - Refactor and unify toString/toXml in DDF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800452 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 20:21:33 +00:00
PJ Fanning
cbb15b1efa Remove more deprecated code (MissingCellPolicy)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800400 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 13:00:57 +00:00
PJ Fanning
05d8c18a58 Remove more deprecated code (BorderFormatting constants)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800385 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 12:18:13 +00:00
PJ Fanning
ee70c9a8fb Remove more deprecated code (especially from Spreadsheet Cell classes)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800375 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 11:48:23 +00:00
Javen O'Neal
e552b04d9c remove incomplete javadocs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800361 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 07:48:40 +00:00
Javen O'Neal
7cb0588daf add @Internal annotation to methods that return a CT* class
add @Override annotation where missing

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800360 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 07:45:46 +00:00
Greg Woolsey
07a7987a48 Expose one more bit of style information generically (for XSSF). If someone needs all these properties for HSSF charts as well, we can build a new Interface for the various bits and populate it with things like axis line width and color, etc. but for now I think most users are in the XSSF realm like me.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800341 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 23:06:27 +00:00
Nick Burch
2cbd15ece2 Deprecated xssfSheetIterator has been removed, so remove javadoc reference
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800288 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 14:38:41 +00:00
Andreas Beeker
b2d19936ef remove temporary jenkins debug output
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800263 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 10:49:22 +00:00
Andreas Beeker
1ce039753a remove timezoned call to Date.toString() - SignatureProperties don't necessarily need an Id attribute
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800257 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 09:33:33 +00:00
PJ Fanning
2ec623fe0b remove deprecated org.apache.poi.hssf.record.RecordFormatException
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800256 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 09:06:30 +00:00
PJ Fanning
af35e389da remove some unused imports
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800255 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 08:55:35 +00:00
PJ Fanning
5f6e2b780a remove deprecated POIXMLDocument.hasOOXMLHeader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800254 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 08:45:00 +00:00
PJ Fanning
1281127420 remove deprecated org.apache.poi.hssf.record.RecordFormatException
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800249 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 08:37:02 +00:00
PJ Fanning
657784ce1a Remove old XSSFWorkbook wb.xssfSheetIterator method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800248 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 08:15:50 +00:00
PJ Fanning
4bcc0f4eb1 Remove old XSSFPaswordHelper
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800247 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 08:10:32 +00:00
Nick Burch
b3149fe1ad Fix javadoc warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800214 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 23:30:15 +00:00
Nick Burch
07c18a9055 Used deprecated external method removed, so remove internal method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800212 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 23:29:58 +00:00
Nick Burch
a658a7f573 Used deprecated external method removed, so remove internal method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800211 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 23:25:41 +00:00
Andreas Beeker
9ef695aedf add debugging info to find signature differences
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800209 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 23:04:25 +00:00
PJ Fanning
5c65b55bd4 Ensure SpreadsheetVersion is set for AreaReferences
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800208 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 22:11:26 +00:00
Andreas Beeker
51b46a9e4e Bug 61182 - Invalid signature created for streamed xslx file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800207 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 21:38:23 +00:00
PJ Fanning
4209a1b2da Remove some deprecated *SSF APIs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800147 13f79535-47bb-0310-9956-ffa450edef68
2017-06-28 10:34:37 +00:00
Nick Burch
a753adb848 Add import for javadocs references
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799832 13f79535-47bb-0310-9956-ffa450edef68
2017-06-25 19:16:36 +00:00
PJ Fanning
03d4e52bc0 expand StaxHelper
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799772 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 13:53:47 +00:00
Andreas Beeker
196b1429fc prepare for 3.17-beta2
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799747 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 09:27:28 +00:00
Andreas Beeker
85963a56f7 rollback invalid commit - r1799740
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799742 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 09:20:02 +00:00
Andreas Beeker
6aae53935a release prepare for 3.17-beta1 - pin documentation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799740 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 09:03:00 +00:00
PJ Fanning
61b0ecbd4b Add StaxHelper to ensure that StAX parsers have sensible defaults, including settings to avoid XML Entity Expansion issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799734 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 07:30:07 +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
PJ Fanning
eee5205d0c [Bug 60422] Fix forbidden-api build issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799723 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 00:37:03 +00:00
PJ Fanning
c1cc93a2ef [Bug 60422] Tidy up test case
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799722 13f79535-47bb-0310-9956-ffa450edef68
2017-06-24 00:15:20 +00:00
PJ Fanning
66b39c70ad Bug 60422 add testtestcase with current LocaleUtil workaround
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799721 13f79535-47bb-0310-9956-ffa450edef68
2017-06-23 23:42:25 +00:00
Greg Woolsey
0e23e4e9d8 Move my new unit conversions to the Units class, move and deprecate duplicate and scattered unit constants, update constant references to standardize on the ones in the Units class.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799683 13f79535-47bb-0310-9956-ffa450edef68
2017-06-23 15:43:48 +00:00
Greg Woolsey
12048f528b Bug 61203
one of these days I'll add the copyright to my project templates.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799645 13f79535-47bb-0310-9956-ffa450edef68
2017-06-23 06:17:09 +00:00
Greg Woolsey
8c67848ad6 Bug 61203 - XSSFDrawing.getAnchorFromParent handles CTOneCellAnchor incorrectly, ignores CTAbsoluteAnchor
This is likely incomplete, but closer to where things should be.  It is backward compatible with previous uses of XSSFClientAnchor.

This fixes a bug in XSSFGraphicFrame that was hiding the parent class anchor property (which is a protected field set directly from XSSFDrawing).  This is a peril of using direct property access - the hiding wasn't obvious because there was no setter being overridden.

XSSFGraphicFrame now notices when it relates to a chart, and setts the frame property of the XSSFChart.  That was not being set on parse previously, only when creating charts from scratch.  That didn't seem right.

XSSFClientAnchor now calculates size and position correctly based on initial inputs from the different types of anchors.  It DOES NOT update those initial inputs, however.  It does properly adjust if the size or initial position are absolute and the corresponding row/column values are requested.

Added new class EMUUtils to centralize the measurement constants and conversions since there are so many units in play in the OOXML spec and POI APIs:

* EMUs (English Metric Units)
* Inches
* Centimeters
* Points
* Pixels
* Twips (1/20th of a point)

I'm sure there are more conversions that could be done there, I just started with what I needed.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799643 13f79535-47bb-0310-9956-ffa450edef68
2017-06-23 05:16:38 +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
Tim Allison
fe5f8fb54c bug 61053 -- not a fix, but this aligns XSSFBSheetHandler's behavior with streaming and non-streaming extractors for xlsx
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799345 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 12:59:33 +00:00
Javen O'Neal
c0e5fcaa98 javadoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799332 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 09:52:43 +00:00
Javen O'Neal
1866c69754 @Ignore("requires an internet connection to a 3rd party site"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799326 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 09:16:05 +00:00
Javen O'Neal
9326624d76 unit test that is not written yet should fail
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799324 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 09:13:18 +00:00
Javen O'Neal
de9134c1d8 simplify unit test code with IOUtils.write to a NullOutputStream
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799323 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 09:12:42 +00:00
Nick Burch
4a51090ae7 Javadoc fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799320 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 09:04:02 +00:00
Javen O'Neal
171692edf2 bug 57919: close opened resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799316 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 08:13:58 +00:00
Javen O'Neal
46b5d839c3 bug 57919: add functions to write and close a POIDocument, guaranteeing closure of the output stream and document.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799308 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 07:28:14 +00:00
Javen O'Neal
5971083683 rename createXls and createXlsx helper functions: these are specifically for testing text rotation.
Made the file creation compatible on Windows and Mac/Linux using POI TempFile instead of a hard-coded filename.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799307 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 07:05:08 +00:00
Javen O'Neal
51065c8159 bug 58113: this passes with SXSSF now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799306 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 07:03:13 +00:00
Javen O'Neal
15212e0feb bug 56557: open test-data/spreadsheet/56557.xlsx such that the unit test test56557() does not leave a modified file on disk after running.
I verified that
> Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56557.xlsx")
and
> Workbook wb = WorkbookFactory.create(XSSFTestDataSamples.getSampleFile("56557.xlsx"), password=null, readOnly=false);
both fail when the fix from r1798913 for SXSSFWorkbook is not applied and both pass when the fix is applied.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799304 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 06:08:38 +00:00
Javen O'Neal
4d692223bb whitespace
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799303 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 05:51:48 +00:00
Javen O'Neal
5de40d3261 bug 52063: support 2-argument LOOKUP(lookup_value, array) function in Excel
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799302 13f79535-47bb-0310-9956-ffa450edef68
2017-06-20 05:47:56 +00:00
Dominik Stadler
2095c92402 Improve error message if we encounter invalid/unexpected files in integration tests
Adjust some tests slightly

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799178 13f79535-47bb-0310-9956-ffa450edef68
2017-06-19 11:05:20 +00:00
Dominik Stadler
66bf6c5ad7 Need to do the casting differently to make the code compile with Java 6
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799038 13f79535-47bb-0310-9956-ffa450edef68
2017-06-18 05:59:31 +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
a37f6a4997 Update forbidden-apis to version 2.3
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799036 13f79535-47bb-0310-9956-ffa450edef68
2017-06-18 05:59:16 +00:00
Dominik Stadler
bac17be565 Fix some IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799035 13f79535-47bb-0310-9956-ffa450edef68
2017-06-18 05:59:11 +00:00
Andreas Beeker
0e57435abe #61169 - Text with Japanese characters overflows textbox
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798986 13f79535-47bb-0310-9956-ffa450edef68
2017-06-17 00:00:49 +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
Dominik Stadler
20f46393f7 Fix some IntelliJ warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798913 13f79535-47bb-0310-9956-ffa450edef68
2017-06-16 11:35:31 +00:00
Javen O'Neal
c05e2ae644 bug 61170: add comment why we should catch exceptions in SAXHelper
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798793 13f79535-47bb-0310-9956-ffa450edef68
2017-06-15 05:08:24 +00:00
Javen O'Neal
f66153c810 bug 61170: add extra logging to SaxHelper.
Thanks to PJ Fanning for the patch!
This closes #58 on github.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798792 13f79535-47bb-0310-9956-ffa450edef68
2017-06-15 05:00:25 +00:00
Andreas Beeker
14b2d4501a #61162 - En-/decryption support for HWPF
- encryption support for HWPF
- refactor/unify EncryptionInfo handling in H**F classes
- remove Iterable interface from WorkbookRecordList - use getRecords() instead, to prevent modifications over the Iterator

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798722 13f79535-47bb-0310-9956-ffa450edef68
2017-06-14 17:21:50 +00:00
Greg Woolsey
e5c5cba87c Standardize some more common chart axis properties.
Implement the ChartAxis ss interface for date axes, which are pretty much a category axis with one extra property, a date granularity (not currently passed through, get it still from the CT* class).  Created the class and test from the category axis versions.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798414 13f79535-47bb-0310-9956-ffa450edef68
2017-06-12 05:38:41 +00:00
Nick Burch
036aa25f72 Javadoc has some references to unit test classes, so put the junit jars on the javadoc classpath
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798324 13f79535-47bb-0310-9956-ffa450edef68
2017-06-10 15:01:14 +00:00
Greg Woolsey
8d7bab82bb Don't report data table master cells as formula cells, since POI doesn't evaluate data table formulas.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798289 13f79535-47bb-0310-9956-ffa450edef68
2017-06-10 01:04:40 +00:00
Dominik Stadler
937500f6ee Forbidden-APIs needs junit-jars
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798204 13f79535-47bb-0310-9956-ffa450edef68
2017-06-09 12:49:58 +00:00
Dominik Stadler
05570364db Move one testcase with incorrect source location
remove some junit dependencies in example-code
build: do not pass junit-jar to normal compile targets to avoid introducing it as dependency again 
Reformat code, fix warnings, ...

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798202 13f79535-47bb-0310-9956-ffa450edef68
2017-06-09 12:49:01 +00:00
Dominik Stadler
938bb91c51 Bug 60374: Add test for ArrayIndexOutOfBounds on old Word Documents due to Non-Unicode
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1798200 13f79535-47bb-0310-9956-ffa450edef68
2017-06-09 12:47:03 +00:00
Nick Burch
993801aa1c Update the CreateTable example to reduce the use of the raw CT classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797923 13f79535-47bb-0310-9956-ffa450edef68
2017-06-07 13:35:20 +00:00
Nick Burch
7b38f8c5f1 Permit table style modifications, needed for CreateTable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797922 13f79535-47bb-0310-9956-ffa450edef68
2017-06-07 13:33:58 +00:00
Nick Burch
fd0e150a94 Make it possible to create simple XSSF sheet tables without needing CT classes directly
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797919 13f79535-47bb-0310-9956-ffa450edef68
2017-06-07 13:06:38 +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
Andreas Beeker
a5dda416e7 Ignore JCE restriction errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797856 13f79535-47bb-0310-9956-ffa450edef68
2017-06-07 06:25:56 +00:00
Andreas Beeker
20dcde37ec Handle encrypted files with known password in integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797839 13f79535-47bb-0310-9956-ffa450edef68
2017-06-06 22:21:46 +00:00
Andreas Beeker
739599059a Replace HWPFOutputStream with ByteArrayOutputStream - it doesn't add any new features
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797838 13f79535-47bb-0310-9956-ffa450edef68
2017-06-06 22:21:40 +00:00
Andreas Beeker
2b4f944883 #61162 - En-/decryption support for HWPF
Decryption for Binary RC4 and CryptoAPI (... XOR is missing)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797837 13f79535-47bb-0310-9956-ffa450edef68
2017-06-06 22:21:11 +00:00
Javen O'Neal
70db823b18 bug 58325, github-57: Set svn props. This closes #57 on github.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797602 13f79535-47bb-0310-9956-ffa450edef68
2017-06-04 19:01:51 +00:00
Javen O'Neal
b0d0f2d255 bug 58325: enable TestXSSFShape unit tests. Thanks to Dominik Stadler for the initial unit test. Thanks to PJ Fanning for discovering that the bug was fixed at some point in the past and enabling the unit tests.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797600 13f79535-47bb-0310-9956-ffa450edef68
2017-06-04 18:59:18 +00:00
Andreas Beeker
efccafd898 fix eclipse resource leak warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797043 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 14:10:18 +00:00
Javen O'Neal
4232a72208 javadocs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796966 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 02:46:24 +00:00
Andreas Beeker
95164e4a50 SonarQube fixes - close resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796962 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 00:31:53 +00:00
Greg Woolsey
7e6007e0bd #61085 support table styles
Needed a bit more, to support table/range only border properties for "internal" vertical and horizontal borders.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796961 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 00:22:58 +00:00
Andreas Beeker
eb95017049 increase heap size for ooxml compilation again, because of failing (gradle?) builds
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796868 13f79535-47bb-0310-9956-ffa450edef68
2017-05-30 13:57:42 +00:00
Andreas Beeker
b2ab7542ac Add logging for gradle->ant->javac OOM
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796862 13f79535-47bb-0310-9956-ffa450edef68
2017-05-30 13:33:07 +00:00
Andreas Beeker
3189e01388 ignore <project root>/tmp directory
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796825 13f79535-47bb-0310-9956-ffa450edef68
2017-05-30 09:52:10 +00:00
Andreas Beeker
49e47cb6e1 Bug 61119 - Fix preset shape rendering and shading
- Fixed conversion of ooxml to awt angle
- replace subclasses and reflection calls with enums
- implemented tinting/shading of preset shapes


git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796823 13f79535-47bb-0310-9956-ffa450edef68
2017-05-30 09:33:28 +00:00
Javen O'Neal
b3c6907741 bug 61059: fix NamePtg to read unsigned shorts instead of signed shorts, avoiding a AIOOBE when a workbook contains more than 32k Names. Thanks to Travis Burtrum for the patch.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796466 13f79535-47bb-0310-9956-ffa450edef68
2017-05-28 01:17:16 +00:00
Greg Woolsey
479b45ced9 Bug 60898 - XSSFColor's getARGB() method returns a wrong color value when a workbook has a custom indexed color
Missed this test.  As part of the work I noticed the Enum was missing some values defined in the OOXML spec, so I added them.

I've updated the test to reflect that those values are no longer invalid.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796360 13f79535-47bb-0310-9956-ffa450edef68
2017-05-26 23:37:04 +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
3021f03be9 Add jmh to Sonar-Maven build as well, add comment why we need to stick to 1.15 for now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1796035 13f79535-47bb-0310-9956-ffa450edef68
2017-05-24 10:07:32 +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
Dominik Stadler
8564aa7bb6 Reformat code somewhat
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795962 13f79535-47bb-0310-9956-ffa450edef68
2017-05-23 21:12:50 +00:00
Javen O'Neal
7881d05743 github-55: document that CellReference#isRowWithinRange(String rowNum, SpreadsheetVersion ss) expects rowNum to be parseable as an integer
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795681 13f79535-47bb-0310-9956-ffa450edef68
2017-05-20 21:04:14 +00:00
Javen O'Neal
4ff23197e9 bug 61110: remove deprecated, misspelled CellReference#isRowWithnRange and #isColumnWithnRange methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795680 13f79535-47bb-0310-9956-ffa450edef68
2017-05-20 20:22:24 +00:00
Andreas Beeker
390444a3be Increase memory for xmlbean generation, because of failing gump builds.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795661 13f79535-47bb-0310-9956-ffa450edef68
2017-05-20 15:11:58 +00:00
Greg Woolsey
2d2aa5196a #61085 support table styles
Added more features - this allows a client app to fully display table styling without resorting to CT* classes, and has some helper logic for the additional processing needed for things like regional/area borders.

As far as I can tell I only added stuff, didn't change any existing behavior.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795648 13f79535-47bb-0310-9956-ffa450edef68
2017-05-20 04:05:32 +00:00
Greg Woolsey
6e6cf9ea58 add the new test dependency so tests can run from Eclipse (required for running local builds in Eclipse)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795647 13f79535-47bb-0310-9956-ffa450edef68
2017-05-20 04:01:52 +00:00
Javen O'Neal
284f7d19c5 github-55: NumberFormatException if XSSFName.setNameName is set with a long name that looks similar to a cell address. Thanks to Thomas S @Millie4Ever
This closes #55 on github.
https://github.com/apache/poi/pull/55

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795595 13f79535-47bb-0310-9956-ffa450edef68
2017-05-19 08:26:41 +00:00
Javen O'Neal
0b767886bf replace "String.indexOf(String) >= 1" with "String.contains(String)"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795296 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 10:53:15 +00:00
Javen O'Neal
f701e81a64 github-25: add enable locking and tab color in SXSSFSheet. Thanks to Danilo Rangel. This closes #25.
https://github.com/apache/poi/pull/25

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795277 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 08:38:58 +00:00
Javen O'Neal
b6f78f8d57 github-32: speed up Irr() Excel formula computation by replacing Math.pow() with multiplication. Thanks to Daniel Kuan! This closes #32.
https://github.com/apache/poi/pull/32

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795266 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 03:18:17 +00:00
Javen O'Neal
be5106a1d7 github-43: add disabled unit test showing a problem with ROUNDUP(3987*0.2, 2). Thanks to @FishMeat.
https://github.com/apache/poi/pull/43

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795265 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 03:04:12 +00:00
Nick Burch
fec503f1de Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795261 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 02:50:35 +00:00
Javen O'Neal
b527f96daa github-52: add ExcelToHtmlConverter method that works on InputStreams. Thanks to Tony Zeng! This closes #52.
https://github.com/apache/poi/pull/52

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795256 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 00:58:01 +00:00
Javen O'Neal
fac98b5bef github-53: fix NPE when iterating over paragraphs in certain *.docx files. Thanks to Praful Kumar Vaishnav! This closes #53.
https://github.com/apache/poi/pull/53

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795254 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 00:41:25 +00:00
Javen O'Neal
5c62492ffb github-54: when adding a picture to an XSSFWorkbook, reduce memory consumption by 100x and increase speed by 10x based on OpenJDK JMH benchmarking. Thanks to Tim Helmstedt! This closes #54.
https://github.com/apache/poi/pull/54

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795252 13f79535-47bb-0310-9956-ffa450edef68
2017-05-15 23:27:21 +00:00
Andreas Beeker
8c1346b138 Add ASL header and exclude table preset from rat-check
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795137 13f79535-47bb-0310-9956-ffa450edef68
2017-05-15 06:30:06 +00:00
Andreas Beeker
90dca20bd2 #52117 - Invalid "last printed" summary field value - added helper method to identify undefined dates
HPSF: fixed uid listing in Section.toString()
HPSF: moved timestamp based "utility" methods to Filetime class
HPSF: preserve original datastream for unchanged property sets

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795123 13f79535-47bb-0310-9956-ffa450edef68
2017-05-14 22:25:33 +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
bf83a00457 tweak to use platform line separator so tests can pass on Windows as well as Linux.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1795026 13f79535-47bb-0310-9956-ffa450edef68
2017-05-12 22:13:30 +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
Dominik Stadler
e77156d9f4 Simplify the ValueEval.toString() implementations and include more information on unexpected types of ValueEval
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1794956 13f79535-47bb-0310-9956-ffa450edef68
2017-05-12 11:38:05 +00:00
Dominik Stadler
d9df038f4a Bug 60352: Text extraction: Don't include the text "null" for empty cells
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1794260 13f79535-47bb-0310-9956-ffa450edef68
2017-05-07 21:03:46 +00:00
Greg Woolsey
8313b17515 60184 - invalid OOXML produced when XSSFFont.getFamily() called with no families defined
Fix to stop creating an empty family when none exist, just use the existing logic to return NOT_APPLICABLE.  Creating the empty element produces XML that doesn't comply with the XSD.

Alternative would have been to set the family int value for the new family, but this way checking the value doesn't change the output, which is my preferred behavior.  No quantum effects!

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1794111 13f79535-47bb-0310-9956-ffa450edef68
2017-05-05 21:50:59 +00:00
Greg Woolsey
6bca07a15f forgot license (as always)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1794093 13f79535-47bb-0310-9956-ffa450edef68
2017-05-05 18:33:49 +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
Dominik Stadler
b77cfc60cd Update link to POI-view on the Jenkins CI server
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793760 13f79535-47bb-0310-9956-ffa450edef68
2017-05-04 09:25:40 +00:00
Dominik Stadler
454a0cc577 Revert creating a view as part of the Jenkins DSL as it did not allow to create the view as part of a folder/sub-view
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793754 13f79535-47bb-0310-9956-ffa450edef68
2017-05-04 08:52:44 +00:00
Dominik Stadler
350f9d6f2a Try to define the view as part of the Jenkins DSL, also try to move the view into sub-folder, see also INFRA-14002
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793752 13f79535-47bb-0310-9956-ffa450edef68
2017-05-04 08:40:12 +00:00
Andreas Beeker
fb28b14d48 test integration fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793733 13f79535-47bb-0310-9956-ffa450edef68
2017-05-04 01:13:48 +00:00
Andreas Beeker
ad72f60ab6 SonarQube fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793727 13f79535-47bb-0310-9956-ffa450edef68
2017-05-03 22:16:26 +00:00
Andreas Beeker
76dbb5a1eb HPSF: Change CustomProperties to delegate
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793699 13f79535-47bb-0310-9956-ffa450edef68
2017-05-03 19:18:45 +00:00
Andreas Beeker
d0630390d2 Remove Unicode chars in comments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793647 13f79535-47bb-0310-9956-ffa450edef68
2017-05-03 14:08:04 +00:00
Andreas Beeker
0f78f6dc1f fix javadocs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793604 13f79535-47bb-0310-9956-ffa450edef68
2017-05-03 00:14:55 +00:00
Andreas Beeker
cd6236c74b #52372 - OutOfMemoryError parsing a word file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793602 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:32:13 +00:00
Andreas Beeker
a0b324224b Reverted DocumentSummary hack in codepage guessing code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793601 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:30:17 +00:00
Andreas Beeker
eeb697001f HPSF: Add CopyCompare to IntegrationTests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793600 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:29:19 +00:00
Andreas Beeker
3a56f1ab3f #52117 - Invalid "last printed" summary field value
added test file to corpus

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793599 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:28:48 +00:00
Andreas Beeker
3a1771ced1 HPSF: Enable new number types in VariantSupport
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793598 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:28:00 +00:00
Andreas Beeker
456b33a837 Fix hpsf javadocs and code issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793596 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:27:27 +00:00
Andreas Beeker
5600fa6f58 IntegrationTest - move excludes to file handler
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793595 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:25:45 +00:00
Andreas Beeker
63b88fec6a HPSF: Use LittleEndianStream instead of offset calculation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793594 13f79535-47bb-0310-9956-ffa450edef68
2017-05-02 23:24:50 +00:00
Javen O'Neal
95538eb815 bug 61059: add @Override annotations
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793418 13f79535-47bb-0310-9956-ffa450edef68
2017-05-01 21:51:34 +00:00
Dominik Stadler
a39df8eb71 Exclude one more test from no-scratchpad runs, not sure how this was even working before...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793253 13f79535-47bb-0310-9956-ffa450edef68
2017-04-30 09:12:48 +00:00
Dominik Stadler
5265ff6f81 Improve information contained in exception in CellRangeAddress()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793252 13f79535-47bb-0310-9956-ffa450edef68
2017-04-30 09:12:44 +00:00
Dominik Stadler
fa39402871 60325: Add commented out test that reproduces the performance issue
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793251 13f79535-47bb-0310-9956-ffa450edef68
2017-04-30 09:12:36 +00:00
Nick Burch
28cbb8e84e Javadoc fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793249 13f79535-47bb-0310-9956-ffa450edef68
2017-04-30 08:49:51 +00:00
Javen O'Neal
f5389965a2 bug 61034: break out of for-loop when both <sheet name="", id=""/> are found
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1793230 13f79535-47bb-0310-9956-ffa450edef68
2017-04-29 18:56:09 +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
Tim Allison
a98eaeb917 bug 61051 -- add new worksheet-like relations for xlsb
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792940 13f79535-47bb-0310-9956-ffa450edef68
2017-04-27 18:50:22 +00:00
Tim Allison
5f567f29a1 bug 61049 fix ordering of builtin formulas
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792918 13f79535-47bb-0310-9956-ffa450edef68
2017-04-27 16:18:25 +00:00
Nick Burch
9896e13bf4 Patch from Tim Jones from #61044 - Note on setCompressTempFiles
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792720 13f79535-47bb-0310-9956-ffa450edef68
2017-04-26 09:43:56 +00:00
Tim Allison
c2dc3ad585 bug 61021 - extract abspath from xlsb
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792198 13f79535-47bb-0310-9956-ffa450edef68
2017-04-21 13:02:29 +00:00
Greg Woolsey
f5b90cbbee Add conditional formatting evaluation example code and output results
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792102 13f79535-47bb-0310-9956-ffa450edef68
2017-04-20 18:05:50 +00:00
Javen O'Neal
3c2a6b38bb Use assertContains instead of assertTrue(text.contains) for better error messages on failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792009 13f79535-47bb-0310-9956-ffa450edef68
2017-04-20 01:28:40 +00:00
Javen O'Neal
3cbf4740b1 Use assertContains instead of assertTrue(text.contains) for better error messages on failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1792007 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 23:51:03 +00:00
Greg Woolsey
6e0a5916b5 Fix bug #61007
Revert to previous "expected" test results even though they don't match excel for a specific case, to accommodate tighter logic about which format patterns to send to CellFormat vs. handle directly in DataFormatter.

Send what was checked previously plus only multi-segment conditional range formats.  Allows existing tests to pass plus the new test with the case for these conditional formats.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791964 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 20:04:46 +00:00
Greg Woolsey
d1b92fe2d8 Fix bug #61007
use CellFormat for all format strings containing multiple parts (";" delimited) and update unit test to expect the same values as Excel.  Also added tests for the failing formats.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791949 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 18:10:52 +00:00
Nick Burch
d4d08d5ce8 Use assertContains instead of assertTrue(text.contains) for better error messages on failure
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791857 13f79535-47bb-0310-9956-ffa450edef68
2017-04-19 06:13:33 +00:00
Dominik Stadler
511c2544a8 Let IntelliJ cleanup some code-warnings across the whole code-base: unnecessary toString or semicolon
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791720 13f79535-47bb-0310-9956-ffa450edef68
2017-04-17 20:13:52 +00:00
Andreas Beeker
c89d312bad #60998 - HSLFTable.setRowHeight sets row height incorrect
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791696 13f79535-47bb-0310-9956-ffa450edef68
2017-04-17 17:13:23 +00:00
Andreas Beeker
7df2a8804c findbugs fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791679 13f79535-47bb-0310-9956-ffa450edef68
2017-04-17 11:02:22 +00:00
Andreas Beeker
544657556a add 3.16 to doap file
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791674 13f79535-47bb-0310-9956-ffa450edef68
2017-04-17 09:50:52 +00:00
Andreas Beeker
594b46f1cd fix forbidden-apis-check error
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791646 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 23:43:56 +00:00
Andreas Beeker
bd237e2483 #60996 - XSSF: Multiple embedded objects on same sheet are ignored
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791644 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 22:41:28 +00:00
Andreas Beeker
3d53258942 Website update / release guide fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791631 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 20:40:47 +00:00
Dominik Stadler
f0b2404b86 Add initial file of excludes when running with file-leak-detector
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791594 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 10:19:49 +00:00
Dominik Stadler
14086f953f Exclude more temporary files from Git
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791593 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 10:19:44 +00:00
Dominik Stadler
30d6ba68c7 Set eclipse folder outside of build-folder to not have hickups in Eclipse whener we run 'ant clean'
Conflicts:
	.classpath

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791592 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 10:19:41 +00:00
Dominik Stadler
3e06696ae3 Revert "Add hamcrest-all to Gradle build as well"
This reverts commit e452090d41190820ec7f2591097fb9e63ad6c59c.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791587 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 09:46:54 +00:00
Dominik Stadler
89976adea2 Add hamcrest-all to Gradle build as well
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791586 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 09:45:23 +00:00
Javen O'Neal
21f5fc8eaf roll back to hamcrest-core
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791572 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 06:19:30 +00:00
Javen O'Neal
dc29c94460 roll back to hamcrest-core
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791570 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 06:10:23 +00:00
Javen O'Neal
abc2f1f9ea change from hamcrest-core-1.3 to hamcrest-all-1.3
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791567 13f79535-47bb-0310-9956-ffa450edef68
2017-04-16 05:02:07 +00:00
Andreas Beeker
160fb550c1 #60993 - HSLF: Grid and rowspan calculation in table cells is wrong
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791500 13f79535-47bb-0310-9956-ffa450edef68
2017-04-15 12:14:26 +00:00
Javen O'Neal
0acf44d3dc improve unit test error messages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791445 13f79535-47bb-0310-9956-ffa450edef68
2017-04-15 03:21:34 +00:00
Javen O'Neal
ef8c9329cf change from hamcrest-core-1.3 to hamcrest-all-1.3
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791444 13f79535-47bb-0310-9956-ffa450edef68
2017-04-15 03:19:27 +00:00
Javen O'Neal
e7ca1594da use hamcrest matchers to reduce custom code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791443 13f79535-47bb-0310-9956-ffa450edef68
2017-04-15 02:50:46 +00:00
Javen O'Neal
7977026f96 use assertStartsWith and assertEndsWith for better unit test error messages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791440 13f79535-47bb-0310-9956-ffa450edef68
2017-04-15 02:19:24 +00:00
Nick Burch
70ae27f96d #60973 XDGF Support for "PolylineTo" as well as existing alternate spelling "PolyLineTo"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791108 13f79535-47bb-0310-9956-ffa450edef68
2017-04-12 11:11:56 +00:00
Nick Burch
3bd1f662f3 Failing, disabled unit test for bug #60973
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791098 13f79535-47bb-0310-9956-ffa450edef68
2017-04-12 09:40:54 +00:00
Andreas Beeker
1078cef19c prepare for 3.17-beta1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1791047 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 22:14:38 +00:00
2450 changed files with 139248 additions and 92255 deletions

View File

@ -15,22 +15,34 @@
<classpathentry kind="src" path="src/excelant/testcases"/>
<classpathentry kind="src" path="src/excelant/resources"/>
<classpathentry kind="src" path="src/integrationtest"/>
<classpathentry kind="lib" path="lib/ant-1.9.4.jar"/>
<classpathentry kind="lib" path="lib/ant-launcher-1.9.4.jar"/>
<classpathentry kind="lib" path="lib/ant-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/ant-launcher-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry exported="true" kind="lib" path="ooxml-lib/xmlbeans-2.6.0.jar"/>
<classpathentry exported="true" kind="lib" path="ooxml-lib/xmlbeans-3.0.2.jar" sourcepath="ooxml-lib/xmlbeans-3.0.2.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="ooxml-lib/curvesapi-1.04.jar"/>
<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-schemas-1.3.jar" sourcepath="ooxml-lib/ooxml-schemas-1.3-sources.jar"/>
<classpathentry kind="lib" path="ooxml-lib/curvesapi-1.05.jar"/>
<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-schemas-1.4.jar" sourcepath="ooxml-lib/ooxml-schemas-1.4-sources.jar"/>
<classpathentry exported="true" kind="lib" path="ooxml-lib/ooxml-security-1.1.jar" sourcepath="ooxml-lib/ooxml-security-1.1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry exported="true" kind="lib" path="compile-lib/slf4j-api-1.7.12.jar"/>
<classpathentry kind="lib" path="compile-lib/bcpkix-jdk15on-1.54.jar"/>
<classpathentry kind="lib" path="compile-lib/bcprov-ext-jdk15on-1.54.jar"/>
<classpathentry exported="true" kind="lib" path="compile-lib/xmlsec-2.0.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="lib/jmh-core-1.19.jar"/>
<classpathentry kind="lib" path="lib/jmh-generator-annprocess-1.19.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry exported="true" kind="lib" path="compile-lib/slf4j-api-1.7.25.jar"/>
<classpathentry kind="lib" path="compile-lib/bcpkix-jdk15on-1.60.jar"/>
<classpathentry kind="lib" path="compile-lib/bcprov-ext-jdk15on-1.60.jar"/>
<classpathentry kind="lib" path="ooxml-testlib/reflections.jar"/>
<classpathentry kind="lib" path="ooxml-testlib/guava.jar"/>
<classpathentry kind="lib" path="ooxml-testlib/javassist.jar"/>
<classpathentry exported="true" kind="lib" path="compile-lib/xmlsec-2.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections4-4.1.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections4-4.2.jar"/>
<classpathentry kind="lib" path="lib/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="lib/xmlunit-core-2.5.1.jar"/>
<classpathentry kind="lib" path="lib/mockito-core-2.21.0.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-1.7.9.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-agent-1.7.9.jar"/>
<classpathentry kind="lib" path="lib/objenesis-2.6.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.18.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
test-data/hmef/quick-contents/quick.html text eol=lf

48
.gitignore vendored
View File

@ -1,21 +1,49 @@
classes
workbook.xls
bak
*.iws
build.number
*.el
TEST-org.apache.poi*.xml
build
.settings
scripts
*.ipr
untitled1.jpx
*.iml
log*.*
dist
*.log
bin
.ant-targets-build.xml
out
forrest.properties
compile-lib/
ooxml-lib/
ooxml-testlib/
# Eclipse
/bin
.settings
# Tests
junit*.properties
TEST-org.apache.poi*.xml
# Sonar
.sonar
sonar/main/src/
sonar/ooxml/src/
sonar/scratchpad/src/
sonar/ooxml-schema-security/src/
sonar/examples/src/
sonar/excelant/src/
sonar/target
sonar/*/target
# IntelliJ
/out/
.idea
*.iml
*.iws
*.ipr
# Gradle
.gradle
# Ant
.ant-targets-build.xml
build
dist
lib/

View File

@ -12,14 +12,17 @@ org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -110,7 +113,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
@ -124,8 +128,10 @@ org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
@ -135,6 +141,8 @@ org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
@ -193,6 +201,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
@ -387,11 +396,24 @@ org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter

185
KEYS
View File

@ -1762,13 +1762,13 @@ W45jdvBkYoPdQtS+8Vy+q0997zobctz8i5hfXzxg51/IuSU4uNtgr26XapsoLDur
=/Vu1
-----END PGP PUBLIC KEY BLOCK-----
pub rsa2048/26062CE3 2014-08-17 [expires: 2018-08-21]
uid [ultimate] Andreas Beeker <kiwiwings@apache.org>
uid [ultimate] Andreas Beeker (kiwiwings) <andreas.beeker@gmx.de>
sub rsa2048/EE864ED6 2014-08-17 [expires: 2018-08-21]
pub rsa2048 2014-08-17 [SC] [expires: 2020-07-06]
24188560524400B142BE3386A93E1C4B26062CE3
uid [ultimate] Andreas Beeker <kiwiwings@apache.org>
uid [ultimate] Andreas Beeker (kiwiwings) <andreas.beeker@gmx.de>
sub rsa2048 2014-08-17 [E] [expires: 2020-07-06]
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFPwtjQBCADWg7jYCGq+QFGfB8nLLQs/WEw4XJiAY9q65qWX1clNuVgTF9Nn
ABBOy4KiSDR9XWmARZlC2trKfdoFEnNJ6EnFkLhOjzZKiy4jkyxCctKfbV+sMzCm
@ -1776,52 +1776,90 @@ ODjjNQtn+nYmOu7a8Xg3g3vTnikkuHZqWvK0O0VYouW/p1NHelUejQbOPuUKukD1
omzskuYgteTZ9Jn8efJMIymg9dGubuvN4HvUdEO0/u6K2MCZjIqNEPeqWIuZXeMb
+4nGv2r0jSQAU94g3hueooqbUf+Mk2+H5O1d/h2Cii9qVvi6gELdVw9H+5Ir9AFc
ynsmvxrPIxraBMPgrXmvPFOTlqlizyFv2O7pABEBAAG0JUFuZHJlYXMgQmVla2Vy
IDxraXdpd2luZ3NAYXBhY2hlLm9yZz6JAUEEEwECACsCGwMGCwkIBwMCBhUIAgkK
CwQWAgMBAh4BAheAAhkBBQJXuYpTBQkHizsfAAoJEKk+HEsmBizjNa0H/AjJPguQ
WIn9AV/jstRN4OPM6eY7VUMG1DYoABRQSVsksPki5jZii0bI9VB3AUFgfXj0y6qk
CwQyKCJwZjcP3JuciJ5brQr/7D12hoTkYSCzCaECIpMoB7HWCpdoFusrgU2PUUwJ
i8xBTC+sLxIn3h5abTU68tnynCYhlA0mJ8zZ8CTvQJyEjidY1UgSohXClG2k/mo7
z/IyW16x4dlpdkNfiBhL2v/5Ol7Vuz9g1lXvWvMdNQZ2PVK6w5dmCziCkih/qRgK
SUzn65ASEKiCN7afzUkCTdzrI71r3rOkJtlT1NWn2RAv6xT6AuhCPZzH2I3ImuFI
mkUKYhKzRN6AdmCJAT4EEwECACgFAlPxECkCGwMFCQPCZwAGCwkIBwMCBhUIAgkK
CwQWAgMBAh4BAheAAAoJEKk+HEsmBizjvfYIALS1vlaqN/f7/YzpnOwlH2Wo4jpI
jBrG7SqcdVQk3NGsXTXzzq5p7uTTzpEJW8ReZLGeYaTzqh1vH97uAPR6wL3GjHMZ
F2jkC0wSHXxvh9Gyrdx3LA8NSO+BAG9ZfD6OGklsl7tFFEplLpfR1EsAKfbi0bAY
86SfVwTmCQfFStoSTzg8qLr3OcJQtqw85XVfjrFTaPjY36/RcLcXVmAVN6y8E+E7
019qP30afGkvw+ZbIq8qbxJItObMuhn5xdI0YaMm2yudCfm2aGYSCnkrgNfuWzH6
WZ8n1fv45TGBUd2R6zPr13eH73AG1WXpapoD45yf/TFavRfnknU6xb7U3ZK0MkFu
ZHJlYXMgQmVla2VyIChraXdpd2luZ3MpIDxhbmRyZWFzLmJlZWtlckBnbXguZGU+
iQE+BBMBAgAoAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCV7mKXAUJB4s7
HwAKCRCpPhxLJgYs4zheCACgc3m2FH5kmXtYO44BdYYwdV2dyLMCxvVl7GUWqJF8
wKmDWlUxBwrpzDBQXpmHyb+rqX/kvfEkH2wb9TZwginLecbZbMKubNUWUqGJBHQo
CaV8o6L/iEUJa5NXzY2OJCp32CHsmpefYkU+WgAnmTVe8Se7JEmJeu+2OfStV5m6
zVK5xzlciYSc29LpA3dsv5hxE6YZ8kJBJaFyv2AvVzaouSR7nPNrdw3/jXaOz+Hb
VpP/CEf5IdvF/o37sv8o7WWcH1AjvMdGQNp6Zr5Te2E35V8PmpqLH4Z8W0/PXij2
67i565JZc1Kmpqxm59jg1vs2X7rHNn0k+r9BFiCQC1LKiQIcBBABCgAGBQJV5hIJ
AAoJEOGWdUUnufY1qh8P/03uvjuU1V9UZY9t/4J/K0wbU8Re9c/HfgmJrCn+wvDI
OtxpOg3m07ZoIrosYEA2CIm+kLCYuNbzGSz6ZPZlpoq5FvxzO9OAYMO76r3ktxUw
Snbxd9TCkjCCQ8RMxT/JGDBU77nAJPyhCUZF2/SyrXnexloNP9TR/IDQZNOXzlxR
gu+zIrpl/ihfqxozqXYFIlhlP+k3GhiQt6e5yw+bLRiJZPR+NLzS4vfTeYEvWT2d
tQJ8FFyJF2HypiVcFFF0AwskiVRR9xxkdbONeJ0DnOHfRmnStfl14EDXUNDZ34Qn
IgMkw8vydc1GeQQE44BZYlN1d4J/h6eSji5Ftex1nbRuTeesXg5AzAHi/zWn8dRU
KCdKxjjn+t7k1SQEK1+h6Ja+CwBTZpHWpHPEbFzVSTXcoC0qU+QULD9eq1Av4OTi
Bnrf1/qYGZas6K0KYL84ZTH7JAZtgkXrn1sDiOMEMB8Hdqpw57wPaSt/6mbtmkCd
bCTWigBIWSY9FGfSTZdRk/KoIIK+VqxCPkS++RQ5ltwwq7Y6rcEsMFdUwMWc3hCD
Qu9C+djVRZrsSo6nLUGKGjoKYb1xmcqr03VquVVH36XNRmy3TC/8RqSstP/Q4dtx
a0bgqi+iu9vwLVUWtgLSQJr2OxTcU640DlVCJdvqTfS4SUP5Zht1HOkVzh3l3KiM
uQENBFPwtjQBCACln6mHC8Js3T3KJgNydimOCAFhLmS4e0ur03Y1nckB9zB/pMTL
ulDgtZwWSin3Kd40VZDyKi6mqOp5ldz6AsZ2CSx1GfI9iVhfuFqOaiBLqpNpdvf9
nGL9OVoy1SdwTXgnboiIFtbTG3sVwD4x4qTRbmT22Ln/mIAICR2wxFBkzpbIQ7Mf
R/zEgRh2VlRUUrWUsnYdOh0xfxuYgsnPCjpTY8hvEno3H6kzXKmj2GQJtawMVs5b
Ro/GCM9lBBR/PAhB65ACzLmUUSsxjlmjZw0tCcOufg1RyAF/l6YVw1UOJaqXBfSP
eZkLQBj9p8VNpasX/acIfpEaZLE8QhoO11ajABEBAAGJASUEGAECAA8CGwwFAle5
inIFCQeLOz4ACgkQqT4cSyYGLOMvsAf+J2EyV9+GNqT8UmEU6OFnw/sdR1oE+vZ9
fe4mifAfjQ+SKYf+MS0lU3lTuwcQKwFklePoYsvJEO7jNEgjTQ+zKiDSlV5yufSn
Idy8+sCYygPn5fSjGdRaMpCCfs5xrljLUPK5U8+vjeteRJW0o2/wmsYdHRz6A74B
kRq8kYu1M8VgZ6JD1YI/mp0mHTTB+H69/DNo6cA+7W/CibeTrffbJ35+OXGsJxqJ
b/QH/4lqsceNJtJThkHPQeM18R7/4t7Vhb5htOk2eB7coKzdYRKpHMzkm7elm8bI
uwsky9+6hIUMKD5hhc8G7g9lWOLSXCeNRUdqWTOfZaU5KOK70kKUeQ==
=PCbZ
IDxraXdpd2luZ3NAYXBhY2hlLm9yZz6JAVgEEwECAEICGwMGCwkIBwMCBhUIAgkK
CwQWAgMBAh4BAheAAhkBFiEEJBiFYFJEALFCvjOGqT4cSyYGLOMFAltBCHsFCQsS
uUcACgkQqT4cSyYGLONeTAgAx/618v7nrYdQlbKz/Ywf8v9rhE6EHUrwylwkQRHA
fVrBhEiMVRJnOnmkxUBijDTK1MMMslN0TNu5iI3GFMZ6luQTmP6gu4Dbq3ot/tjm
3Dnshf26Hg0DnrP7wj3fNPsjVpcfMk3tZ7GN+l/czPIwqrBiidYPsAOmhhJ0CDTk
ZzO1fsLL8rYxy+LvhyS/djuxUChCaT/veoNAhZH4r4AHVz+0Y2BdRDnOufUa+SA2
zv5RKy1D2dXMIwqYpw2NfiPptZf/lezOvjbRyE0V3tFl2fo5vqfrbSnDi8e8zCtA
dfsCWjlubhCnKjF06V6HQxxFXvLkzOjnvATpilf278ydjokBPgQTAQIAKAUCU/EQ
KQIbAwUJA8JnAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQqT4cSyYGLOO9
9ggAtLW+Vqo39/v9jOmc7CUfZajiOkiMGsbtKpx1VCTc0axdNfPOrmnu5NPOkQlb
xF5ksZ5hpPOqHW8f3u4A9HrAvcaMcxkXaOQLTBIdfG+H0bKt3HcsDw1I74EAb1l8
Po4aSWyXu0UUSmUul9HUSwAp9uLRsBjzpJ9XBOYJB8VK2hJPODyouvc5wlC2rDzl
dV+OsVNo+Njfr9FwtxdWYBU3rLwT4TvTX2o/fRp8aS/D5lsirypvEki05sy6GfnF
0jRhoybbK50J+bZoZhIKeSuA1+5bMfpZnyfV+/jlMYFR3ZHrM+vXd4fvcAbVZelq
mgPjnJ/9MVq9F+eSdTrFvtTdkokBQQQTAQIAKwIbAwUJA8JnAAYLCQgHAwIGFQgC
CQoLBBYCAwECHgECF4AFAlRLpLMCGQEACgkQqT4cSyYGLOON1ggAsfe2uG3olN8/
PZSyW0VNyPOotcb8jxWrmGSvSzh7HVXug0NesFEFvVYLWlwR7XGq9CahPI91Shfy
ULIs6u3chGmCOcf/gALJ6d87DrIeXpppdfce+x4vegdBMynOSfL7FWytTMnBUJFU
AI8zj0vqdGPhhFhpmoCfjbHal5gc1x8Wu8qwO1Oe3hJsVAGWa6IO2V48zpr3DOpc
wWRf72Fwen9KA7ANqWlqZ6hFD8i1/XDaE313Fi5pRaiOjpvRekKHOQIcqLG4Qq2M
ldOi9GVzoPPFPZnkkw+EBOI3dkKjzyV93+QrxoxmBXh+u5qr9BBGM0r8eCfp8/2M
8BGdxIUeQIkCHAQRAQIABgUCV+cXowAKCRDmZ3rGi6vdbEhdD/0Rp045xULKBxnt
jhYINF7rttKfcR0KIC+DB4ruaz51e9SCXlTtvdKjRltuIxTzQ3cfDk+mk013Yh3w
RIIRe8SdaDPr5Z+3mWi0bAyKHZX22IZFa3/9Kg4wSJt8OoT1ng2EsQL+Wj8xQc/U
MdIAkz2tems4ELvi+ZaHgDMQAHgDqajRjk4/sqd5hd57k5zDmrfycPeUJPa69wtE
XXV3sXhj1xief/ZgVMKnOg4PJkpLi7fM0wTY4UGx9A3ZYhrUrcEpQBmYjFDpegvf
LbXfGYfqsmjLfqA+vIw8VPLIQvftQaYZW1p60DZf0GzvEm3i9ZDiItM4+vNUByrJ
wp9AFujSq1M65oR+RIDPz0LnApHXzkxrS6a8KZaxO0mZ7SQmKn7V134X5X7lLug6
Nr9wSS5RJjGkYgo8D0nxWnWC+cEusodzdZgm+mpnSbEYoadeXt9pxlNOXlAX5xp+
N1dm0w+otwR4pnTTDORzpjmcs/BB7zY4BASF5jKcYYBeY6h6Q9wkx4FPo7s7LJj+
Qjn1xALZaYHGpGdKZJWsgmKRWEtAdtIylml05DvYzUTAS1ok6egxVX/59h11RlvJ
XILoP/5jNbY0OFYD8AR9rQqbxeumjtkxG4BrngTnYCy3sbS5f/9gc/1jFCALRHL0
SdOLLB/8Wbb5+ruv+JYUgeu9oLjDorQyQW5kcmVhcyBCZWVrZXIgKGtpd2l3aW5n
cykgPGFuZHJlYXMuYmVla2VyQGdteC5kZT6JAVUEEwECAD8CGwMGCwkIBwMCBhUI
AgkKCwQWAgMBAh4BAheAFiEEJBiFYFJEALFCvjOGqT4cSyYGLOMFAltBCHsFCQsS
uUcACgkQqT4cSyYGLONkjgf/bxTNXgEPKbt9/rGj7h2KagQ8E+4NiCQ/TOxa6O58
KFFOJ5yIhXHcAUFjgXrbXSZJK8RqMRU4stQB1y6eNjvBYG53WuUpxXkt3WR8C4zz
0J6UISZQbDJ9txvk4aheWn7ti0wirpdWikXwzz5fFAWFgGQ4VGELQaYKadCNa8vs
yXTQw0H07xkO+PkGEKR9gmpn9yP7+j9PdVuEUU3RvYw1oOP6pq8V1hOjzXte5R6E
MDww/UuXy3TMnYkAVKUYpKmtggYe0vSHk3b8WTzT3eXvDq4yka6lKZVD7GI0viSV
6+MqtnBGasbE7rNn2v5qB7WF/NmS4yS2DbCQkLqcTva7YIkCHAQQAQoABgUCVeYS
CQAKCRDhlnVFJ7n2NaofD/9N7r47lNVfVGWPbf+CfytMG1PEXvXPx34Jiawp/sLw
yDrcaToN5tO2aCK6LGBANgiJvpCwmLjW8xks+mT2ZaaKuRb8czvTgGDDu+q95LcV
MEp28XfUwpIwgkPETMU/yRgwVO+5wCT8oQlGRdv0sq153sZaDT/U0fyA0GTTl85c
UYLvsyK6Zf4oX6saM6l2BSJYZT/pNxoYkLenucsPmy0YiWT0fjS80uL303mBL1k9
nbUCfBRciRdh8qYlXBRRdAMLJIlUUfccZHWzjXidA5zh30Zp0rX5deBA11DQ2d+E
JyIDJMPL8nXNRnkEBOOAWWJTdXeCf4enko4uRbXsdZ20bk3nrF4OQMwB4v81p/HU
VCgnSsY45/re5NUkBCtfoeiWvgsAU2aR1qRzxGxc1Uk13KAtKlPkFCw/XqtQL+Dk
4gZ639f6mBmWrOitCmC/OGUx+yQGbYJF659bA4jjBDAfB3aqcOe8D2krf+pm7ZpA
nWwk1ooASFkmPRRn0k2XUZPyqCCCvlasQj5EvvkUOZbcMKu2Oq3BLDBXVMDFnN4Q
g0LvQvnY1UWa7EqOpy1Biho6CmG9cZnKq9N1arlVR9+lzUZst0wv/EakrLT/0OHb
cWtG4Kovorvb8C1VFrYC0kCa9jsU3FOuNA5VQiXb6k30uElD+WYbdRzpFc4d5dyo
jIkBPgQTAQIAKAUCU/C2NAIbAwUJA8JnAAYLCQgHAwIGFQgCCQoLBBYCAwECHgEC
F4AACgkQqT4cSyYGLOMLxQf/YRFfC8x1KQ9F/7zPaX1tWW05dhjYmX7jIevypagd
wuIC90iy0ZZOJhDzN6pWVgqmYllaec89Qv4//gSyVt3Po96wlBALKG7Eeh5MQa+z
dC1J7q2zF8ojr3YOJQEuNlYtSa8nRXYodRwiNzYhjBwFf/DRHbZi7e1HvDqcdNUe
q8FwaJl+QRyV5822UWwm3aK/1JzvH3+SuI8HesoWNAVfmyNrg/rxqvZzJXdCRo+1
u6gfh8zgMaSDbR5LEIbU1fzwVox0wjYTnRodc8qMryUrIZtTZL8AVWWDLP9LowKX
KsQF8rRl6Jy4jJmTBAjo8QIoKYfE+DwhCnSKnbFcZAtsm4kCHAQRAQIABgUCV+cX
sAAKCRDmZ3rGi6vdbI4eEACiAFDr6ZAWSJJ1ndS65MsAi4zyqi/HZPxuZ/ay9NKW
bOTYkTW14idZsykrtWRkdacWVIPjNtAxanqJNs79dC7hqmdDeokfiU6oi6/UkzYG
vwmFROH9Rcwx1eJgHZeeq0PD7Qc0B6y+2Bm74yEkL7NYREmZz0qfFElDUphr/yEj
6SMs056JEq5V0G9SAkOHUKZzBsyYYnnxqVOwg6MVX5bipJq0MoeSkV17Cw+1oXY/
wt0hMVyPJ/x5cdke4c4ZKZtMsfAGFhQawRtxVWcwwHEI22hN9Mz3E8cqxYYnS4jY
dzPpg1vTC3bdDQZKgJphtsQDOV43UzzGD83HW2Ovm/JIhmAUUsOjEvGbzBwmUZOx
dFFQLHpVzMZ3M0ffhJaZEF0Mdmj2ydr/cwdbQJpcSOx5+rveUuOJVKFeIqD2RcjL
x9orYxwwAbH3MQ3IGaghkmrLCHC7OoqTpcFMl0lIRutubc5Z72NGZqkz+6QAZWHr
M7vZUfX1w44Wa5MfYeiY5rmIZ9EOh0yVQN4yq8eZ9hHGxSXChEhl345XyuCOPqLU
vUD3PhHho428r4Ffelv7ReBkrZTL7Bu38ZgzTwXG0ts9tuuS7OY6fXiwuIPNHtNA
DVT8GwtjxIJZcWID2kk70eqlSwvTuAKZFgT9diY5ObVkcdNjURa3vGRbiBDcakxL
a7kBDQRT8LY0AQgApZ+phwvCbN09yiYDcnYpjggBYS5kuHtLq9N2NZ3JAfcwf6TE
y7pQ4LWcFkop9yneNFWQ8ioupqjqeZXc+gLGdgksdRnyPYlYX7hajmogS6qTaXb3
/Zxi/TlaMtUncE14J26IiBbW0xt7FcA+MeKk0W5k9ti5/5iACAkdsMRQZM6WyEOz
H0f8xIEYdlZUVFK1lLJ2HTodMX8bmILJzwo6U2PIbxJ6Nx+pM1ypo9hkCbWsDFbO
W0aPxgjPZQQUfzwIQeuQAsy5lFErMY5Zo2cNLQnDrn4NUcgBf5emFcNVDiWqlwX0
j3mZC0AY/afFTaWrF/2nCH6RGmSxPEIaDtdWowARAQABiQE8BBgBAgAmAhsMFiEE
JBiFYFJEALFCvjOGqT4cSyYGLOMFAltBCJsFCQsSuWcACgkQqT4cSyYGLOOhIwf7
BBY881X8VsZxSn6zc4y+mXzNOjaxYwjEaifHaxfOMoZn8tFDd2bWyjGRinMKLliT
j2RJkN5zGZ1f89LFyclV181NRGlQ4eMyv+SWVDLIxodmdToJ9AopHooehvbnQDhz
8htUur7fWx1qRM5U9ZpFHMJp3OF27BCbzPGwFW0Q7fqhliGsV5ae26+AXwn0DsLT
/+w5eJ4Xk+m2FcJoSOTkurZBPOx3wAaPpNZA+qKvOmYsAgzAbYriFIakFJV4l35+
/MDXnpv/VIUPzxUoHjV7BtnBlM2KdA4cGZBq4jXSM2ZdvTquu7tJPJ6FLgWWCWF+
qy0PB4IyWnDgpw6jbn794A==
=doz3
-----END PGP PUBLIC KEY BLOCK-----
pub 4096R/B4812553 2014-02-26 [expires: 2019-02-25]
@ -2493,3 +2531,48 @@ bpjAhwE2YmGQ7oB+3V798HtAmceRNf8AY0GWrZswJlg7xUn+WJNwQ9uIHI1fxYHx
2Nr+AmDDs6ZOEI5zhwxioePw/Cg=
=9lKb
-----END PGP PUBLIC KEY BLOCK-----
pub rsa2048 2018-05-02 [SC] [expires: 2020-05-01]
6BA4DA8B1C88A49428A29C3D0C69C1EF41181E13
uid [ultimate] PJ Fanning (http://www.apache.org/) <fanningpj@apache.org>
uid [ultimate] PJ Fanning <fanningpj@yahoo.com>
sub rsa2048 2018-05-02 [E] [expires: 2020-05-01]
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFrpc9YBCADQjZMJ8ThwsFwZJ9B5rjAFZY48ri1LiZrTgydYY9X3bzjDkng+
ARFmtFPnwYwLTdz3ECqWWsC3RkI62079DweNasXV8nBz9sUt6mQqSMx3W/s6389/
k9iywPLvhHH7rpp05js8zwJoA8Fr1YwPtBjyhrxl58LQ5ihd/1f2ud2tnwQw1dI2
8fuTS3QaKP4Zdx2diD5rYhkAecWaFRwxn1L7Tye5dfD1uPElPCHGKqfaeQXtl01u
TOwYB1p9tKPHvfni1qgD3QLWUJ2oyBGSA9IgEF5rm8LtR6vADKQwORjg99a7HE2h
lDBZi/tmu23fgWSioiy084fB5GqmApK/681DABEBAAG0IFBKIEZhbm5pbmcgPGZh
bm5pbmdwakB5YWhvby5jb20+iQFUBBMBCAA+FiEEa6TaixyIpJQoopw9DGnB70EY
HhMFAlrpc9YCGwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQDGnB
70EYHhOWoAf/V4SZNhYfHWeI58n1mnq+4ufG1+s4HdtvXRCYjDdypmdFLl4e27jO
YNvZ8Fvk1wqiA8ui1XcCI5hSsbFUj/vNIUUItOr6TXILttOOR3qLEkmBLmHCY35w
a+QpNxjvufHjewb8Nk7sNcX+4WIUiQ3vmWWtgtmy9Efk+X653g7LlyH3ZfJADYKt
QC2Q5ui6Ewm7ZxE4Ob8J2BZBCP3CXZgJ65xnCtE7jUQVW5B5YR9/1GyvfdTyh/pY
4PdEeif2S8hhS0xx3l62+o4QOkmiI1dJJYifXtO5qnxfKMvSka29wy9tbs9XAsAU
27Zc++iSYBMTGLGROhDMgCRPZbYaI4YYTrQ6UEogRmFubmluZyAoaHR0cDovL3d3
dy5hcGFjaGUub3JnLykgPGZhbm5pbmdwakBhcGFjaGUub3JnPokBVAQTAQgAPhYh
BGuk2osciKSUKKKcPQxpwe9BGB4TBQJbQKUuAhsDBQkDwmcABQsJCAcCBhUKCQgL
AgQWAgMBAh4BAheAAAoJEAxpwe9BGB4TW10IAI7ONAHmqsjR1JkxjSQzq4imQl+J
ZAmHxglMPQs39AKuVEp4BdFH5SeBWNPjue1V6iw22ahTEvgJZwv9O3JBrjsYUUD/
PQcwp63q0JKYk5qF/XmwmHox8kqXcoPxhsCJQhdg7ZH3YAYPp4yOJ+ATZx/0E9Ew
JbUu/yefxtvPeRzBLZVrxc8Qp+hMszRO3mQzO4xTuDMh3lX3rILXEfEoZoqFHvr9
oCNgXxUYXY/KTfH9dLPGnmaqJyEEydRqQmClxn0MiJo5hLsmxeG7pZNPfE3Zhzod
i5oRy2JDUY3x+PHvKc+cM93BbxpSsK+Jtu88aOHwXp+Fj8WciO8Ku+2uN8q5AQ0E
Wulz1gEIAORuS4e+Ek+d+0gBMlnigNJ2HoQalKFaERf5K/iQZY4E6Z2ahJ4UFIj7
ri3isWgOleP+REJJPfeSrWQ5XgdklDlHHyv4O5iMkEFWQHttiaTuvdomDncQrNRP
TaIOe9iQgfQzDw6mqsb7ZWd5ICA8Krd97BwNHjq/CZ9+WrU6GDc6ImissLVVGGdk
EGO7qZTqNUCeH4Znm/00mNMI4OH8xkwA2vzV5o3J5116zIuv29XQDtcSM+9NQ/Hd
sjKIA0OpDyWE7Ek/SO+/CvkylwaOcmkuf33ADNjpF4BsBxn7L9XI1WJDtRaMkpbq
MsymIxi35VUOGD+ms+72CcUStfYj4NEAEQEAAYkBPAQYAQgAJhYhBGuk2osciKSU
KKKcPQxpwe9BGB4TBQJa6XPWAhsMBQkDwmcAAAoJEAxpwe9BGB4TWlEH/1ygNg5R
W5XD5JAats8CJzmaJSpQY4Yr41K5sRqPYA6s+kSJx0t7dP8OG/RoDjs2Dmzsy6J4
RQCIxo74g8d7yCE+aijb0zDX/3e5qecY7kDYqBDE0KkHpXfQprOntxgne7BsBZqM
pNpL7MDQGAmGLh41XWy7CmT+haoS2zhxAXWwXgUZOE0umsMfil+XVE9oZWjeg1Dm
3BH/QtUS9kuRmYa38JAg6Cr3D6/j/LBqWjaEVXr6RNdd6zlQHBwmLTEhQVYyepK9
egfcIxtZ0AuggFN6ijBJqATbj0DlomeKrnHLVloD6lEDgB/j0SoYsGbv9kpYPqvU
lSeSg2C31/20JYI=
=/nGR
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -58,12 +58,12 @@ Source code:
* Official `Apache git mirror`_ at apache.org
* Unofficial `GitHub git mirror`_ at github.com
Requires Java 1.6 or later.
Requires Java 1.8 or later.
Contributing
------------------
* Download and install svn or git, Java JDK 1.6+, and Apache Ant 1.8+ or Gradle
* Download and install svn or git, Java JDK 1.8+, and Apache Ant 1.8+ or Gradle
* Check out the code from svn or git

View File

@ -15,25 +15,43 @@
limitations under the License.
==================================================================== */
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.2'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1"
}
dependencies {
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.2' // 2.x requires Gradle >=4
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
}
}
// Only add the plugin for Sonar if enabled as it requires Java 8
repositories {
mavenCentral()
}
// Only add the plugin for Sonar if enabled
if (project.hasProperty('enableSonar')) {
println 'Enabling Sonar support'
apply plugin: "org.sonarqube"
println 'Enabling Sonar support'
apply plugin: "org.sonarqube"
}
// For help converting an Ant build to a Gradle build, see
// https://docs.gradle.org/current/userguide/ant.html
configurations {
antLibs
}
dependencies {
antLibs("junit:junit:4.12")
antLibs("org.apache.ant:ant-junit:1.10.4")
antLibs("org.apache.ant:ant-junit4:1.10.4")
}
ant.taskdef(name: "junit",
classname: "org.apache.tools.ant.taskdefs.optional.junit.JUnitTask",
classpath: configurations.antLibs.asPath)
ant.importBuild 'build.xml'
/**
@ -42,22 +60,22 @@ Define properties for all projects, including this one
*/
allprojects {
apply plugin: 'eclipse'
apply plugin: 'eclipse'
task wrapper(type: Wrapper) {
gradleVersion = '3.4.1'
}
task adjustWrapperPropertiesFile {
doLast {
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
}
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
}
}
wrapper.finalizedBy adjustWrapperPropertiesFile
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}
task adjustWrapperPropertiesFile {
doLast {
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
}
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
}
}
wrapper.finalizedBy adjustWrapperPropertiesFile
}
/**
@ -71,41 +89,46 @@ subprojects {
apply plugin: 'jacoco'
// See https://github.com/melix/japicmp-gradle-plugin
apply plugin: 'me.champeau.gradle.japicmp'
apply plugin: 'me.champeau.gradle.japicmp'
version = '3.16-beta3'
ext {
japicmpversion = '3.15'
}
version = '4.0.1-SNAPSHOT'
ext {
japicmpversion = '4.0.0'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
sourceCompatibility = 1.6
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
jar {
manifest {
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version
}
}
jar {
manifest {
attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': version
}
}
test {
// Exclude some tests that are not actually tests or do not run cleanly on purpose
exclude '**/BaseTestBorderStyle.class'
exclude '**/BaseTestCellUtil.class'
exclude '**/TestUnfixedBugs.class'
exclude '**/TestOneFile.class'
// Exclude some tests that are not actually tests or do not run cleanly on purpose
exclude '**/BaseTestBorderStyle.class'
exclude '**/BaseTestCellUtil.class'
exclude '**/TestUnfixedBugs.class'
exclude '**/TestOneFile.class'
// Exclude Test Suites
exclude '**/All*Tests.class'
exclude '**/HSSFTests.class'
systemProperties = System.properties
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "768m"
// Specifying the local via system properties did not work, so we set them this way
jvmArgs '-Duser.language=en -Duser.country=US'
// show standard out and standard error of the test JVM(s) on the console
//testLogging.showStandardStreams = true
@ -114,201 +137,217 @@ subprojects {
systemProperties['user.dir'] = workingDir
systemProperties['POI.testdata.path'] = '../../test-data'
//systemProperties['user.language'] = 'en'
//systemProperties['user.country'] = 'US'
// this is necessary for JDK 9+ to keep formatting dates the same way as in previous JDK-versions
systemProperties['java.locale.providers'] = 'JRE,CLDR'
}
test.beforeSuite { TestDescriptor suite ->
System.setProperty('user.language', 'en')
System.setProperty('user.country', 'US')
}
jacoco {
toolVersion = '0.7.8'
toolVersion = '0.8.2'
}
// ensure the build-dir exists
projectDir.mkdirs()
if (project.hasProperty('enableSonar')) {
sonarqube {
properties {
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
// the root-folder as "basedir" for the projects
property "sonar.projectBaseDir", "$projectDir/../.."
}
}
}
if (project.hasProperty('enableSonar')) {
sonarqube {
properties {
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
// the root-folder as "basedir" for the projects
property "sonar.projectBaseDir", "$projectDir/../.."
}
}
}
task(japicmp, type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
to = jar.archivePath
onlyModified = true
onlyBinaryIncompatibleModified = true
failOnModification = false
txtOutputFile = file("$buildDir/reports/japi.txt")
htmlOutputFile = file("$buildDir/reports/japi.html")
}
}
project('main') {
sourceSets.main.java.srcDirs = ['../../src/java']
sourceSets.main.resources.srcDirs = ['../../src/resources/main']
sourceSets.test.java.srcDirs = ['../../src/testcases']
dependencies {
compile 'commons-codec:commons-codec:1.10'
compile 'commons-logging:commons-logging:1.2'
compile 'org.apache.commons:commons-collections4:4.1'
testCompile 'junit:junit:4.12'
}
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
sourceSets.main.java.srcDirs = ['../../src/java']
sourceSets.main.resources.srcDirs = ['../../src/resources/main']
sourceSets.test.java.srcDirs = ['../../src/testcases']
configurations {
tests
}
dependencies {
compile 'commons-codec:commons-codec:1.11'
compile 'commons-logging:commons-logging:1.2'
compile 'org.apache.commons:commons-collections4:4.2'
compile 'org.apache.commons:commons-math3:3.6.1'
compile 'javax.xml.bind:jaxb-api:2.3.0'
compile 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
compile 'com.sun.xml.bind:jaxb-core:2.3.0.1'
compile 'javax.activation:activation:1.1.1'
artifacts {
tests testJar
}
testCompile 'junit:junit:4.12'
testCompile 'org.reflections:reflections:0.9.11'
}
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
baseline = 'org.apache.poi:poi:' + japicmpversion + '@jar'
to = jar.archivePath
onlyModified = true
onlyBinaryIncompatibleModified = true
failOnModification = false
txtOutputFile = file("$buildDir/reports/japi.txt")
htmlOutputFile = file("$buildDir/reports/japi.html")
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.apache.poi.main'
}
}
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testJar
}
japicmp.baseline = 'org.apache.poi:poi:' + japicmpversion + '@jar'
}
project('ooxml') {
sourceSets.main.java.srcDirs = ['../../src/ooxml/java']
sourceSets.main.resources.srcDirs = ['../../src/ooxml/resources', '../../src/resources/ooxml']
sourceSets.test.java.srcDirs = ['../../src/ooxml/testcases']
sourceSets.main.java.srcDirs = ['../../src/ooxml/java']
sourceSets.main.resources.srcDirs = ['../../src/ooxml/resources', '../../src/resources/ooxml']
sourceSets.test.java.srcDirs = ['../../src/ooxml/testcases']
// for now import the ant-task for building the jars from build.xml
// we need to rename the tasks as e.g. task "jar" conflicts with :ooxml:jar
ant.importBuild('../../build.xml') { antTargetName ->
'ant-' + antTargetName
}
compileJava.dependsOn 'ant-compile-ooxml-xsds'
dependencies {
compile 'org.apache.xmlbeans:xmlbeans:2.6.0'
compile 'org.apache.commons:commons-collections4:4.1'
compile 'org.apache.santuario:xmlsec:2.0.6'
compile 'org.bouncycastle:bcpkix-jdk15on:1.54'
compile 'com.github.virtuald:curvesapi:1.04'
// for ooxml-lite, should we move this somewhere else?
compile 'junit:junit:4.12'
ant.importBuild('../../build.xml') { antTargetName ->
'ant-' + antTargetName
}
compileJava.dependsOn 'ant-compile-ooxml-xsds'
compile project(':main')
compile project(':scratchpad') // TODO: get rid of this dependency!
compile files('../../ooxml-lib/ooxml-schemas-1.3.jar')
compile files('../../ooxml-lib/ooxml-security-1.1.jar')
testCompile 'junit:junit:4.12'
testCompile project(path: ':main', configuration: 'tests')
}
dependencies {
compile 'org.apache.xmlbeans:xmlbeans:3.0.2'
compile 'org.apache.commons:commons-collections4:4.2'
compile 'org.apache.commons:commons-math3:3.6.1'
compile 'org.apache.commons:commons-compress:1.18'
compile 'org.apache.santuario:xmlsec:2.1.0'
compile 'org.bouncycastle:bcpkix-jdk15on:1.60'
compile 'com.github.virtuald:curvesapi:1.05'
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
baseline = 'org.apache.poi:poi-ooxml:' + japicmpversion + '@jar'
to = jar.archivePath
onlyModified = true
onlyBinaryIncompatibleModified = true
failOnModification = false
txtOutputFile = file("$buildDir/reports/japi.txt")
htmlOutputFile = file("$buildDir/reports/japi.html")
}
// for ooxml-lite, should we move this somewhere else?
compile 'junit:junit:4.12'
compile project(':main')
compile project(':scratchpad') // TODO: get rid of this dependency!
compile files('../../ooxml-lib/ooxml-schemas-1.4.jar')
compile files('../../ooxml-lib/ooxml-security-1.1.jar')
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.21.0'
testCompile 'org.xmlunit:xmlunit-core:2.5.1'
testCompile 'org.reflections:reflections:0.9.11'
testCompile project(path: ':main', configuration: 'tests')
testCompile 'org.openjdk.jmh:jmh-core:1.19'
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.apache.poi.ooxml'
}
}
japicmp.baseline = 'org.apache.poi:poi-ooxml:' + japicmpversion + '@jar'
}
project('examples') {
sourceSets.main.java.srcDirs = ['../../src/examples/src']
dependencies {
compile project(':main')
compile project(':ooxml')
}
sourceSets.main.java.srcDirs = ['../../src/examples/src']
dependencies {
compile project(':main')
compile project(':ooxml')
}
japicmp.enabled = false
}
project('excelant') {
sourceSets.main.java.srcDirs = ['../../src/excelant/java']
sourceSets.main.resources.srcDirs = ['../../src/excelant/resources']
sourceSets.test.java.srcDirs = ['../../src/excelant/testcases']
dependencies {
compile 'org.apache.ant:ant:1.9.4'
sourceSets.main.java.srcDirs = ['../../src/excelant/java']
sourceSets.main.resources.srcDirs = ['../../src/excelant/resources']
sourceSets.test.java.srcDirs = ['../../src/excelant/testcases']
compile project(':main')
compile project(':ooxml')
dependencies {
compile 'org.apache.ant:ant:1.10.4'
testCompile project(path: ':main', configuration: 'tests')
compile project(':main')
compile project(':ooxml')
testCompile project(path: ':main', configuration: 'tests')
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.apache.poi.excelant'
}
}
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
baseline = 'org.apache.poi:poi-excelant:' + japicmpversion + '@jar'
to = jar.archivePath
onlyModified = true
onlyBinaryIncompatibleModified = true
failOnModification = false
txtOutputFile = file("$buildDir/reports/japi.txt")
htmlOutputFile = file("$buildDir/reports/japi.html")
}
japicmp.baseline = 'org.apache.poi:poi-excelant:' + japicmpversion + '@jar'
}
project('integrationtest') {
sourceSets.test.java.srcDirs = ['../../src/integrationtest']
dependencies {
compile 'org.apache.ant:ant:1.9.4'
sourceSets.test.java.srcDirs = ['../../src/integrationtest']
compile project(':main')
compile project(':ooxml')
compile project(':scratchpad')
compile project(':examples')
testCompile 'junit:junit:4.12'
dependencies {
compile 'org.apache.ant:ant:1.10.4'
compile project(':main')
compile project(':ooxml')
compile project(':scratchpad')
compile project(':examples')
testCompile 'junit:junit:4.12'
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.apache.poi.integrationtest'
}
}
test {
// exclude these from the normal test-run
exclude '**/TestAllFiles.class'
exclude '**/*FileHandler.class'
exclude '**/RecordsStresser.class'
}
task integrationTest(type: Test) {
// these are just tests used during development of more test-code
exclude '**/*FileHandler.class'
exclude '**/RecordStresser.class'
}
test {
// exclude these from the normal test-run
exclude '**/TestAllFiles.class'
exclude '**/*FileHandler.class'
exclude '**/RecordsStresser.class'
}
task integrationTest(type: Test) {
// these are just tests used during development of more test-code
exclude '**/*FileHandler.class'
exclude '**/RecordStresser.class'
}
japicmp.enabled = false
}
project('scratchpad') {
sourceSets.main.java.srcDirs = ['../../src/scratchpad/src']
sourceSets.main.resources.srcDirs = ['../../src/resources/scratchpad']
sourceSets.test.java.srcDirs = ['../../src/scratchpad/testcases']
dependencies {
compile project(':main')
// cyclic-dependency here: compile project(':ooxml')
testCompile 'junit:junit:4.12'
testCompile project(path: ':main', configuration: 'tests')
sourceSets.main.java.srcDirs = ['../../src/scratchpad/src']
sourceSets.main.resources.srcDirs = ['../../src/resources/scratchpad']
sourceSets.test.java.srcDirs = ['../../src/scratchpad/testcases']
dependencies {
compile project(':main')
// cyclic-dependency here: compile project(':ooxml')
testCompile 'junit:junit:4.12'
testCompile project(path: ':main', configuration: 'tests')
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.apache.poi.scratchpad'
}
}
// TOOD: we should not duplicate this task in each project, but I did not figure out how to inject the artifactId for each project
task japicmp(type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
baseline = 'org.apache.poi:poi-scratchpad:' + japicmpversion + '@jar'
to = jar.archivePath
onlyModified = true
onlyBinaryIncompatibleModified = true
failOnModification = false
txtOutputFile = file("$buildDir/reports/japi.txt")
htmlOutputFile = file("$buildDir/reports/japi.html")
}
japicmp.baseline = 'org.apache.poi:poi-scratchpad:' + japicmpversion + '@jar'
}

1105
build.xml

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,27 @@
<programming-language>Java</programming-language>
<category rdf:resource="https://projects.apache.org/category/content" />
<category rdf:resource="https://projects.apache.org/category/library" />
<release>
<Version>
<name>Apache POI 4.0.0</name>
<created>2018-09-07</created>
<revision>4.0.0</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 3.17</name>
<created>2017-09-15</created>
<revision>3.17</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 3.16</name>
<created>2017-04-19</created>
<revision>3.16</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 3.15</name>

View File

@ -0,0 +1,55 @@
# JaCoCo Agent
sun.instrument.InstrumentationImpl.loadClassAndStartAgent
org.jacoco.agent.rt.internal_14f7ee5.output.FileOutput.openFile
# Ant Junit
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.getDocumentBuilder
# JVM
sun.security.jca.ProviderConfig.doLoadProvider
javax.xml.parsers.FactoryFinder.findJarServiceProvider
com.sun.org.apache.xerces.internal.utils.SecuritySupport.getResourceBundle
# Codepage support loads classes
java.nio.charset.Charset.lookupViaProviders
# Ant
org.apache.tools.ant.Main.getAntVersion
javax.xml.parsers.FactoryFinder.findJarServiceProvider
org.apache.tools.ant.taskdefs.Antlib.createAntlib
# XML Parser
com.sun.org.apache.xerces.internal.utils.SecuritySupport.getResourceBundle
com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory.loadPropertiesFile
com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.<init>
com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty.<init>
com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.<init>
javax.xml.stream.FactoryFinder.findJarServiceProvider
# XMLBeans
org.apache.xmlbeans.impl.regex.RegexParser.setLocale
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.getLoaderStream
# JCA
sun.security.jca.ProviderConfig.getProvider
javax.crypto.JceSecurity.setupJurisdictionPolicies
javax.crypto.Cipher.getMaxAllowedKeyLength
# IntelliJ
com.intellij.junit4.JUnit4TestRunnerUtil.<clinit>
# Java
sun.util.resources.LocaleData.getBundle
sun.util.LocaleServiceProviderPool.<init>
sun.util.calendar.LocalGregorianCalendar.getLocalGregorianCalendar
sun.net.www.protocol.jar.JarURLConnection.getInputStream
sun.text.normalizer.ICUData.getStream
sun.font.T2KFontScaler.initNativeScaler
sun.font.SunFontManager.loadFonts
sun.font.FontManagerFactory.getInstance
sun.font.TrueTypeFont.open
sun.reflect.misc.MethodUtil.<clinit>
java.util.logging.Logger.findSystemResourceBundle
java.text.BreakIterator.getBundle
sun.java2d.SunGraphicsEnvironment.<init>
org.kohsuke.file_leak_detector.AgentMain.runHttpServer

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

172
gradlew vendored Executable file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Normal file
View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,5 +1,5 @@
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
// Apache POI uses on the public Jenkins instance at https://builds.apache.org/view/POI/
// Apache POI uses on the public Jenkins instance at https://builds.apache.org/view/P/view/POI/
//
// See https://github.com/jenkinsci/job-dsl-plugin/wiki for information about the DSL, you can
// use http://job-dsl.herokuapp.com/ to validate the code before checkin
@ -10,93 +10,133 @@ def triggerSundays = '''
H H * * 0
'''
def xercesUrl = 'http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar'
def xercesLib = './xercesImpl-2.6.1.jar'
def poijobs = [
[ name: 'POI-DSL-1.6',
// workaround as Sourceforge does not accept any of the SSL ciphers in JDK 6 any more and thus we cannot download this jar
// as part of the Ant build
addShell: 'wget -O lib/findbugs-noUpdateChecks-2.0.3.zip http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download='
],
[ name: 'POI-DSL-1.8', jdk: '1.8', trigger: 'H */12 * * *'
],
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK', trigger: 'H */12 * * *',
// H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam5&&!beam6&&!beam7&&!beam8&&!H12&&!H13&&!H14&&!H15&&!H16&&!H17&&!H18&&!H19&&!H20&&!H21&&!H22&&!H23&&!H24&&!qnode1&&!qnode2&&!qnode3&&!ubuntu-eu2&&!ubuntu-eu3&&!ubuntu-us1',
// the JDK is missing on some slaves so builds are unstable
skipcigame: true
],
[ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
properties: ['-Dmaxpermsize=-Dthis.is.a.dummy=true',
'-Djava9addmods=--add-modules=java.xml.bind',
'-Djavadoc9addmods=--add-modules=java.xml.bind',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays,
// some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
disabled: true, skipcigame: true
],
[ name: 'POI-DSL-old-Xerces', trigger: triggerSundays,
shell: 'mkdir -p compile-lib && test -f compile-lib/xercesImpl-2.6.1.jar || wget -O compile-lib/xercesImpl-2.6.1.jar http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar\n',
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
properties: ['-Dadditionaljar=compile-lib/xercesImpl-2.6.1.jar'],
// workaround as Sourceforge does not accept any of the SSL ciphers in JDK 6 any more and thus we cannot download this jar
// as part of the Ant build
addShell: 'wget -O lib/findbugs-noUpdateChecks-2.0.3.zip http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download='
],
[ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true
],
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
],
[ name: 'POI-DSL-API-Check', jdk: '1.7', trigger: '@daily', apicheck: true
],
[ name: 'POI-DSL-Gradle', jdk: '1.7', trigger: triggerSundays, email: 'centic@apache.org', gradle: true,
// Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated
addShell: 'touch --no-create build/*/build/test-results/TEST-*.xml build/*/build/test-results/test/TEST-*.xml'
],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
],
[ name: 'POI-DSL-SonarQube', jdk: '1.8', trigger: 'H 9 * * *', maven: true, sonar: true
],
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.8', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true
],
[ name: 'POI-DSL-1.8', trigger: 'H */12 * * *'
],
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK', trigger: 'H */12 * * *',
// H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam5&&!beam6&&!beam7&&!beam8' +
'&&!H0&&!H1&&!H2&&!H3&&!H4&&!H5&&!H6&&!H7&&!H8&&!H9&&!H10&&!H11' +
'&&!qnode3' +
'&&!ubuntu-1&&!ubuntu-2&&!ubuntu-4&&!ubuntu-5&&!ubuntu-6&&!ubuntu-eu2&&!ubuntu-us1',
// the JDK is missing on some slaves so builds are unstable
skipcigame: true
],
[ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays,
properties: ['-Djava9addmods=--add-modules=java.xml.bind',
'-Djavadoc9addmods=--add-modules=java.xml.bind',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays,
// Nodes beam* do not yet have JDK 11 installed
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
'-Djavadoc9addmods=-Dthis.is.a.dummy=true',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=-Dthis.is.a.dummy=true',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-1.12', jdk: '1.12', trigger: '''
# do not run this via a schedule for now
''',
// Nodes beam* do not yet have JDK 12 installed
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
'-Djavadoc9addmods=-Dthis.is.a.dummy=true',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=-Dthis.is.a.dummy=true',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays,
// some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
disabled: true, skipcigame: true
],
[ name: 'POI-DSL-old-Xerces', trigger: triggerSundays,
shell: "test -f ${xercesLib} || wget -O ${xercesLib} ${xercesUrl}\n",
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
properties: ["-Dadditionaljar=${xercesLib}"]
],
[ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true
],
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
],
// disabled for 4.0.0 because we break compatibility on-purpose in a few places, e.g. for Java 9 compatibility
[ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true
],
[ name: 'POI-DSL-Gradle', trigger: triggerSundays, email: 'centic@apache.org', gradle: true,
// Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated
addShell: 'touch --no-create build/*/build/test-results/TEST-*.xml build/*/build/test-results/test/TEST-*.xml'
],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
],
[ name: 'POI-DSL-SonarQube', trigger: 'H 9 * * *', maven: true, sonar: true, skipcigame: true
],
[ name: 'POI-DSL-SonarQube-Gradle', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true,
disabled: true // this one does run, but does not actually send data to Sonarqube for some reason, we need to investigate some more
],
[ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows'
],
]
def xmlbeansjobs = [
[ name: 'POI-XMLBeans-DSL-1.6', jdk: '1.6', trigger: 'H */12 * * *', skipcigame: true
]
]
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
def defaultJdk = '1.6'
def xmlbeansSvnBase = 'https://svn.apache.org/repos/asf/xmlbeans/trunk'
def defaultJdk = '1.8'
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
def defaultEmail = 'dev@poi.apache.org'
def defaultAnt = 'Ant 1.9.9'
// currently a lot of H?? slaves don't have Ant installed ...
def defaultSlaves = 'ubuntu&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4'
// currently a lot of H?? slaves don't have Ant installed ... H21 seems to have a SVN problem
// H35 fails with ImageIO create cache file errors, although the java.io.tmpdir is writable
def defaultSlaves = '(ubuntu||beam)&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21&&!H35'
def jdkMapping = [
'1.6': 'JDK 1.6 (latest)',
'1.7': 'JDK 1.7 (latest)',
'1.8': 'JDK 1.8 (latest)',
'1.9': 'JDK 9 b156 (early access build) with project Jigsaw',
'OpenJDK': 'OpenJDK 6 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
'1.6': 'JDK 1.6 (latest)',
'1.8': 'JDK 1.8 (latest)',
'1.10': 'JDK 10 (latest)',
'1.11': 'JDK 11 (latest)',
'1.12': 'JDK 12 (latest)',
'OpenJDK': 'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
]
poijobs.each { poijob ->
def jdkKey = poijob.jdk ?: defaultJdk
def trigger = poijob.trigger ?: defaultTrigger
def email = poijob.email ?: defaultEmail
def slaves = defaultSlaves + (poijob.slaveAdd ?: '')
static def shellEx(def context, String cmd, def poijob) {
if (poijob.windows) {
context.batchFile(cmd)
} else {
context.shell(cmd)
}
}
job(poijob.name) {
if (poijob.disabled) {
disabled()
}
def defaultDesc = '''
<img src="https://poi.apache.org/resources/images/project-logo.jpg" />
def defaultDesc = '''
<img src="https://poi.apache.org/images/project-header.png" />
<p>
Apache POI - the Java API for Microsoft Documents
</p>
@ -107,9 +147,7 @@ see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.co
for more details about the DSL.</b>
</p>'''
description( defaultDesc +
(poijob.apicheck ?
'''
def apicheckDesc = '''
<p>
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
<p>
@ -119,14 +157,70 @@ for more details about the DSL.</b>
<b><a href="lastSuccessfulBuild/artifact/build/scratchpad/build/reports/japi.html">API Check POI-Scratchpad</a></b>
</p>
''' :
'''
def sonarDesc = '''
<p>
<b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
<b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>
</p>
'''))
'''
def shellCmdsUnix =
'''# show which files are currently modified in the working copy
svn status
# print out information about which exact version of java we are using
echo Java-Home: $JAVA_HOME
ls -al $JAVA_HOME/
ls -al $JAVA_HOME/bin
$JAVA_HOME/bin/java -version
echo which java
which java
java -version
echo which javac
which javac
javac -version
echo '<project default="test"><target name="test"><echo>Java ${ant.java.version}/${java.version}</echo><exec executable="javac"><arg value="-version"/></exec></target></project>' > build.javacheck.xml
ant -f build.javacheck.xml -v
POIJOBSHELL
# ignore any error message
exit 0'''
def shellCmdsWin =
'''@echo off
:: show which files are currently modified in the working copy
svn status
:: print out information about which exact version of java we are using
echo Java-Home: %JAVA_HOME%
dir "%JAVA_HOME:\\\\=\\%"
"%JAVA_HOME%/bin/java" -version
POIJOBSHELL
:: ignore any error message
exit /b 0'''
poijobs.each { poijob ->
def jdkKey = poijob.jdk ?: defaultJdk
def trigger = poijob.trigger ?: defaultTrigger
def email = poijob.email ?: defaultEmail
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
def antRT = defaultAnt + (poijob.windows ? ' (Windows)' : '')
job(poijob.name) {
if (poijob.disabled) {
disabled()
}
description( defaultDesc + (poijob.apicheck ? apicheckDesc : sonarDesc) )
logRotator {
numToKeep(5)
artifactNumToKeep(1)
@ -134,10 +228,12 @@ for more details about the DSL.</b>
label(slaves)
environmentVariables {
env('LANG', 'en_US.UTF-8')
if(jdkKey == '1.9') {
// when using JDK 9 for running Ant, we need to provide more packages for the forbidden-api-checks task
env('ANT_OPTS', '--add-modules=java.xml.bind')
if(jdkKey == '1.10') {
// when using JDK 9/10 for running Ant, we need to provide more modules for the forbidden-api-checks task
// on JDK 11 and newer there is no such module any more, so do not add it here
env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
}
env('FORREST_HOME', poijob.windows ? 'f:\\jenkins\\tools\\forrest\\latest' : '/home/jenkins/tools/forrest/latest')
}
wrappers {
timeout {
@ -145,6 +241,9 @@ for more details about the DSL.</b>
abortBuild()
writeDescription('Build was aborted due to timeout')
}
preBuildCleanup {
includePattern('**/ooxml-lib/ooxml*.jar')
}
if(poijob.sonar) {
configure { project ->
project / buildWrappers << 'hudson.plugins.sonar.SonarBuildWrapper' {}
@ -154,28 +253,22 @@ for more details about the DSL.</b>
jdk(jdkMapping.get(jdkKey))
scm {
svn(svnBase) { svnNode ->
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
}
checkoutRetryCount(3)
triggers {
scm(trigger)
}
def shellcmds = '# show which files are currently modified in the working copy\n' +
'svn status\n' +
'\n' +
'echo Java-Home: $JAVA_HOME\n' +
'ls -al $JAVA_HOME/\n' +
'\n' +
(poijob.shell ?: '') + '\n' +
'# ignore any error message\n' +
'exit 0\n'
def shellcmds = (poijob.windows ? shellCmdsWin : shellCmdsUnix).replace('POIJOBSHELL', poijob.shell ?: '')
// Create steps and publishers depending on the type of Job that is selected
if(poijob.maven) {
steps {
shell(shellcmds)
shellEx(delegate, shellcmds, poijob)
maven {
goals('clean')
rootPOM('sonar/pom.xml')
@ -195,7 +288,6 @@ for more details about the DSL.</b>
rootPOM('sonar/pom.xml')
mavenOpts('-Xmx2g')
mavenOpts('-Xms256m')
mavenOpts('-XX:MaxPermSize=512m')
mavenOpts('-XX:-OmitStackTraceInFastThrow')
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
mavenInstallation('maven-3.2.1')
@ -207,19 +299,26 @@ for more details about the DSL.</b>
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
}
}
if (!poijob.sonar) {
archiveJunit('sonar/*/target/surefire-reports/TEST-*.xml') {
testDataPublishers {
publishTestStabilityData()
}
}
}
mailer(email, false, false)
}
} else if (poijob.javadoc) {
steps {
shell(shellcmds)
shellEx(delegate, shellcmds, poijob)
ant {
targets(['clean', 'javadocs'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
antInstallation(antRT)
}
shell('zip -r build/javadocs.zip build/tmp/site/build/site/apidocs')
shellEx(delegate, 'zip -r build/javadocs.zip build/site/apidocs', poijob)
}
publishers {
if (!poijob.skipcigame) {
@ -231,7 +330,7 @@ for more details about the DSL.</b>
}
} else if (poijob.apicheck) {
steps {
shell(shellcmds)
shellEx(delegate, shellcmds, poijob)
gradle {
tasks('japicmp')
useWrapper(false)
@ -248,7 +347,7 @@ for more details about the DSL.</b>
}
} else if(poijob.sonar) {
steps {
shell(shellcmds)
shellEx(delegate, shellcmds, poijob)
gradle {
switches('-PenableSonar')
switches('-Dsonar.host.url=$SONAR_HOST_URL')
@ -266,9 +365,9 @@ for more details about the DSL.</b>
}
} else {
steps {
shell(shellcmds)
shellEx(delegate, shellcmds, poijob)
if(poijob.addShell) {
shell(poijob.addShell)
shellEx(delegate, poijob.addShell, poijob)
}
// For Jobs that should still have the default set of publishers we can configure different steps here
if(poijob.gradle) {
@ -278,14 +377,14 @@ for more details about the DSL.</b>
}
} else if (poijob.noScratchpad) {
ant {
targets(['clean', 'compile-all'] + (poijob.properties ?: []))
targets(['clean', 'compile'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
antInstallation(defaultAnt)
antInstallation(antRT)
}
ant {
targets(['-Dscratchpad.ignore=true', 'jacocotask', 'test-all', 'testcoveragereport'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
antInstallation(defaultAnt)
antInstallation(antRT)
}
} else {
ant {
@ -293,14 +392,14 @@ for more details about the DSL.</b>
prop('coverage.enabled', true)
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
antInstallation(antRT)
}
ant {
targets(['run'] + (poijob.properties ?: []))
buildFile('src/integrationtest/build.xml')
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
antInstallation(antRT)
}
}
}
@ -337,3 +436,236 @@ for more details about the DSL.</b>
}
}
}
xmlbeansjobs.each { xjob ->
def jdkKey = xjob.jdk ?: defaultJdk
def trigger = xjob.trigger ?: defaultTrigger
def email = xjob.email ?: defaultEmail
def slaves = xjob.slaves ?: defaultSlaves + (xjob.slaveAdd ?: '')
def antRT = defaultAnt + (xjob.windows ? ' (Windows)' : '')
job(xjob.name) {
if (xjob.disabled) {
disabled()
}
description( defaultDesc + (xjob.apicheck ? apicheckDesc : sonarDesc) )
logRotator {
numToKeep(5)
artifactNumToKeep(1)
}
label(slaves)
environmentVariables {
env('LANG', 'en_US.UTF-8')
if(jdkKey == '1.10') {
// when using JDK 9/10 for running Ant, we need to provide more modules for the forbidden-api-checks task
// on JDK 11 and newer there is no such module any more, so do not add it here
env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
}
env('FORREST_HOME', xjob.windows ? 'f:\\jenkins\\tools\\forrest\\latest' : '/home/jenkins/tools/forrest/latest')
}
wrappers {
timeout {
absolute(180)
abortBuild()
writeDescription('Build was aborted due to timeout')
}
}
jdk(jdkMapping.get(jdkKey))
scm {
svn(xmlbeansSvnBase) { svnNode ->
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
}
checkoutRetryCount(3)
triggers {
scm(trigger)
}
def shellcmds = (xjob.windows ? shellCmdsWin : shellCmdsUnix).replace('POIJOBSHELL', xjob.shell ?: '')
// Create steps and publishers depending on the type of Job that is selected
steps {
shellEx(delegate, shellcmds, xjob)
if(xjob.addShell) {
shellEx(delegate, xjob.addShell, xjob)
}
ant {
targets(['clean'])
antInstallation(antRT)
}
ant {
targets(['checkintest'])
antInstallation(antRT)
}
ant {
targets(['dist'])
antInstallation(antRT)
}
}
publishers {
archiveArtifacts('build/private/**')
//archiveJunit('build/test/reports/*.xml') {
// testDataPublishers {
// publishTestStabilityData()
// }
//}
if (!xjob.skipcigame) {
configure { project ->
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
}
}
mailer(email, false, false)
}
}
}
/*
Add a special job which spans a two-dimensional matrix of all JDKs that we want to use and
all slaves that we would like to use and test if the java and ant binaries are available
on that machine correctly.
*/
matrixJob('POI-DSL-Test-Environment') {
description(
'''Check installed version of Java/Ant on all build-nodes
This job is used to verify which machines actually have the required programs installed.
Unfortunately we often see builds break because of changes/new machines...''')
/*throttleConcurrentBuilds {
maxPerNode(1)
maxTotal(1)
}*/
logRotator {
numToKeep(1)
artifactNumToKeep(1)
}
axes {
jdk(
'JDK 1.8 (latest)',
'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
'IBM 1.8 64-bit (on Ubuntu only)',
'JDK 10 (latest)',
'JDK 10 b46 (Windows Only)',
'OpenJDK 10.0.2 (on Ubuntu only)',
'JDK 11 (latest)',
'JDK 11 b23 (early access build) (Windows Only)',
'JDK 12 (latest)',
'OpenJDK 12 b18 (early access build)'
)
elasticAxis {
name('Nodes')
labelString('!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21&&!H35&&!websites1&&!couchdb&&!plc4x&&!ppc64le')
ignoreOffline(true)
}
}
steps {
conditionalSteps {
condition {
fileExists('/usr', BaseDir.WORKSPACE)
runner('DontRun')
steps {
shell(
'''which javac
javac -version
echo '<?xml version="1.0"?><project name="POI Build" default="test"><target name="test"><echo>Using Ant: ${ant.version} from ${ant.home}</echo></target></project>' > build.xml
''')
ant {
antInstallation(defaultAnt)
}
}
}
}
conditionalSteps {
condition {
fileExists('c:\\windows', BaseDir.WORKSPACE)
runner('DontRun')
steps {
batchFile {
command(
'''@echo off
echo .
where javac.exe
echo .
javac -version
echo .
echo ^<?xml version=^"1.0^"?^>^<project name=^"POI Build^" default=^"test^"^>^<target name=^"test^"^>^<echo^>Using Ant: ${ant.version} from ${ant.home}^</echo^>^</target^>^</project^> > build.xml
''')
}
ant {
antInstallation(defaultAnt + ' (Windows)')
}
}
}
}
}
}
/* I tried to put the view into a sub-folder/sub-view, but failed, there are multiple related
plugins so this is all a bit confusing :(, see also https://issues.apache.org/jira/browse/INFRA-14002
dashboardView("P/POI-new") {
columns {
status()
weather()
configureProject()
buildButton()
cronTrigger()
lastBuildConsole()
name()
lastSuccess()
lastFailure()
lastDuration()
//lastSuccessDescription()
jacoco()
}
description("<table>\n" +
" <tr>\n" +
" <td><img src=\"https://poi.apache.org/images/project-header.png\" /></td>\n" +
" <td> \n" +
" <p>Apache POI - the Java API for Microsoft Documents</p>\n" +
" <p><b>Most of the POI Jobs are automatically generated by Jenkins Job DSL\n" +
" at <a href=\"https://svn.apache.org/repos/asf/poi/trunk/jenkins\">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,<br/>\n" +
" see <a href=\"https://github.com/jenkinsci/job-dsl-plugin/wiki\">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>\n" +
" for more details about the DSL.</b>\n" +
" </p>\n" +
" <p>\n" +
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/findbugsResult/\" target=\"_blank\">Findbugs report of latest build</a></b> -\n" +
" <b><a href=\"https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1\" target=\"_blank\">Sonar reports</a></b> -\n" +
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/coverage/index.html\" target=\"_blank\">Coverage of latest build</a></b>\n" +
" </p>\n" +
" </td>\n" +
" </tr>\n" +
"</table>")
filterBuildQueue(false)
filterExecutors(false)
// Job selection
jobs {*/
//regex(/.*POI.*/)
/*}
// Layout
topPortlets {
jenkinsJobsList {
displayName('POI jobs')
}
}
leftPortlets {
testStatisticsChart()
}
rightPortlets {
testTrendChart()
}
bottomPortlets {
testStatisticsGrid()
buildStatistics()
}
}*/

View File

@ -1,7 +1,7 @@
Apache POI
Copyright 2003-2017 The Apache Software Foundation
Copyright 2003-2018 The Apache Software Foundation
This product includes software developed by
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
This product contains parts that were originally based on software from BEA.
@ -14,9 +14,6 @@ This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
World Wide Web Consortium (Massachusetts Institute of Technology, European
Research Consortium for Informatics and Mathematics, Keio University)
This product contains the Piccolo XML Parser for Java
(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
This product contains the chunks_parse_cmds.tbl file from the vsdump program.
Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)

View File

@ -64,7 +64,7 @@
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
<version>2.6.0</version>
</dependency>
</dependencies>
</project>

View File

@ -73,7 +73,7 @@
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
<version>2.6.0</version>
</dependency>
</dependencies>
</project>

View File

@ -62,7 +62,7 @@
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
<version>3.0.2</version>
</dependency>
</dependencies>
</project>

View File

@ -70,9 +70,14 @@
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
<version>1.04</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
<version>1.05</version>
</dependency>
</dependencies>
</project>

View File

@ -76,7 +76,17 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
@ -91,11 +101,6 @@
<scope>test</scope>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
</dependencies>
</project>

View File

@ -26,7 +26,7 @@ under the License.
<!-- TODO Import these from the parent build file -->
<property name="repository.m2" value="http://repo1.maven.org"/>
<property name="version.id" value="3.11-beta1"/>
<property name="version.id" value="4.0.1-SNAPSHOT"/>
<property name="dist.dir" value="build/dist"/>
<!-- jars in the /lib directory, see the fetch-bundle-jars target-->

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
</parent>
<artifactId>poi-examples</artifactId>
<packaging>jar</packaging>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
</parent>
<artifactId>poi-excelant</artifactId>
<packaging>jar</packaging>
@ -108,7 +108,7 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.2</version>
<version>1.10.1</version>
</dependency>
</dependencies>
</project>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
</parent>
<artifactId>poi-main</artifactId>
<packaging>jar</packaging>
@ -103,7 +103,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.plugin.surefire.version}</version>
<configuration>
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -XX:MaxPermSize=256m -XX:-OmitStackTraceInFastThrow</argLine>
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=${basedir}/target/tmp -XX:-OmitStackTraceInFastThrow</argLine>
</configuration>
</plugin>
</plugins>
@ -113,17 +113,42 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
<version>4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema-encryption</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema-security</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>poi-ooxml-schema</artifactId>

View File

@ -6,70 +6,70 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
</parent>
<artifactId>poi-ooxml</artifactId>
<packaging>jar</packaging>
<name>Apache POI OOXML package</name>
<build>
<plugins>
<!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.plugin.resources.version}</version>
<executions>
<execution>
<id>copy-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<resources>
<resource>
<directory>../../src/ooxml/java</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
<resources>
<resource>
<directory>../../src/resources/ooxml</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-tests</id>
<phase>generate-test-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/test/java</outputDirectory>
<resources>
<resource>
<directory>../../src/ooxml/testcases</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- clean copied sources afterwards -->
<plugin>
<build>
<plugins>
<!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.plugin.resources.version}</version>
<executions>
<execution>
<id>copy-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<resources>
<resource>
<directory>../../src/ooxml/java</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
<resources>
<resource>
<directory>../../src/resources/ooxml</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-tests</id>
<phase>generate-test-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/test/java</outputDirectory>
<resources>
<resource>
<directory>../../src/ooxml/testcases</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- clean copied sources afterwards -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.plugin.clean.version}</version>
<configuration>
@ -93,73 +93,97 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.plugin.surefire.version}</version>
<configuration>
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -XX:MaxPermSize=256m -XX:-OmitStackTraceInFastThrow</argLine>
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=${basedir}/target/tmp -XX:-OmitStackTraceInFastThrow</argLine>
</configuration>
</plugin>
</plugins>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema-encryption</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema-security</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${xmlbeans.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.54</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.54</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
<version>1.04</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${xmlbeans.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.60</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.60</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
<version>1.05</version>
</dependency>
<!-- non-test dependency for OOXMLLite -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.19</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,277 +1,338 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<packaging>pom</packaging>
<version>3.16-beta3-SNAPSHOT</version>
<name>Apache POI - the Java API for Microsoft Documents</name>
<description>Maven build of Apache POI for Sonar checks</description>
<url>http://poi.apache.org/</url>
<mailingLists>
<mailingList>
<name>POI Users List</name>
<subscribe>user-subscribe@poi.apache.org</subscribe>
<unsubscribe>user-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-user/</archive>
</mailingList>
<mailingList>
<name>POI Developer List</name>
<subscribe>dev-subscribe@poi.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-dev/</archive>
</mailingList>
</mailingLists>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<issueManagement>
<system>Bugzilla</system>
<url>https://bz.apache.org/bugzilla/</url>
</issueManagement>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/poi/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/poi/trunk</developerConnection>
<url>http://svn.apache.org/viewvc/poi</url>
</scm>
<modules>
<module>main</module>
<module>ooxml-schema</module>
<module>ooxml-schema-encryption</module>
<module>ooxml-schema-security</module>
<module>ooxml</module>
<module>scratchpad</module>
<module>excelant</module>
<module>examples</module>
</modules>
<properties>
<project.build.sourceEncoding>ASCII</project.build.sourceEncoding>
<!-- Try to disable running SVN blame as it causes errors here because the source is copied from the actual SVN location here! -->
<sonar.scm.disabled>true</sonar.scm.disabled>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<packaging>pom</packaging>
<version>4.0.2-SNAPSHOT</version>
<name>Apache POI - the Java API for Microsoft Documents</name>
<description>Maven build of Apache POI for Sonar checks</description>
<url>http://poi.apache.org/</url>
<!-- define some of the third-party or plugin-versions globally to use the same in all modules -->
<xmlbeans.version>2.6.0</xmlbeans.version>
<junit.version>4.12</junit.version>
<maven.plugin.resources.version>3.0.1</maven.plugin.resources.version>
<maven.plugin.jar.version>3.0.1</maven.plugin.jar.version>
<maven.plugin.clean.version>3.0.0</maven.plugin.clean.version>
<maven.plugin.download.version>1.1.0</maven.plugin.download.version>
<maven.plugin.antrun.version>1.8</maven.plugin.antrun.version>
<maven.plugin.surefire.version>2.19.1</maven.plugin.surefire.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.plugin.surefire.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${maven.plugin.surefire.version}</version>
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<POI.testdata.path>../../test-data</POI.testdata.path>
<java.awt.headless>true</java.awt.headless>
<org.apache.poi.util.POILogger>org.apache.poi.util.NullLogger</org.apache.poi.util.POILogger>
</systemPropertyVariables>
<!-- use to following to analyze OOM issues: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -->
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m</argLine>
<excludes>
<exclude>**/All*Tests.java</exclude>
<exclude>**/TestUnfixedBugs.java</exclude>
<exclude>**/TestcaseRecordInputStream.java</exclude>
<exclude>**/POITestCase.java</exclude>
<!-- TODO: error about no public construct, seems to run with JUnit 3.8... -->
<exclude>**/TestWordToConverterSuite*.java</exclude>
<exclude>**/TestExcelConverterSuite*.java</exclude>
</excludes>
<!--test>TestPPTX2PNG</test-->
<!--parallel>both</parallel>
<threadCount>10</threadCount-->
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.8</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<mailingLists>
<mailingList>
<name>POI Users List</name>
<subscribe>user-subscribe@poi.apache.org</subscribe>
<unsubscribe>user-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-user/</archive>
</mailingList>
<mailingList>
<name>POI Developer List</name>
<subscribe>dev-subscribe@poi.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-dev/</archive>
</mailingList>
</mailingLists>
<profiles>
<!-- We need a fair amount of memory to compile the xml schema, -->
<!-- but limit it in case it goes wrong! -->
<!-- Pick the right amount based on 32 vs 64 bit jvm -->
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<issueManagement>
<system>Bugzilla</system>
<url>https://bz.apache.org/bugzilla/</url>
</issueManagement>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/poi/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/poi/trunk</developerConnection>
<url>http://svn.apache.org/viewvc/poi</url>
</scm>
<repositories>
<repository>
<id>apache-releases-repo</id>
<name>apache releases repo</name>
<url>https://repository.apache.org/content/repositories/releases</url>
</repository>
</repositories>
<modules>
<module>main</module>
<module>ooxml-schema</module>
<module>ooxml-schema-encryption</module>
<module>ooxml-schema-security</module>
<module>ooxml</module>
<module>scratchpad</module>
<module>excelant</module>
<module>examples</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Try to disable running SVN blame as it causes errors here because the source is copied from the actual SVN location here! -->
<sonar.scm.disabled>true</sonar.scm.disabled>
<!-- define some of the third-party or plugin-versions globally to use the same in all modules -->
<xmlbeans.version>3.0.2</xmlbeans.version>
<junit.version>4.12</junit.version>
<xmlunit.version>2.5.1</xmlunit.version>
<mockito.version>2.13.0</mockito.version>
<maven.plugin.resources.version>3.0.1</maven.plugin.resources.version>
<maven.plugin.jar.version>3.0.1</maven.plugin.jar.version>
<maven.plugin.clean.version>3.0.0</maven.plugin.clean.version>
<maven.plugin.download.version>1.1.0</maven.plugin.download.version>
<maven.plugin.antrun.version>1.8</maven.plugin.antrun.version>
<maven.plugin.surefire.version>2.19.1</maven.plugin.surefire.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.plugin.surefire.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${maven.plugin.surefire.version}</version>
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<POI.testdata.path>../../test-data</POI.testdata.path>
<java.awt.headless>true</java.awt.headless>
<org.apache.poi.util.POILogger>org.apache.poi.util.NullLogger</org.apache.poi.util.POILogger>
</systemPropertyVariables>
<!-- use to following to analyze OOM issues: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -->
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=${basedir}/target/tmp
</argLine>
<excludes>
<exclude>**/All*Tests.java</exclude>
<exclude>**/TestUnfixedBugs.java</exclude>
<exclude>**/TestcaseRecordInputStream.java</exclude>
<exclude>**/POITestCase.java</exclude>
<!-- TODO: error about no public construct, seems to run with JUnit 3.8... -->
<exclude>**/TestWordToConverterSuite*.java</exclude>
<exclude>**/TestExcelConverterSuite*.java</exclude>
</excludes>
<!--test>TestPPTX2PNG</test-->
<!--parallel>both</parallel>
<threadCount>10</threadCount-->
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- We need a fair amount of memory to compile the xml schema, -->
<!-- but limit it in case it goes wrong! -->
<!-- Pick the right amount based on 32 vs 64 bit jvm -->
<!-- ********************************************************** -->
<!-- If you are using IntelliJ, you might want to check -->
<!-- http://stackoverflow.com/questions/24115142 -->
<!-- ********************************************************** -->
<profile>
<id>32bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>32</value>
</property>
</activation>
<properties>
<maven.compiler.maxmem>512m</maven.compiler.maxmem>
<argLine>-Xmx768m -XX:MaxPermSize=128m</argLine>
</properties>
</profile>
<profile>
<id>64bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>64</value>
</property>
</activation>
<properties>
<maven.compiler.maxmem>768m</maven.compiler.maxmem>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</properties>
</profile>
<profile>
<id>32bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>32</value>
</property>
</activation>
<properties>
<maven.compiler.maxmem>512m</maven.compiler.maxmem>
<argLine>-Xmx768m</argLine>
</properties>
</profile>
<profile>
<id>xmlbean</id>
<activation>
<file><exists>xmlbeans.marker</exists></file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<schemaDirectory>${basedir}/target/schemas</schemaDirectory>
<javaSource>1.5</javaSource>
<noJavac>true</noJavac>
<noUpa>${xmlbeans.noUpa}</noUpa>
<noPvr>${xmlbeans.noPvr}</noPvr>
<xmlConfigs>
<xmlConfig implementation="java.io.File">${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionCertificate.xsdconfig</xmlConfig>
<xmlConfig implementation="java.io.File">${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionInfo.xsdconfig</xmlConfig>
<xmlConfig implementation="java.io.File">${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionPassword.xsdconfig</xmlConfig>
<xmlConfig implementation="java.io.File">${basedir}/../../src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig</xmlConfig>
</xmlConfigs>
</configuration>
</execution>
</executions>
</plugin>
<profile>
<id>64bitstuff</id>
<activation>
<property>
<name>sun.arch.data.model</name>
<value>64</value>
</property>
</activation>
<properties>
<maven.compiler.maxmem>768m</maven.compiler.maxmem>
<argLine>-Xmx1024m</argLine>
</properties>
</profile>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.plugin.antrun.version}</version>
<executions>
<execution>
<id>copy-xmltype-and-xsdconfig</id>
<phase>generate-sources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<copy todir="${basedir}/target/generated-sources/xmlbeans">
<fileset dir="${basedir}/../../src/ooxml/java">
<include name="org/apache/poi/POIXMLTypeLoader.java"/>
<include name="org/apache/poi/util/DocumentHelper.java"/>
<include name="org/apache/poi/util/SAXHelper.java"/>
</fileset>
<fileset dir="${basedir}/../../src/java">
<include name="org/apache/poi/util/POILogFactory.java"/>
<include name="org/apache/poi/util/POILogger.java"/>
<include name="org/apache/poi/util/NullLogger.java"/>
<include name="org/apache/poi/util/Internal.java"/>
</fileset>
</copy>
<copy todir="${basedir}/target/schemas">
<fileset dir="${basedir}/../../src/ooxml/resources/org/apache/poi/schemas"/>
</copy>
</target>
</configuration>
</execution>
<execution>
<id>replace-xmltypeloader</id>
<phase>process-sources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<replace dir="${basedir}/target/generated-sources/xmlbeans" includes="**/*.java" excludes="**/impl/**">
<replacetoken>org.apache.xmlbeans.XmlBeans.getContextTypeLoader()</replacetoken>
<replacevalue>org.apache.poi.POIXMLTypeLoader</replacevalue>
</replace>
</target>
</configuration>
</execution>
<execution>
<id>remove-xmltypeloader-from-schema-jar</id>
<phase>prepare-package</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<touch file="${basedir}/target/generated-sources/xmlbeans/.staleFlag"/>
<delete dir="${basedir}/target/classes/org/apache"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${xmlbeans.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
<profile>
<id>xmlbean</id>
<activation>
<file>
<exists>xmlbeans.marker</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
<configuration>
<schemaDirectory>${basedir}/target/schemas</schemaDirectory>
<javaSource>1.5</javaSource>
<noJavac>true</noJavac>
<noUpa>${xmlbeans.noUpa}</noUpa>
<noPvr>${xmlbeans.noPvr}</noPvr>
<xmlConfigs>
<xmlConfig implementation="java.io.File">
${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionCertificate.xsdconfig
</xmlConfig>
<xmlConfig implementation="java.io.File">
${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionInfo.xsdconfig
</xmlConfig>
<xmlConfig implementation="java.io.File">
${basedir}/../../src/ooxml/resources/org/apache/poi/poifs/crypt/encryptionPassword.xsdconfig
</xmlConfig>
<xmlConfig implementation="java.io.File">
${basedir}/../../src/ooxml/resources/org/apache/poi/schemas/ooxmlSchemas.xsdconfig
</xmlConfig>
</xmlConfigs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.plugin.antrun.version}</version>
<executions>
<execution>
<id>copy-xmltype-and-xsdconfig</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy todir="${basedir}/target/schemas">
<fileset dir="${basedir}/../../src/ooxml/resources/org/apache/poi/schemas"/>
</copy>
</target>
</configuration>
</execution>
<execution>
<id>replace-xmltypeloader</id>
<phase>process-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="xmlbean.sources.dir"
location="${basedir}/target/generated-sources/xmlbeans"/>
<property name="loaderMethod"><![CDATA[
private static java.lang.ref.SoftReference<org.apache.xmlbeans.SchemaTypeLoader> typeLoader;
private static synchronized org.apache.xmlbeans.SchemaTypeLoader getTypeLoader() {
org.apache.xmlbeans.SchemaTypeLoader stl = (typeLoader == null) ? null : typeLoader.get();
if (stl == null) {
stl = org.apache.xmlbeans.XmlBeans.typeLoaderForClassLoader(\2.class.getClassLoader());
typeLoader = new java.lang.ref.SoftReference(stl);
}
return stl;
}
public static \2 newInstance\(\) \{]]></property>
<replaceregexp byline="true"
match="(\s*)public static ([^ ]+) newInstance\(\) \{"
replace="${loaderMethod}">
<fileset dir="${xmlbean.sources.dir}" includes="**/*.java"
excludes="**/impl/**"/>
</replaceregexp>
<replace dir="${xmlbean.sources.dir}" includes="**/*.java"
excludes="**/impl/**">
<replacetoken>org.apache.xmlbeans.XmlBeans.getContextTypeLoader
</replacetoken>
<replacevalue>getTypeLoader</replacevalue>
</replace>
<!-- remove deprecated warnings, as we prefer the array methods - see #56854 -->
<replace dir="${xmlbean.sources.dir}" includes="**/*.java"
excludes="**/impl/**">
<replacetoken><![CDATA[ * @deprecated
]]></replacetoken>
</replace>
</target>
</configuration>
</execution>
<execution>
<id>remove-xmltypeloader-from-schema-jar</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<touch file="${basedir}/target/generated-sources/xmlbeans/.staleFlag"/>
<delete dir="${basedir}/target/classes/org/apache"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${xmlbeans.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.16-beta3-SNAPSHOT</version>
<version>4.0.2-SNAPSHOT</version>
</parent>
<artifactId>poi-scratchpad</artifactId>
<packaging>jar</packaging>

View File

@ -1,4 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,31 +14,23 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.poifs.storage;
(ns poi.core
(:gen-class)
(:use [clojure.java.io :only [input-stream]])
(:import [org.apache.poi.ss.usermodel WorkbookFactory DataFormatter]))
import java.io.IOException;
/**
* An interface for blocks managed by a list that works with a
* BlockAllocationTable to keep block sequences straight
*
* @author Marc Johnson (mjohnson at apache dot org
*/
(defn sheets [wb] (map #(.getSheetAt wb %1) (range 0 (.getNumberOfSheets wb))))
public interface ListManagedBlock
{
/**
* Get the data from the block
*
* @return the block's data as a byte array
*
* @exception IOException if there is no data
*/
public byte [] getData()
throws IOException;
} // end public interface ListManagedBlock
(defn print-all [wb]
(let [df (DataFormatter.)]
(doseq [sheet (sheets wb)]
(doseq [row (seq sheet)]
(doseq [cell (seq row)]
(println (.formatAsString (.getAddress cell)) ": " (.formatCellValue df cell)))))))
(defn -main [& args]
(when-let [name (first args)]
(let [wb (WorkbookFactory/create (input-stream name))]
(print-all wb))))

View File

@ -0,0 +1,108 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
import org.apache.poi.ss.usermodel.*
import org.apache.poi.ss.util.*
import java.io.File
if (args.length == 0) {
println "Use:"
println " SpreadSheetDemo <excel-file> [output-file]"
return 1
}
File f = new File(args[0])
DataFormatter formatter = new DataFormatter()
WorkbookFactory.create(f,null,true).withCloseable { workbook ->
println "Has ${workbook.getNumberOfSheets()} sheets"
// Dump the contents of the spreadsheet
(0..<workbook.getNumberOfSheets()).each { sheetNum ->
println "Sheet ${sheetNum} is called ${workbook.getSheetName(sheetNum)}"
def sheet = workbook.getSheetAt(sheetNum)
sheet.each { row ->
def nonEmptyCells = row.grep { c -> c.getCellType() != Cell.CELL_TYPE_BLANK }
println " Row ${row.getRowNum()} has ${nonEmptyCells.size()} non-empty cells:"
nonEmptyCells.each { c ->
def cRef = [c] as CellReference
println " * ${cRef.formatAsString()} = ${formatter.formatCellValue(c)}"
}
}
}
// Add two new sheets and populate
CellStyle headerStyle = makeHeaderStyle(workbook)
Sheet ns1 = workbook.createSheet("Generated 1")
exportHeader(ns1, headerStyle, null, ["ID","Title","Num"] as String[])
ns1.createRow(1).createCell(0).setCellValue("TODO - Populate with data")
Sheet ns2 = workbook.createSheet("Generated 2")
exportHeader(ns2, headerStyle, "This is a demo sheet",
["ID","Title","Date","Author","Num"] as String[])
ns2.createRow(2).createCell(0).setCellValue(1)
ns2.createRow(3).createCell(0).setCellValue(4)
ns2.createRow(4).createCell(0).setCellValue(1)
// Save
File output = File.createTempFile("output-", (f.getName() =~ /(\.\w+$)/)[0][0])
output.withOutputStream { os -> workbook.write(os) }
println "Saved as ${output}"
}
CellStyle makeHeaderStyle(Workbook wb) {
int HEADER_HEIGHT = 18
CellStyle style = wb.createCellStyle()
style.setFillForegroundColor(IndexedColors.AQUA.getIndex())
style.setFillPattern(FillPatternType.SOLID_FOREGROUND)
Font font = wb.createFont()
font.setFontHeightInPoints((short)HEADER_HEIGHT)
font.setBold(true)
style.setFont(font)
return style
}
void exportHeader(Sheet s, CellStyle headerStyle, String info, String[] headers) {
Row r
int rn = 0
int HEADER_HEIGHT = 18
// Do they want an info row at the top?
if (info != null && !info.isEmpty()) {
r = s.createRow(rn)
r.setHeightInPoints(HEADER_HEIGHT+1)
rn++
Cell c = r.createCell(0)
c.setCellValue(info)
c.setCellStyle(headerStyle)
s.addMergedRegion(new CellRangeAddress(0,0,0,headers.length-1))
}
// Create the header row, of the right size
r = s.createRow(rn)
r.setHeightInPoints(HEADER_HEIGHT+1)
// Add the column headings
headers.eachWithIndex { col, idx ->
Cell c = r.createCell(idx)
c.setCellValue(col)
c.setCellStyle(headerStyle)
s.autoSizeColumn(idx)
}
// Make all the columns filterable
s.setAutoFilter(new CellRangeAddress(rn, rn, 0, headers.length-1))
}

View File

@ -15,26 +15,29 @@
limitations under the License.
==================================================================== */
package org.apache.poi.hpsf;
import org.apache.poi.util.Removal;
/**
* Interface for the convenience classes {@link SummaryInformation}
* and {@link DocumentSummaryInformation}.<p>
*
* This used to be an abstract class to support late loading
* of the SummaryInformation classes, as their concrete instance can
* only be determined after the PropertySet has been loaded.
*
* @deprecated POI 3.16 - use PropertySet as base class instead
*/
@Removal(version="3.18")
public class SpecialPropertySet extends MutablePropertySet {
public SpecialPropertySet() {
}
public SpecialPropertySet(final PropertySet ps) throws UnexpectedPropertySetTypeException {
super(ps);
}
// Add the POI core and OOXML support dependencies into your gradle build,
// along with all of Groovy so it can run as a standalone script
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.13'
compile 'org.apache.poi:poi:4.0.0'
compile 'org.apache.poi:poi-ooxml:4.0.0'
}
// Our files are in the current directory
sourceSets {
main { groovy { srcDirs = ['.'] } }
}
// Run out read demo by default
tasks.withType(JavaExec) {
classpath = sourceSets.main.runtimeClasspath
}
task runScript(type: JavaExec) {
main = "SpreadSheetDemo"
args = ["../../../test-data/spreadsheet/Simple.xls"]
}
defaultTasks 'runScript'

View File

@ -32,7 +32,7 @@ Select an Excel file to read.
<%
String filename = request.getParameter("xls_filename");
if (filename != null && !filename.equals("")) {
if (filename != null && !filename.isEmpty()) {
%>
<br>You chose the file <%= filename %>.
<br><br>It's contents are:

View File

@ -0,0 +1,56 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
// Import the required classes
import org.apache.poi.ss.usermodel.{WorkbookFactory, DataFormatter}
import java.io.{File, FileOutputStream}
object XSSFMain extends App {
// Automatically convert Java collections to Scala equivalents
import scala.collection.JavaConversions._
// Read the contents of the workbook
val workbook = WorkbookFactory.create(new File("SampleSS.xlsx"))
val formatter = new DataFormatter()
for {
// Iterate and print the sheets
(sheet, i) <- workbook.zipWithIndex
_ = println(s"Sheet $i of ${workbook.getNumberOfSheets}: ${sheet.getSheetName}")
// Iterate and print the rows
row <- sheet
_ = println(s"\tRow ${row.getRowNum}")
// Iterate and print the cells
cell <- row
} {
println(s"\t\t${cell.getCellAddress}: ${formatter.formatCellValue(cell)}")
}
// Add a sheet to the workbook
val sheet = workbook.createSheet("new sheet")
val row = sheet.createRow(7)
val cell = row.createCell(42)
cell.setAsActiveCell()
cell.setCellValue("The answer to life, the universe, and everything")
// Save the updated workbook as a new file
val fos = new FileOutputStream("SampleSS-updated.xlsx")
workbook.write(fos)
workbook.close()
}

View File

@ -0,0 +1,23 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
// Add the POI core and OOXML support dependencies into your build.sbt
libraryDependencies ++= Seq(
"org.apache.poi" % "poi" % "4.0.0",
"org.apache.poi" % "poi-ooxml" % "4.0.0",
"org.apache.poi" % "poi-ooxml-schemas" "4.0.0",
)

View File

@ -0,0 +1,119 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.crypt.examples;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.security.GeneralSecurityException;
import org.apache.poi.poifs.crypt.Decryptor;
import org.apache.poi.poifs.crypt.EncryptionInfo;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
/**
* Tries a list of possible passwords for an OOXML protected file
*
* Note that this isn't very fast, and is aimed at when you have
* just a few passwords to check.
* For serious processing, you'd be best off grabbing the hash
* out with POI or office2john.py, then running that against
* "John The Ripper" or GPU enabled version of "hashcat"
*/
public class OOXMLPasswordsTry implements Closeable {
private POIFSFileSystem fs;
private EncryptionInfo info;
private Decryptor d;
private OOXMLPasswordsTry(POIFSFileSystem fs) throws IOException {
info = new EncryptionInfo(fs);
d = Decryptor.getInstance(info);
this.fs = fs;
}
private OOXMLPasswordsTry(File file) throws IOException {
this(new POIFSFileSystem(file, true));
}
private OOXMLPasswordsTry(InputStream is) throws IOException {
this(new POIFSFileSystem(is));
}
public void close() throws IOException {
fs.close();
}
public String tryAll(File wordfile) throws IOException, GeneralSecurityException {
// Load
BufferedReader r = new BufferedReader(new FileReader(wordfile));
long start = System.currentTimeMillis();
int count = 0;
// Try each password in turn, reporting progress
String valid = null;
String password;
while ((password = r.readLine()) != null) {
if (isValid(password)) {
valid = password;
break;
}
count++;
if (count % 1000 == 0) {
int secs = (int)((System.currentTimeMillis() - start) / 1000);
System.out.println("Done " + count + " passwords, " +
secs + " seconds, last password " + password);
}
}
// Tidy and return (null if no match)
r.close();
return valid;
}
public boolean isValid(String password) throws GeneralSecurityException {
return d.verifyPassword(password);
}
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("Use:");
System.err.println(" OOXMLPasswordsTry <file.ooxml> <wordlist>");
System.exit(1);
}
File ooxml = new File(args[0]);
File words = new File(args[1]);
System.out.println("Trying passwords from " + words + " against " + ooxml);
System.out.println();
OOXMLPasswordsTry pt = new OOXMLPasswordsTry(ooxml);
String password = pt.tryAll(words);
pt.close();
System.out.println();
if (password == null) {
System.out.println("Error - No password matched");
} else {
System.out.println("Password found!");
System.out.println(password);
}
}
}

View File

@ -20,8 +20,6 @@ package org.apache.poi.hpsf.examples;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -30,21 +28,21 @@ import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import org.apache.poi.hpsf.DocumentSummaryInformation;
import org.apache.poi.hpsf.HPSFRuntimeException;
import org.apache.poi.hpsf.MarkUnsupportedException;
import org.apache.poi.hpsf.MutablePropertySet;
import org.apache.poi.hpsf.NoPropertySetStreamException;
import org.apache.poi.hpsf.PropertySet;
import org.apache.poi.hpsf.PropertySetFactory;
import org.apache.poi.hpsf.Util;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
import org.apache.poi.hpsf.WritingNotSupportedException;
import org.apache.poi.poifs.eventfilesystem.POIFSReader;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.Entry;
import org.apache.poi.poifs.filesystem.EntryUtils;
import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.TempFile;
@ -52,55 +50,43 @@ import org.apache.poi.util.TempFile;
/**
* <p>This class copies a POI file system to a new file and compares the copy
* with the original.</p>
*
* <p>
* <p>Property set streams are copied logically, i.e. the application
* establishes a {@link org.apache.poi.hpsf.PropertySet} of an original property
* set, creates a {@link org.apache.poi.hpsf.MutablePropertySet} from the
* {@link org.apache.poi.hpsf.PropertySet} and writes the
* {@link org.apache.poi.hpsf.MutablePropertySet} to the destination POI file
* set, creates a {@link org.apache.poi.hpsf.PropertySet} and writes the
* {@link org.apache.poi.hpsf.PropertySet} to the destination POI file
* system. - Streams which are no property set streams are copied bit by
* bit.</p>
*
* <p>
* <p>The comparison of the POI file systems is done logically. That means that
* the two disk files containing the POI file systems do not need to be
* exactly identical. However, both POI file systems must contain the same
* files, and most of these files must be bitwise identical. Property set
* streams, however, are compared logically: they must have the same sections
* with the same attributs, and the sections must contain the same properties.
* with the same attributes, and the sections must contain the same properties.
* Details like the ordering of the properties do not matter.</p>
*/
public class CopyCompare
{
public final class CopyCompare {
private CopyCompare() {}
/**
* <p>Runs the example program. The application expects one or two
* arguments:</p>
*
* Runs the example program. The application expects one or two arguments:
*
* <ol>
*
* <li><p>The first argument is the disk file name of the POI filesystem to
* copy.</p></li>
*
* <li><p>The second argument is optional. If it is given, it is the name of
* <li>The first argument is the disk file name of the POI filesystem to copy.</li>
* <li>The second argument is optional. If it is given, it is the name of
* a disk file the copy of the POI filesystem will be written to. If it is
* not given, the copy will be written to a temporary file which will be
* deleted at the end of the program.</p></li>
*
* deleted at the end of the program.</li>
* </ol>
*
* @param args Command-line arguments.
* @exception MarkUnsupportedException if a POI document stream does not
* support the mark() operation.
* @exception NoPropertySetStreamException if the application tries to
* create a property set from a POI document stream that is not a property
* set stream.
* @exception IOException if any I/O exception occurs.
* @exception UnsupportedEncodingException if a character encoding is not
* supported.
* @throws IOException if any I/O exception occurs.
* @throws UnsupportedEncodingException if a character encoding is not
* supported.
*/
public static void main(final String[] args)
throws NoPropertySetStreamException, MarkUnsupportedException,
UnsupportedEncodingException, IOException
{
throws UnsupportedEncodingException, IOException {
String originalFileName = null;
String copyFileName = null;
@ -115,7 +101,7 @@ public class CopyCompare
copyFileName = args[1];
} else {
System.err.println("Usage: " + CopyCompare.class.getName() +
"originPOIFS [copyPOIFS]");
"originPOIFS [copyPOIFS]");
System.exit(1);
}
@ -124,156 +110,23 @@ public class CopyCompare
final POIFSReader r = new POIFSReader();
final CopyFile cf = new CopyFile(copyFileName);
r.registerListener(cf);
FileInputStream fis = new FileInputStream(originalFileName);
r.read(fis);
fis.close();
r.setNotifyEmptyDirectories(true);
r.read(new File(originalFileName));
/* Write the new POIFS to disk. */
cf.close();
/* Read all documents from the original POI file system and compare them
* with the equivalent document from the copy. */
final POIFSFileSystem opfs = new POIFSFileSystem(new File(originalFileName));
final POIFSFileSystem cpfs = new POIFSFileSystem(new File(copyFileName));
final DirectoryEntry oRoot = opfs.getRoot();
final DirectoryEntry cRoot = cpfs.getRoot();
final StringBuffer messages = new StringBuffer();
if (equal(oRoot, cRoot, messages)) {
System.out.println("Equal");
} else {
System.out.println("Not equal: " + messages.toString());
try (POIFSFileSystem opfs = new POIFSFileSystem(new File(originalFileName));
POIFSFileSystem cpfs = new POIFSFileSystem(new File(copyFileName))) {
final DirectoryEntry oRoot = opfs.getRoot();
final DirectoryEntry cRoot = cpfs.getRoot();
System.out.println(EntryUtils.areDirectoriesIdentical(oRoot, cRoot) ? "Equal" : "Not equal");
}
cpfs.close();
opfs.close();
}
/**
* <p>Compares two {@link DirectoryEntry} instances of a POI file system.
* The directories must contain the same streams with the same names and
* contents.</p>
*
* @param d1 The first directory.
* @param d2 The second directory.
* @param msg The method may append human-readable comparison messages to
* this string buffer.
* @return <code>true</code> if the directories are equal, else
* <code>false</code>.
* @exception MarkUnsupportedException if a POI document stream does not
* support the mark() operation.
* @exception NoPropertySetStreamException if the application tries to
* create a property set from a POI document stream that is not a property
* set stream.
* @throws UnsupportedEncodingException
* @exception IOException if any I/O exception occurs.
*/
private static boolean equal(final DirectoryEntry d1,
final DirectoryEntry d2,
final StringBuffer msg)
throws NoPropertySetStreamException, MarkUnsupportedException,
UnsupportedEncodingException, IOException
{
boolean equal = true;
/* Iterate over d1 and compare each entry with its counterpart in d2. */
for (final Entry e1 : d1) {
final String n1 = e1.getName();
Entry e2 = null;
try {
e2 = d2.getEntry(n1);
} catch (FileNotFoundException ex) {
msg.append("Document \"" + e1 + "\" exists, document \"" +
e2 + "\" does not.\n");
equal = false;
break;
}
if (e1.isDirectoryEntry() && e2.isDirectoryEntry()) {
equal = equal((DirectoryEntry) e1, (DirectoryEntry) e2, msg);
} else if (e1.isDocumentEntry() && e2.isDocumentEntry()) {
equal = equal((DocumentEntry) e1, (DocumentEntry) e2, msg);
} else {
msg.append("One of \"" + e1 + "\" and \"" + e2 + "\" is a " +
"document while the other one is a directory.\n");
equal = false;
}
}
/* Iterate over d2 just to make sure that there are no entries in d2
* that are not in d1. */
for (final Entry e2 : d2) {
final String n2 = e2.getName();
Entry e1 = null;
try {
e1 = d1.getEntry(n2);
} catch (FileNotFoundException ex) {
msg.append("Document \"" + e2 + "\" exitsts, document \"" +
e1 + "\" does not.\n");
equal = false;
break;
}
}
return equal;
}
/**
* <p>Compares two {@link DocumentEntry} instances of a POI file system.
* Documents that are not property set streams must be bitwise identical.
* Property set streams must be logically equal.</p>
*
* @param d1 The first document.
* @param d2 The second document.
* @param msg The method may append human-readable comparison messages to
* this string buffer.
* @return <code>true</code> if the documents are equal, else
* <code>false</code>.
* @exception MarkUnsupportedException if a POI document stream does not
* support the mark() operation.
* @exception NoPropertySetStreamException if the application tries to
* create a property set from a POI document stream that is not a property
* set stream.
* @throws UnsupportedEncodingException
* @exception IOException if any I/O exception occurs.
*/
private static boolean equal(final DocumentEntry d1, final DocumentEntry d2,
final StringBuffer msg)
throws NoPropertySetStreamException, MarkUnsupportedException,
UnsupportedEncodingException, IOException
{
final DocumentInputStream dis1 = new DocumentInputStream(d1);
final DocumentInputStream dis2 = new DocumentInputStream(d2);
try {
if (PropertySet.isPropertySetStream(dis1) &&
PropertySet.isPropertySetStream(dis2)) {
final PropertySet ps1 = PropertySetFactory.create(dis1);
final PropertySet ps2 = PropertySetFactory.create(dis2);
if (!ps1.equals(ps2)) {
msg.append("Property sets are not equal.\n");
return false;
}
} else {
int i1, i2;
do {
i1 = dis1.read();
i2 = dis2.read();
if (i1 != i2) {
msg.append("Documents are not equal.\n");
return false;
}
} while (i1 > -1);
}
} finally {
dis2.close();
dis1.close();
}
return true;
}
/**
* <p>This class does all the work. Its method {@link
* #processPOIFSReaderEvent(POIFSReaderEvent)} is called for each file in
@ -281,7 +134,7 @@ public class CopyCompare
* everything unmodified to the destination POI filesystem. Property set
* streams are copied by creating a new {@link PropertySet} from the
* original property set by using the {@link
* MutablePropertySet#MutablePropertySet(PropertySet)} constructor.</p>
* PropertySet#PropertySet(PropertySet)} constructor.</p>
*/
static class CopyFile implements POIFSReaderListener {
private String dstName;
@ -293,11 +146,11 @@ public class CopyCompare
* <p>The constructor of a {@link CopyFile} instance creates the target
* POIFS. It also stores the name of the file the POIFS will be written
* to once it is complete.</p>
*
*
* @param dstName The name of the disk file the destination POIFS is to
* be written to.
* be written to.
*/
public CopyFile(final String dstName) {
CopyFile(final String dstName) {
this.dstName = dstName;
poiFs = new POIFSFileSystem();
}
@ -320,7 +173,7 @@ public class CopyCompare
try {
/* Find out whether the current document is a property set
* stream or not. */
if (PropertySet.isPropertySetStream(stream)) {
if (stream != null && PropertySet.isPropertySetStream(stream)) {
/* Yes, the current document is a property set stream.
* Let's create a PropertySet instance from it. */
PropertySet ps = null;
@ -337,68 +190,74 @@ public class CopyCompare
} else {
/* No, the current document is not a property set stream. We
* copy it unmodified to the destination POIFS. */
copy(poiFs, event.getPath(), event.getName(), stream);
copy(poiFs, path, name, stream);
}
} catch (MarkUnsupportedException ex) {
t = ex;
} catch (IOException ex) {
t = ex;
} catch (WritingNotSupportedException ex) {
} catch (MarkUnsupportedException | WritingNotSupportedException | IOException ex) {
t = ex;
}
/* According to the definition of the processPOIFSReaderEvent method
* we cannot pass checked exceptions to the caller. The following
* lines check whether a checked exception occured and throws an
* lines check whether a checked exception occurred and throws an
* unchecked exception. The message of that exception is that of
* the underlying checked exception. */
if (t != null) {
throw new HPSFRuntimeException
("Could not read file \"" + path + "/" + name +
"\". Reason: " + Util.toString(t));
throw new HPSFRuntimeException("Could not read file \"" + path + "/" + name, t);
}
}
/**
* <p>Writes a {@link PropertySet} to a POI filesystem.</p>
* Writes a {@link PropertySet} to a POI filesystem.
*
* @param poiFs The POI filesystem to write to.
* @param path The file's path in the POI filesystem.
* @param name The file's name in the POI filesystem.
* @param ps The property set to write.
* @throws WritingNotSupportedException
* @throws IOException
* @param path The file's path in the POI filesystem.
* @param name The file's name in the POI filesystem.
* @param ps The property set to write.
*/
public void copy(final POIFSFileSystem poiFs,
final POIFSDocumentPath path,
final String name,
final PropertySet ps)
throws WritingNotSupportedException, IOException {
throws WritingNotSupportedException, IOException {
final DirectoryEntry de = getPath(poiFs, path);
final MutablePropertySet mps = new MutablePropertySet(ps);
final PropertySet mps;
try {
if (ps instanceof DocumentSummaryInformation) {
mps = new DocumentSummaryInformation(ps);
} else if (ps instanceof SummaryInformation) {
mps = new SummaryInformation(ps);
} else {
mps = new PropertySet(ps);
}
} catch (UnexpectedPropertySetTypeException e) {
throw new IOException(e);
}
de.createDocument(name, mps.toInputStream());
}
/**
* <p>Copies the bytes from a {@link DocumentInputStream} to a new
* stream in a POI filesystem.</p>
* Copies the bytes from a {@link DocumentInputStream} to a new
* stream in a POI filesystem.
*
* @param poiFs The POI filesystem to write to.
* @param path The source document's path.
* @param name The source document's name.
* @param poiFs The POI filesystem to write to.
* @param path The source document's path.
* @param name The source document's name.
* @param stream The stream containing the source document.
* @throws IOException
*/
public void copy(final POIFSFileSystem poiFs,
final POIFSDocumentPath path,
final String name,
final DocumentInputStream stream)
throws IOException {
throws IOException {
// create the directories to the document
final DirectoryEntry de = getPath(poiFs, path);
// check the parameters after the directories have been created
if (stream == null || name == null) {
// Empty directory
return;
}
final ByteArrayOutputStream out = new ByteArrayOutputStream();
int c;
while ((c = stream.read()) != -1) {
@ -407,30 +266,27 @@ public class CopyCompare
stream.close();
out.close();
final InputStream in =
new ByteArrayInputStream(out.toByteArray());
new ByteArrayInputStream(out.toByteArray());
de.createDocument(name, in);
}
/**
* <p>Writes the POI file system to a disk file.</p>
*
* @throws FileNotFoundException
* @throws IOException
* Writes the POI file system to a disk file.
*/
public void close() throws FileNotFoundException, IOException {
public void close() throws IOException {
out = new FileOutputStream(dstName);
poiFs.writeFilesystem(out);
out.close();
}
/** Contains the directory paths that have already been created in the
/**
* Contains the directory paths that have already been created in the
* output POI filesystem and maps them to their corresponding
* {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */
private final Map<String,DirectoryEntry> paths = new HashMap<String,DirectoryEntry>();
* {@link org.apache.poi.poifs.filesystem.DirectoryNode}s.
*/
private final Map<String, DirectoryEntry> paths = new HashMap<>();
/**
@ -439,7 +295,7 @@ public class CopyCompare
* a POI filesystem its directory must be created first. This method
* creates all directories between the POI filesystem root and the
* directory the document should belong to which do not yet exist.</p>
*
* <p>
* <p>Unfortunately POI does not offer a simple method to interrogate
* the POIFS whether a certain child node (file or directory) exists in
* a directory. However, since we always start with an empty POIFS which
@ -450,9 +306,9 @@ public class CopyCompare
* to the corresponding {@link DirectoryEntry} instances.</p>
*
* @param poiFs The POI filesystem the directory hierarchy is created
* in, if needed.
* @param path The document's path. This method creates those directory
* components of this hierarchy which do not yet exist.
* in, if needed.
* @param path The document's path. This method creates those directory
* components of this hierarchy which do not yet exist.
* @return The directory entry of the document path's parent. The caller
* should use this {@link DirectoryEntry} to create documents in it.
*/
@ -479,7 +335,7 @@ public class CopyCompare
de = getPath(poiFs, path.getParent());
/* Now create the target directory: */
de = de.createDirectory(path.getComponent
(path.length() - 1));
(path.length() - 1));
}
paths.put(s, de);
return de;
@ -487,11 +343,7 @@ public class CopyCompare
/* This exception will be thrown if the directory already
* exists. However, since we have full control about directory
* creation we can ensure that this will never happen. */
ex.printStackTrace(System.err);
throw new RuntimeException(ex.toString());
/* FIXME (2): Replace the previous line by the following once we
* no longer need JDK 1.3 compatibility. */
// throw new RuntimeException(ex);
throw new RuntimeException(ex);
}
}
}

View File

@ -19,19 +19,14 @@ package org.apache.poi.hpsf.examples;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import org.apache.poi.hpsf.CustomProperties;
import org.apache.poi.hpsf.DocumentSummaryInformation;
import org.apache.poi.hpsf.MarkUnsupportedException;
import org.apache.poi.hpsf.NoPropertySetStreamException;
import org.apache.poi.hpsf.PropertySetFactory;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
import org.apache.poi.hpsf.WritingNotSupportedException;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
/**
* <p>This is a sample application showing how to easily modify properties in
@ -76,98 +71,84 @@ public class ModifyDocumentSummaryInformation {
* <p>Main method - see class description.</p>
*
* @param args The command-line parameters.
* @throws IOException
* @throws MarkUnsupportedException
* @throws NoPropertySetStreamException
* @throws UnexpectedPropertySetTypeException
* @throws WritingNotSupportedException
*/
public static void main(final String[] args) throws IOException,
NoPropertySetStreamException, MarkUnsupportedException,
UnexpectedPropertySetTypeException, WritingNotSupportedException
{
public static void main(final String[] args) throws Exception {
/* Read the name of the POI filesystem to modify from the command line.
* For brevity to boundary check is performed on the command-line
* arguments. */
File summaryFile = new File(args[0]);
/* Open the POI filesystem. */
NPOIFSFileSystem poifs = new NPOIFSFileSystem(summaryFile, false);
try (POIFSFileSystem poifs = new POIFSFileSystem(summaryFile, false)) {
/* Read the summary information. */
DirectoryEntry dir = poifs.getRoot();
SummaryInformation si;
try
{
si = (SummaryInformation)PropertySetFactory.create(
dir, SummaryInformation.DEFAULT_STREAM_NAME);
/* Read the summary information. */
DirectoryEntry dir = poifs.getRoot();
SummaryInformation si;
try {
si = (SummaryInformation) PropertySetFactory.create(
dir, SummaryInformation.DEFAULT_STREAM_NAME);
} catch (FileNotFoundException ex) {
// There is no summary information yet. We have to create a new one
si = PropertySetFactory.newSummaryInformation();
}
/* Change the author to "Rainer Klute". Any former author value will
* be lost. If there has been no author yet, it will be created. */
si.setAuthor("Rainer Klute");
System.out.println("Author changed to " + si.getAuthor() + ".");
/* Handling the document summary information is analogous to handling
* the summary information. An additional feature, however, are the
* custom properties. */
/* Read the document summary information. */
DocumentSummaryInformation dsi;
try {
dsi = (DocumentSummaryInformation) PropertySetFactory.create(
dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);
} catch (FileNotFoundException ex) {
/* There is no document summary information yet. We have to create a
* new one. */
dsi = PropertySetFactory.newDocumentSummaryInformation();
}
/* Change the category to "POI example". Any former category value will
* be lost. If there has been no category yet, it will be created. */
dsi.setCategory("POI example");
System.out.println("Category changed to " + dsi.getCategory() + ".");
/* Read the custom properties. If there are no custom properties yet,
* the application has to create a new CustomProperties object. It will
* serve as a container for custom properties. */
CustomProperties customProperties = dsi.getCustomProperties();
if (customProperties == null)
customProperties = new CustomProperties();
/* Insert some custom properties into the container. */
customProperties.put("Key 1", "Value 1");
customProperties.put("Schl\u00fcssel 2", "Wert 2");
customProperties.put("Sample Number", 12345);
customProperties.put("Sample Boolean", Boolean.TRUE);
customProperties.put("Sample Date", new Date());
/* Read a custom property. */
Object value = customProperties.get("Sample Number");
System.out.println("Custom Sample Number is now " + value);
/* Write the custom properties back to the document summary
* information. */
dsi.setCustomProperties(customProperties);
/* Write the summary information and the document summary information
* to the POI filesystem. */
si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);
dsi.write(dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);
/* Write the POI filesystem back to the original file. Please note that
* in production code you should take care when write directly to the
* origin, to make sure you don't loose things on error */
poifs.writeFilesystem();
}
catch (FileNotFoundException ex)
{
// There is no summary information yet. We have to create a new one
si = PropertySetFactory.newSummaryInformation();
}
/* Change the author to "Rainer Klute". Any former author value will
* be lost. If there has been no author yet, it will be created. */
si.setAuthor("Rainer Klute");
System.out.println("Author changed to " + si.getAuthor() + ".");
/* Handling the document summary information is analogous to handling
* the summary information. An additional feature, however, are the
* custom properties. */
/* Read the document summary information. */
DocumentSummaryInformation dsi;
try
{
dsi = (DocumentSummaryInformation)PropertySetFactory.create(
dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);
}
catch (FileNotFoundException ex)
{
/* There is no document summary information yet. We have to create a
* new one. */
dsi = PropertySetFactory.newDocumentSummaryInformation();
}
/* Change the category to "POI example". Any former category value will
* be lost. If there has been no category yet, it will be created. */
dsi.setCategory("POI example");
System.out.println("Category changed to " + dsi.getCategory() + ".");
/* Read the custom properties. If there are no custom properties yet,
* the application has to create a new CustomProperties object. It will
* serve as a container for custom properties. */
CustomProperties customProperties = dsi.getCustomProperties();
if (customProperties == null)
customProperties = new CustomProperties();
/* Insert some custom properties into the container. */
customProperties.put("Key 1", "Value 1");
customProperties.put("Schl\u00fcssel 2", "Wert 2");
customProperties.put("Sample Number", new Integer(12345));
customProperties.put("Sample Boolean", Boolean.TRUE);
customProperties.put("Sample Date", new Date());
/* Read a custom property. */
Object value = customProperties.get("Sample Number");
System.out.println("Custom Sample Number is now " + value);
/* Write the custom properties back to the document summary
* information. */
dsi.setCustomProperties(customProperties);
/* Write the summary information and the document summary information
* to the POI filesystem. */
si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);
dsi.write(dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);
/* Write the POI filesystem back to the original file. Please note that
* in production code you should take care when write directly to the
* origin, to make sure you don't loose things on error */
poifs.writeFilesystem();
poifs.close();
}
}

View File

@ -17,9 +17,8 @@
package org.apache.poi.hpsf.examples;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.apache.poi.hpsf.NoPropertySetStreamException;
@ -38,8 +37,9 @@ import org.apache.poi.util.HexDump;
*
* <p>Explanations can be found in the HPSF HOW-TO.</p>
*/
public class ReadCustomPropertySets
{
public final class ReadCustomPropertySets {
private ReadCustomPropertySets() {}
/**
* <p>Runs the example program.</p>
@ -55,7 +55,7 @@ public class ReadCustomPropertySets
/* Register a listener for *all* documents. */
r.registerListener(new MyPOIFSReaderListener());
r.read(new FileInputStream(filename));
r.read(new File(filename));
}
@ -64,7 +64,7 @@ public class ReadCustomPropertySets
@Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
PropertySet ps = null;
PropertySet ps;
try
{
ps = PropertySetFactory.create(event.getStream());
@ -93,10 +93,8 @@ public class ReadCustomPropertySets
/* Print the list of sections: */
List<Section> sections = ps.getSections();
int nr = 0;
for (Iterator<Section> i = sections.iterator(); i.hasNext();)
{
for (Section sec : sections) {
/* Print a single section: */
Section sec = i.next();
out(" Section " + nr++ + ":");
String s = hex(sec.getFormatID().getBytes());
s = s.substring(0, s.length() - 1);
@ -108,26 +106,24 @@ public class ReadCustomPropertySets
/* Print the properties: */
Property[] properties = sec.getProperties();
for (int i2 = 0; i2 < properties.length; i2++)
{
for (Property p : properties) {
/* Print a single property: */
Property p = properties[i2];
long id = p.getID();
long type = p.getType();
Object value = p.getValue();
out(" Property ID: " + id + ", type: " + type +
", value: " + value);
", value: " + value);
}
}
}
}
static void out(final String msg)
private static void out(final String msg)
{
System.out.println(msg);
}
static String hex(final byte[] bytes)
private static String hex(final byte[] bytes)
{
return HexDump.dump(bytes, 0L, 0);
}

View File

@ -17,7 +17,7 @@
package org.apache.poi.hpsf.examples;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import org.apache.poi.hpsf.PropertySetFactory;
@ -33,8 +33,10 @@ import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
*
* <p>Explanations can be found in the HPSF HOW-TO.</p>
*/
public class ReadTitle
public final class ReadTitle
{
private ReadTitle() {}
/**
* <p>Runs the example program.</p>
*
@ -46,9 +48,8 @@ public class ReadTitle
{
final String filename = args[0];
POIFSReader r = new POIFSReader();
r.registerListener(new MyPOIFSReaderListener(),
"\005SummaryInformation");
r.read(new FileInputStream(filename));
r.registerListener(new MyPOIFSReaderListener(), SummaryInformation.DEFAULT_STREAM_NAME);
r.read(new File(filename));
}
@ -57,7 +58,7 @@ public class ReadTitle
@Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
SummaryInformation si = null;
SummaryInformation si;
try
{
si = (SummaryInformation)

View File

@ -19,8 +19,7 @@ package org.apache.poi.hpsf.examples;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -30,13 +29,11 @@ import java.util.Map;
import org.apache.poi.hpsf.HPSFRuntimeException;
import org.apache.poi.hpsf.MarkUnsupportedException;
import org.apache.poi.hpsf.MutablePropertySet;
import org.apache.poi.hpsf.MutableSection;
import org.apache.poi.hpsf.NoPropertySetStreamException;
import org.apache.poi.hpsf.PropertySet;
import org.apache.poi.hpsf.PropertySetFactory;
import org.apache.poi.hpsf.Section;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.Util;
import org.apache.poi.hpsf.Variant;
import org.apache.poi.hpsf.WritingNotSupportedException;
import org.apache.poi.hpsf.wellknown.PropertyIDMap;
@ -82,8 +79,9 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
*
* <p>Further explanations can be found in the HPSF HOW-TO.</p>
*/
public class WriteAuthorAndTitle
{
public final class WriteAuthorAndTitle {
private WriteAuthorAndTitle() {}
/**
* <p>Runs the example program.</p>
*
@ -111,10 +109,8 @@ public class WriteAuthorAndTitle
final POIFSReader r = new POIFSReader();
final ModifySICopyTheRest msrl = new ModifySICopyTheRest(dstName);
r.registerListener(msrl);
FileInputStream fis = new FileInputStream(srcName);
r.read(fis);
fis.close();
r.read(new File(srcName));
/* Write the new POIFS to disk. */
msrl.close();
}
@ -137,14 +133,14 @@ public class WriteAuthorAndTitle
/**
* <p>The constructor of a {@link ModifySICopyTheRest} instance creates
* The constructor of a {@link ModifySICopyTheRest} instance creates
* the target POIFS. It also stores the name of the file the POIFS will
* be written to once it is complete.</p>
* be written to once it is complete.
*
* @param dstName The name of the disk file the destination POIFS is to
* be written to.
*/
public ModifySICopyTheRest(final String dstName)
ModifySICopyTheRest(final String dstName)
{
this.dstName = dstName;
poiFs = new POIFSFileSystem();
@ -152,8 +148,8 @@ public class WriteAuthorAndTitle
/**
* <p>The method is called by POI's eventing API for each file in the
* origin POIFS.</p>
* The method is called by POI's eventing API for each file in the
* origin POIFS.
*/
@Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
@ -197,23 +193,17 @@ public class WriteAuthorAndTitle
* copy it unmodified to the destination POIFS. */
copy(poiFs, event.getPath(), event.getName(), stream);
}
} catch (MarkUnsupportedException ex) {
t = ex;
} catch (IOException ex) {
t = ex;
} catch (WritingNotSupportedException ex) {
} catch (MarkUnsupportedException | WritingNotSupportedException | IOException ex) {
t = ex;
}
/* According to the definition of the processPOIFSReaderEvent method
* we cannot pass checked exceptions to the caller. The following
* lines check whether a checked exception occured and throws an
* lines check whether a checked exception occurred and throws an
* unchecked exception. The message of that exception is that of
* the underlying checked exception. */
if (t != null) {
throw new HPSFRuntimeException
("Could not read file \"" + path + "/" + name +
"\". Reason: " + Util.toString(t));
throw new HPSFRuntimeException("Could not read file \"" + path + "/" + name, t);
}
}
@ -228,10 +218,8 @@ public class WriteAuthorAndTitle
* @param name The original (and destination) stream's name.
* @param si The property set. It should be a summary information
* property set.
* @throws IOException
* @throws WritingNotSupportedException
*/
public void editSI(final POIFSFileSystem poiFs,
void editSI(final POIFSFileSystem poiFs,
final POIFSDocumentPath path,
final String name,
final PropertySet si)
@ -243,12 +231,11 @@ public class WriteAuthorAndTitle
/* Create a mutable property set as a copy of the original read-only
* property set. */
final MutablePropertySet mps = new MutablePropertySet(si);
final PropertySet mps = new PropertySet(si);
/* Retrieve the section containing the properties to modify. A
* summary information property set contains exactly one section. */
final MutableSection s =
(MutableSection) mps.getSections().get(0);
final Section s = mps.getSections().get(0);
/* Set the properties. */
s.setProperty(PropertyIDMap.PID_AUTHOR, Variant.VT_LPSTR,
@ -274,8 +261,6 @@ public class WriteAuthorAndTitle
* @param path The file's path in the POI filesystem.
* @param name The file's name in the POI filesystem.
* @param ps The property set to write.
* @throws WritingNotSupportedException
* @throws IOException
*/
public void copy(final POIFSFileSystem poiFs,
final POIFSDocumentPath path,
@ -284,7 +269,7 @@ public class WriteAuthorAndTitle
throws WritingNotSupportedException, IOException
{
final DirectoryEntry de = getPath(poiFs, path);
final MutablePropertySet mps = new MutablePropertySet(ps);
final PropertySet mps = new PropertySet(ps);
de.createDocument(name, mps.toInputStream());
}
@ -298,7 +283,6 @@ public class WriteAuthorAndTitle
* @param path The source document's path.
* @param name The source document's name.
* @param stream The stream containing the source document.
* @throws IOException
*/
public void copy(final POIFSFileSystem poiFs,
final POIFSDocumentPath path,
@ -319,12 +303,9 @@ public class WriteAuthorAndTitle
/**
* <p>Writes the POI file system to a disk file.</p>
*
* @throws FileNotFoundException
* @throws IOException
* Writes the POI file system to a disk file.
*/
public void close() throws FileNotFoundException, IOException
public void close() throws IOException
{
out = new FileOutputStream(dstName);
poiFs.writeFilesystem(out);
@ -336,7 +317,7 @@ public class WriteAuthorAndTitle
/** Contains the directory paths that have already been created in the
* output POI filesystem and maps them to their corresponding
* {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */
private final Map<String, DirectoryEntry> paths = new HashMap<String, DirectoryEntry>();
private final Map<String, DirectoryEntry> paths = new HashMap<>();

View File

@ -21,14 +21,13 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.hpsf.MutableProperty;
import org.apache.poi.hpsf.MutablePropertySet;
import org.apache.poi.hpsf.MutableSection;
import org.apache.poi.hpsf.Property;
import org.apache.poi.hpsf.PropertySet;
import org.apache.poi.hpsf.Section;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.Variant;
import org.apache.poi.hpsf.WritingNotSupportedException;
import org.apache.poi.hpsf.wellknown.PropertyIDMap;
import org.apache.poi.hpsf.wellknown.SectionIDMap;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
/**
@ -61,18 +60,18 @@ public class WriteTitle
/* Create a mutable property set. Initially it contains a single section
* with no properties. */
final MutablePropertySet mps = new MutablePropertySet();
final PropertySet mps = new PropertySet();
/* Retrieve the section the property set already contains. */
final MutableSection ms = (MutableSection) mps.getSections().get(0);
final Section ms = mps.getSections().get(0);
/* Turn the property set into a summary information property. This is
* done by setting the format ID of its first section to
* SectionIDMap.SUMMARY_INFORMATION_ID. */
ms.setFormatID(SectionIDMap.SUMMARY_INFORMATION_ID);
ms.setFormatID(SummaryInformation.FORMAT_ID);
/* Create an empty property. */
final MutableProperty p = new MutableProperty();
final Property p = new Property();
/* Fill the property with appropriate settings so that it specifies the
* document's title. */
@ -84,23 +83,21 @@ public class WriteTitle
ms.setProperty(p);
/* Create the POI file system the property set is to be written to. */
final POIFSFileSystem poiFs = new POIFSFileSystem();
try (final POIFSFileSystem poiFs = new POIFSFileSystem()) {
/* For writing the property set into a POI file system it has to be
* handed over to the POIFS.createDocument() method as an input stream
* which produces the bytes making out the property set stream. */
final InputStream is = mps.toInputStream();
/* For writing the property set into a POI file system it has to be
* handed over to the POIFS.createDocument() method as an input stream
* which produces the bytes making out the property set stream. */
final InputStream is = mps.toInputStream();
/* Create the summary information property set in the POI file
* system. It is given the default name most (if not all) summary
* information property sets have. */
poiFs.createDocument(is, SummaryInformation.DEFAULT_STREAM_NAME);
/* Create the summary information property set in the POI file
* system. It is given the default name most (if not all) summary
* information property sets have. */
poiFs.createDocument(is, SummaryInformation.DEFAULT_STREAM_NAME);
/* Write the whole POI file system to a disk file. */
FileOutputStream fos = new FileOutputStream(fileName);
poiFs.writeFilesystem(fos);
fos.close();
poiFs.close();
/* Write the whole POI file system to a disk file. */
try (FileOutputStream fos = new FileOutputStream(fileName)) {
poiFs.writeFilesystem(fos);
}
}
}
}

View File

@ -51,28 +51,28 @@ import org.apache.poi.sl.usermodel.VerticalAlignment;
public final class ApacheconEU08 {
public static void main(String[] args) throws IOException {
SlideShow<?,?> ppt = new HSLFSlideShow();
// SlideShow<?,?> ppt = new XMLSlideShow();
ppt.setPageSize(new Dimension(720, 540));
try (SlideShow<?,?> ppt = new HSLFSlideShow()) {
// SlideShow<?,?> ppt = new XMLSlideShow();
ppt.setPageSize(new Dimension(720, 540));
slide1(ppt);
slide2(ppt);
slide3(ppt);
slide4(ppt);
slide5(ppt);
slide6(ppt);
slide7(ppt);
slide8(ppt);
slide9(ppt);
slide10(ppt);
slide11(ppt);
slide12(ppt);
slide1(ppt);
slide2(ppt);
slide3(ppt);
slide4(ppt);
slide5(ppt);
slide6(ppt);
slide7(ppt);
slide8(ppt);
slide9(ppt);
slide10(ppt);
slide11(ppt);
slide12(ppt);
String ext = ppt.getClass().getName().contains("HSLF") ? "ppt" : "pptx";
FileOutputStream out = new FileOutputStream("apachecon_eu_08."+ext);
ppt.write(out);
out.close();
ppt.close();
String ext = ppt.getClass().getName().contains("HSLF") ? "ppt" : "pptx";
try (FileOutputStream out = new FileOutputStream("apachecon_eu_08." + ext)) {
ppt.write(out);
}
}
}
public static void slide1(SlideShow<?,?> ppt) throws IOException {

View File

@ -32,32 +32,29 @@ import org.apache.poi.hslf.usermodel.HSLFTextParagraph;
public final class BulletsDemo {
public static void main(String[] args) throws IOException {
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
HSLFSlide slide = ppt.createSlide();
HSLFSlideShow ppt = new HSLFSlideShow();
HSLFTextBox shape = new HSLFTextBox();
HSLFTextParagraph rt = shape.getTextParagraphs().get(0);
rt.getTextRuns().get(0).setFontSize(42d);
rt.setBullet(true);
rt.setIndent(0d); //bullet offset
rt.setLeftMargin(50d); //text offset (should be greater than bullet offset)
rt.setBulletChar('\u263A'); //bullet character
shape.setText(
"January\r" +
"February\r" +
"March\r" +
"April");
slide.addShape(shape);
HSLFSlide slide = ppt.createSlide();
shape.setAnchor(new java.awt.Rectangle(50, 50, 500, 300)); //position of the text box in the slide
slide.addShape(shape);
HSLFTextBox shape = new HSLFTextBox();
HSLFTextParagraph rt = shape.getTextParagraphs().get(0);
rt.getTextRuns().get(0).setFontSize(42d);
rt.setBullet(true);
rt.setIndent(0d); //bullet offset
rt.setLeftMargin(50d); //text offset (should be greater than bullet offset)
rt.setBulletChar('\u263A'); //bullet character
shape.setText(
"January\r" +
"February\r" +
"March\r" +
"April");
slide.addShape(shape);
shape.setAnchor(new java.awt.Rectangle(50, 50, 500, 300)); //position of the text box in the slide
slide.addShape(shape);
FileOutputStream out = new FileOutputStream("bullets.ppt");
ppt.write(out);
out.close();
ppt.close();
try (FileOutputStream out = new FileOutputStream("bullets.ppt")) {
ppt.write(out);
}
}
}
}

View File

@ -32,33 +32,31 @@ import org.apache.poi.hslf.usermodel.HSLFTextBox;
public abstract class CreateHyperlink {
public static void main(String[] args) throws IOException {
HSLFSlideShow ppt = new HSLFSlideShow();
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
HSLFSlide slideA = ppt.createSlide();
ppt.createSlide();
HSLFSlide slideC = ppt.createSlide();
HSLFSlide slideA = ppt.createSlide();
ppt.createSlide();
HSLFSlide slideC = ppt.createSlide();
// link to a URL
HSLFTextBox textBox1 = slideA.createTextBox();
textBox1.setText("Apache POI");
textBox1.setAnchor(new Rectangle(100, 100, 200, 50));
// link to a URL
HSLFTextBox textBox1 = slideA.createTextBox();
textBox1.setText("Apache POI");
textBox1.setAnchor(new Rectangle(100, 100, 200, 50));
HSLFHyperlink link1 = textBox1.getTextParagraphs().get(0).getTextRuns().get(0).createHyperlink();
link1.linkToUrl("http://www.apache.org");
link1.setLabel(textBox1.getText());
HSLFHyperlink link1 = textBox1.getTextParagraphs().get(0).getTextRuns().get(0).createHyperlink();
link1.linkToUrl("http://www.apache.org");
link1.setLabel(textBox1.getText());
// link to another slide
HSLFTextBox textBox2 = slideA.createTextBox();
textBox2.setText("Go to slide #3");
textBox2.setAnchor(new Rectangle(100, 300, 200, 50));
// link to another slide
HSLFTextBox textBox2 = slideA.createTextBox();
textBox2.setText("Go to slide #3");
textBox2.setAnchor(new Rectangle(100, 300, 200, 50));
HSLFHyperlink link2 = textBox2.getTextParagraphs().get(0).getTextRuns().get(0).createHyperlink();
link2.linkToSlide(slideC);
HSLFHyperlink link2 = textBox2.getTextParagraphs().get(0).getTextRuns().get(0).createHyperlink();
link2.linkToSlide(slideC);
FileOutputStream out = new FileOutputStream("hyperlink.ppt");
ppt.write(out);
out.close();
ppt.close();
try (FileOutputStream out = new FileOutputStream("hyperlink.ppt")) {
ppt.write(out);
}
}
}
}

View File

@ -21,8 +21,8 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import org.apache.poi.hslf.model.OLEShape;
import org.apache.poi.hslf.usermodel.HSLFObjectData;
import org.apache.poi.hslf.usermodel.HSLFObjectShape;
import org.apache.poi.hslf.usermodel.HSLFPictureData;
import org.apache.poi.hslf.usermodel.HSLFPictureShape;
import org.apache.poi.hslf.usermodel.HSLFShape;
@ -52,10 +52,10 @@ public final class DataExtraction {
//extract all sound files embedded in this presentation
HSLFSoundData[] sound = ppt.getSoundData();
for (int i = 0; i < sound.length; i++) {
String type = sound[i].getSoundType(); //*.wav
String name = sound[i].getSoundName(); //typically file name
byte[] data = sound[i].getData(); //raw bytes
for (HSLFSoundData aSound : sound) {
String type = aSound.getSoundType(); //*.wav
String name = aSound.getSoundName(); //typically file name
byte[] data = aSound.getData(); //raw bytes
//save the sound on disk
FileOutputStream out = new FileOutputStream(name + type);
@ -67,19 +67,19 @@ public final class DataExtraction {
for (HSLFSlide slide : ppt.getSlides()) {
//extract embedded OLE documents
for (HSLFShape shape : slide.getShapes()) {
if (shape instanceof OLEShape) {
if (shape instanceof HSLFObjectShape) {
oleIdx++;
OLEShape ole = (OLEShape) shape;
HSLFObjectShape ole = (HSLFObjectShape) shape;
HSLFObjectData data = ole.getObjectData();
String name = ole.getInstanceName();
if ("Worksheet".equals(name)) {
//read xls
@SuppressWarnings({ "unused", "resource" })
HSSFWorkbook wb = new HSSFWorkbook(data.getData());
HSSFWorkbook wb = new HSSFWorkbook(data.getInputStream());
} else if ("Document".equals(name)) {
HWPFDocument doc = new HWPFDocument(data.getData());
HWPFDocument doc = new HWPFDocument(data.getInputStream());
//read the word document
Range r = doc.getRange();
for(int k = 0; k < r.numParagraphs(); k++) {
@ -93,8 +93,8 @@ public final class DataExtraction {
out.close();
doc.close();
} else {
FileOutputStream out = new FileOutputStream(ole.getProgID() + "-"+(oleIdx+1)+".dat");
InputStream dis = data.getData();
FileOutputStream out = new FileOutputStream(ole.getProgId() + "-"+(oleIdx+1)+".dat");
InputStream dis = data.getInputStream();
byte[] chunk = new byte[2048];
int count;
while ((count = dis.read(chunk)) >= 0) {

View File

@ -39,47 +39,45 @@ public final class Graphics2DDemo {
* A simple bar chart demo
*/
public static void main(String[] args) throws Exception {
HSLFSlideShow ppt = new HSLFSlideShow();
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
//bar chart data. The first value is the bar color, the second is the width
Object[] def = new Object[]{
Color.yellow, 40,
Color.green, 60,
Color.gray, 30,
Color.red, 80,
};
//bar chart data. The first value is the bar color, the second is the width
Object[] def = new Object[]{
Color.yellow, 40,
Color.green, 60,
Color.gray, 30,
Color.red, 80,
};
HSLFSlide slide = ppt.createSlide();
HSLFSlide slide = ppt.createSlide();
HSLFGroupShape group = new HSLFGroupShape();
//define position of the drawing in the slide
Rectangle bounds = new Rectangle(200, 100, 350, 300);
group.setAnchor(bounds);
group.setInteriorAnchor(new Rectangle(0, 0, 100, 100));
slide.addShape(group);
Graphics2D graphics = new PPGraphics2D(group);
HSLFGroupShape group = new HSLFGroupShape();
//define position of the drawing in the slide
Rectangle bounds = new java.awt.Rectangle(200, 100, 350, 300);
group.setAnchor(bounds);
group.setInteriorAnchor(new java.awt.Rectangle(0, 0, 100, 100));
slide.addShape(group);
Graphics2D graphics = new PPGraphics2D(group);
//draw a simple bar graph
int x = 10, y = 10;
graphics.setFont(new Font("Arial", Font.BOLD, 10));
for (int i = 0, idx = 1; i < def.length; i+=2, idx++) {
//draw a simple bar graph
int x = 10, y = 10;
graphics.setFont(new Font("Arial", Font.BOLD, 10));
for (int i = 0, idx = 1; i < def.length; i += 2, idx++) {
graphics.setColor(Color.black);
int width = ((Integer) def[i + 1]).intValue();
graphics.drawString("Q" + idx, x - 5, y + 10);
graphics.drawString(width + "%", x + width + 3, y + 10);
graphics.setColor((Color) def[i]);
graphics.fill(new Rectangle(x, y, width, 10));
y += 15;
}
graphics.setColor(Color.black);
int width = ((Integer)def[i+1]).intValue();
graphics.drawString("Q" + idx, x-5, y+10);
graphics.drawString(width + "%", x + width+3, y + 10);
graphics.setColor((Color)def[i]);
graphics.fill(new Rectangle(x, y, width, 10));
y += 15;
graphics.setFont(new Font("Arial", Font.BOLD, 14));
graphics.draw(group.getInteriorAnchor());
graphics.drawString("Performance", x + 30, y + 10);
try (FileOutputStream out = new FileOutputStream("hslf-graphics.ppt")) {
ppt.write(out);
}
}
graphics.setColor(Color.black);
graphics.setFont(new Font("Arial", Font.BOLD, 14));
graphics.draw(group.getInteriorAnchor());
graphics.drawString("Performance", x + 30, y + 10);
FileOutputStream out = new FileOutputStream("hslf-graphics.ppt");
ppt.write(out);
out.close();
ppt.close();
}
}

View File

@ -27,24 +27,22 @@ import org.apache.poi.hslf.usermodel.HSLFSlideShow;
*/
public abstract class HeadersFootersDemo {
public static void main(String[] args) throws IOException {
HSLFSlideShow ppt = new HSLFSlideShow();
HeadersFooters slideHeaders = ppt.getSlideHeadersFooters();
slideHeaders.setFootersText("Created by POI-HSLF");
slideHeaders.setSlideNumberVisible(true);
slideHeaders.setDateTimeText("custom date time");
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
HeadersFooters slideHeaders = ppt.getSlideHeadersFooters();
slideHeaders.setFootersText("Created by POI-HSLF");
slideHeaders.setSlideNumberVisible(true);
slideHeaders.setDateTimeText("custom date time");
HeadersFooters notesHeaders = ppt.getNotesHeadersFooters();
notesHeaders.setFootersText("My notes footers");
notesHeaders.setHeaderText("My notes header");
HeadersFooters notesHeaders = ppt.getNotesHeadersFooters();
notesHeaders.setFootersText("My notes footers");
notesHeaders.setHeaderText("My notes header");
ppt.createSlide();
ppt.createSlide();
FileOutputStream out = new FileOutputStream("headers_footers.ppt");
ppt.write(out);
out.close();
ppt.close();
try (FileOutputStream out = new FileOutputStream("headers_footers.ppt")) {
ppt.write(out);
}
}
}
}

View File

@ -37,8 +37,8 @@ import org.apache.poi.hslf.usermodel.HSLFTextRun;
public final class Hyperlinks {
public static void main(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
FileInputStream is = new FileInputStream(args[i]);
for (String arg : args) {
FileInputStream is = new FileInputStream(arg);
HSLFSlideShow ppt = new HSLFSlideShow(is);
is.close();
@ -64,7 +64,7 @@ public final class Hyperlinks {
System.out.println("- reading hyperlinks from the slide's shapes");
for (HSLFShape sh : slide.getShapes()) {
if (sh instanceof HSLFSimpleShape) {
HSLFHyperlink link = ((HSLFSimpleShape)sh).getHyperlink();
HSLFHyperlink link = ((HSLFSimpleShape) sh).getHyperlink();
if (link != null) {
System.out.println(toStr(link, null));
}

View File

@ -30,23 +30,23 @@ import org.apache.poi.hslf.usermodel.HSLFSoundData;
*/
public class SoundFinder {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream(args[0]);
HSLFSlideShow ppt = new HSLFSlideShow(fis);
HSLFSoundData[] sounds = ppt.getSoundData();
try (FileInputStream fis = new FileInputStream(args[0])) {
try (HSLFSlideShow ppt = new HSLFSlideShow(fis)) {
HSLFSoundData[] sounds = ppt.getSoundData();
for (HSLFSlide slide : ppt.getSlides()) {
for (HSLFShape shape : slide.getShapes()) {
int soundRef = getSoundReference(shape);
if(soundRef == -1) continue;
for (HSLFSlide slide : ppt.getSlides()) {
for (HSLFShape shape : slide.getShapes()) {
int soundRef = getSoundReference(shape);
if (soundRef == -1) continue;
System.out.println("Slide["+slide.getSlideNumber()+"], shape["+shape.getShapeId()+"], soundRef: "+soundRef);
System.out.println(" " + sounds[soundRef].getSoundName());
System.out.println(" " + sounds[soundRef].getSoundType());
System.out.println("Slide[" + slide.getSlideNumber() + "], shape[" + shape.getShapeId() + "], soundRef: " + soundRef);
System.out.println(" " + sounds[soundRef].getSoundName());
System.out.println(" " + sounds[soundRef].getSoundType());
}
}
}
}
ppt.close();
fis.close();
}
/**

View File

@ -31,27 +31,41 @@ import org.apache.poi.sl.usermodel.VerticalAlignment;
/**
* Demonstrates how to create tables
*
* @author Yegor Kozlov
*/
public final class TableDemo {
//test data for the first table
static final String[][] txt1 = {
{"INPUT FILE", "NUMBER OF RECORDS"},
{"Item File", "11,559"},
{"Vendor File", "502"},
{"Purchase History File - # of PO\u2019s\r(12/01/04 - 05/31/06)", "12,852"},
{"Purchase History File - # of PO Lines\r(12/01/04 - 05/31/06)", "53,523" },
{"Total PO History Spend", "$10,172,038"}
};
//test data for the second taable
static final String[][] txt2 = {
{"Data Source"},
{"CAS Internal Metrics - Item Master Summary\r" +
"CAS Internal Metrics - Vendor Summary\r" +
"CAS Internal Metrics - PO History Summary"}
};
public static void main(String[] args) throws Exception {
try (HSLFSlideShow ppt = new HSLFSlideShow()) {
HSLFSlide slide = ppt.createSlide();
create1stTable(slide);
create2ndTable(slide);
//test data for the first taable
String[][] txt1 = {
{"INPUT FILE", "NUMBER OF RECORDS"},
{"Item File", "11,559"},
{"Vendor File", "502"},
{"Purchase History File - # of PO\u2019s\r(12/01/04 - 05/31/06)", "12,852"},
{"Purchase History File - # of PO Lines\r(12/01/04 - 05/31/06)", "53,523" },
{"Total PO History Spend", "$10,172,038"}
};
HSLFSlideShow ppt = new HSLFSlideShow();
HSLFSlide slide = ppt.createSlide();
try (FileOutputStream out = new FileOutputStream("hslf-table.ppt")) {
ppt.write(out);
}
}
}
static void create1stTable(HSLFSlide slide) {
//six rows, two columns
HSLFTable table1 = slide.createTable(6, 2);
for (int i = 0; i < txt1.length; i++) {
@ -77,17 +91,11 @@ public final class TableDemo {
table1.setColumnWidth(0, 300);
table1.setColumnWidth(1, 150);
int pgWidth = ppt.getPageSize().width;
int pgWidth = slide.getSlideShow().getPageSize().width;
table1.moveTo((pgWidth - table1.getAnchor().getWidth())/2., 100.);
}
//test data for the second taable
String[][] txt2 = {
{"Data Source"},
{"CAS Internal Metrics - Item Master Summary\r" +
"CAS Internal Metrics - Vendor Summary\r" +
"CAS Internal Metrics - PO History Summary"}
};
static void create2ndTable(HSLFSlide slide) {
//two rows, one column
HSLFTable table2 = slide.createTable(2, 1);
for (int i = 0; i < txt2.length; i++) {
@ -120,11 +128,5 @@ public final class TableDemo {
dts2.setOutsideBorders(Color.black, 1.0);
table2.moveTo(200, 400);
FileOutputStream out = new FileOutputStream("hslf-table.ppt");
ppt.write(out);
out.close();
ppt.close();
}
}

View File

@ -157,12 +157,12 @@ public class Msg2txt {
if(args.length <= 0) {
System.err.println("No files names provided");
} else {
for(int i = 0; i < args.length; i++) {
for (String arg : args) {
try {
Msg2txt processor = new Msg2txt(args[i]);
Msg2txt processor = new Msg2txt(arg);
processor.processMessage();
} catch (IOException e) {
System.err.println("Could not process "+args[i]+": "+e);
System.err.println("Could not process " + arg + ": " + e);
}
}
}

View File

@ -76,7 +76,7 @@ public class XLS2CSVmra implements HSSFListener {
/** So we known which sheet we're on */
private int sheetIndex = -1;
private BoundSheetRecord[] orderedBSRs;
private List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>();
private List<BoundSheetRecord> boundSheetRecords = new ArrayList<>();
// For handling formulas with string results
private int nextRow;
@ -99,8 +99,6 @@ public class XLS2CSVmra implements HSSFListener {
* Creates a new XLS -> CSV converter
* @param filename The file to process
* @param minColumns The minimum number of columns to output, or -1 for no minimum
* @throws IOException
* @throws FileNotFoundException
*/
public XLS2CSVmra(String filename, int minColumns) throws IOException, FileNotFoundException {
this(

View File

@ -142,13 +142,13 @@ import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType;
public class AddDimensionedImage {
// Four constants that determine how - and indeed whether - the rows
// and columns an image may overlie should be expanded to accomodate that
// and columns an image may overlie should be expanded to accommodate that
// image.
// Passing EXPAND_ROW will result in the height of a row being increased
// to accomodate the image if it is not already larger. The image will
// to accommodate the image if it is not already larger. The image will
// be layed across one or more columns.
// Passing EXPAND_COLUMN will result in the width of the column being
// increased to accomodate the image if it is not already larger. The image
// increased to accommodate the image if it is not already larger. The image
// will be layed across one or many rows.
// Passing EXPAND_ROW_AND_COLUMN will result in the height of the row
// bing increased along with the width of the column to accomdate the
@ -251,10 +251,10 @@ public class AddDimensionedImage {
String imageFile, double reqImageWidthMM, double reqImageHeightMM,
int resizeBehaviour) throws FileNotFoundException, IOException,
IllegalArgumentException {
HSSFClientAnchor anchor = null;
HSSFPatriarch patriarch = null;
ClientAnchorDetail rowClientAnchorDetail = null;
ClientAnchorDetail colClientAnchorDetail = null;
HSSFClientAnchor anchor;
HSSFPatriarch patriarch;
ClientAnchorDetail rowClientAnchorDetail;
ClientAnchorDetail colClientAnchorDetail;
// Validate the resizeBehaviour parameter.
if((resizeBehaviour != AddDimensionedImage.EXPAND_COLUMN) &&
@ -266,7 +266,7 @@ public class AddDimensionedImage {
}
// Call methods to calculate how the image and sheet should be
// manipulated to accomodate the image; columns and then rows.
// manipulated to accommodate the image; columns and then rows.
colClientAnchorDetail = this.fitImageToColumns(sheet, colNumber,
reqImageWidthMM, resizeBehaviour);
rowClientAnchorDetail = this.fitImageToRows(sheet, rowNumber,
@ -279,14 +279,19 @@ public class AddDimensionedImage {
// The first two parameters are not used currently but could be if the
// need arose to extend the functionality of this code by adding the
// ability to specify that a clear 'border' be placed around the image.
anchor = new HSSFClientAnchor(0,
0,
colClientAnchorDetail.getInset(),
rowClientAnchorDetail.getInset(),
(short)colClientAnchorDetail.getFromIndex(),
rowClientAnchorDetail.getFromIndex(),
(short)colClientAnchorDetail.getToIndex(),
rowClientAnchorDetail.getToIndex());
int dx1 = 0, dy1 = 0, dx2 = 0, dy2 = 0;
short col1 = 0, col2 = 0, row1 = 0, row2 = 0;
if (colClientAnchorDetail != null) {
dx2 = colClientAnchorDetail.getInset();
col1 = (short)colClientAnchorDetail.getFromIndex();
col2 = (short)colClientAnchorDetail.getToIndex();
}
if (rowClientAnchorDetail != null) {
dy2 = rowClientAnchorDetail.getInset();
row1 = (short)rowClientAnchorDetail.getFromIndex();
row2 = (short)rowClientAnchorDetail.getToIndex();
}
anchor = new HSSFClientAnchor(dx1, dy1, dx2, dy2, col1, row1, col2, row2);
// For now, set the anchor type to do not move or resize the
// image as the size of the row/column is adjusted. This could easilly
@ -307,7 +312,7 @@ public class AddDimensionedImage {
}
/**
* Determines whether the sheets columns should be re-sized to accomodate
* Determines whether the sheets columns should be re-sized to accommodate
* the image, adjusts the columns width if necessary and creates then
* returns a ClientAnchorDetail object that facilitates construction of
* an HSSFClientAnchor that will fix the image on the sheet and establish
@ -334,16 +339,16 @@ public class AddDimensionedImage {
private ClientAnchorDetail fitImageToColumns(HSSFSheet sheet, int colNumber,
double reqImageWidthMM, int resizeBehaviour) {
double colWidthMM = 0.0D;
double colCoordinatesPerMM = 0.0D;
int pictureWidthCoordinates = 0;
double colWidthMM;
double colCoordinatesPerMM;
int pictureWidthCoordinates;
ClientAnchorDetail colClientAnchorDetail = null;
// Get the colum's width in millimetres
colWidthMM = ConvertImageUnits.widthUnits2Millimetres(
(short)sheet.getColumnWidth(colNumber));
// Check that the column's width will accomodate the image at the
// Check that the column's width will accommodate the image at the
// required dimension. If the width of the column is LESS than the
// required width of the image, decide how the application should
// respond - resize the column or overlay the image across one or more
@ -391,7 +396,7 @@ public class AddDimensionedImage {
}
/**
* Determines whether the sheet's row should be re-sized to accomodate
* Determines whether the sheet's row should be re-sized to accommodate
* the image, adjusts the rows height if necessary and creates then
* returns a ClientAnchorDetail object that facilitates construction of
* an HSSFClientAnchor that will fix the image on the sheet and establish
@ -417,23 +422,21 @@ public class AddDimensionedImage {
*/
private ClientAnchorDetail fitImageToRows(HSSFSheet sheet, int rowNumber,
double reqImageHeightMM, int resizeBehaviour) {
HSSFRow row = null;
double rowHeightMM = 0.0D;
double rowCoordinatesPerMM = 0.0D;
int pictureHeightCoordinates = 0;
double rowCoordinatesPerMM;
int pictureHeightCoordinates;
ClientAnchorDetail rowClientAnchorDetail = null;
// Get the row and it's height
row = sheet.getRow(rowNumber);
HSSFRow row = sheet.getRow(rowNumber);
if(row == null) {
// Create row if it does not exist.
row = sheet.createRow(rowNumber);
}
// Get the row's height in millimetres
rowHeightMM = row.getHeightInPoints() / ConvertImageUnits.POINTS_PER_MILLIMETRE;
double rowHeightMM = row.getHeightInPoints() / ConvertImageUnits.POINTS_PER_MILLIMETRE;
// Check that the row's height will accomodate the image at the required
// Check that the row's height will accommodate the image at the required
// dimensions. If the height of the row is LESS than the required height
// of the image, decide how the application should respond - resize the
// row or overlay the image across a series of rows.
@ -494,13 +497,13 @@ public class AddDimensionedImage {
private ClientAnchorDetail calculateColumnLocation(HSSFSheet sheet,
int startingColumn,
double reqImageWidthMM) {
ClientAnchorDetail anchorDetail = null;
ClientAnchorDetail anchorDetail;
double totalWidthMM = 0.0D;
double colWidthMM = 0.0D;
double overlapMM = 0.0D;
double coordinatePositionsPerMM = 0.0D;
double overlapMM;
double coordinatePositionsPerMM;
int toColumn = startingColumn;
int inset = 0;
int inset;
// Calculate how many columns the image will have to
// span in order to be presented at the required size.
@ -593,14 +596,14 @@ public class AddDimensionedImage {
*/
private ClientAnchorDetail calculateRowLocation(HSSFSheet sheet,
int startingRow, double reqImageHeightMM) {
ClientAnchorDetail clientAnchorDetail = null;
HSSFRow row = null;
ClientAnchorDetail clientAnchorDetail;
HSSFRow row;
double rowHeightMM = 0.0D;
double totalRowHeightMM = 0.0D;
double overlapMM = 0.0D;
double rowCoordinatesPerMM = 0.0D;
double overlapMM;
double rowCoordinatesPerMM;
int toRow = startingRow;
int inset = 0;
int inset;
// Step through the rows in the sheet and accumulate a total of their
// heights.
@ -672,10 +675,10 @@ public class AddDimensionedImage {
* interrupted.
*/
private byte[] imageToBytes(String imageFilename) throws IOException {
File imageFile = null;
File imageFile;
FileInputStream fis = null;
ByteArrayOutputStream bos = null;
int read = 0;
ByteArrayOutputStream bos;
int read;
try {
imageFile = new File(imageFilename);
fis = new FileInputStream(imageFile);
@ -718,10 +721,10 @@ public class AddDimensionedImage {
* @param args the command line arguments
*/
public static void main(String[] args) {
String imageFile = null;
String outputFile = null;
String imageFile;
String outputFile;
FileOutputStream fos = null;
HSSFSheet sheet = null;
HSSFSheet sheet;
try {
if(args.length < 2){
System.err.println("Usage: AddDimensionedImage imageFile outputFile");
@ -730,22 +733,15 @@ public class AddDimensionedImage {
imageFile = args[0];
outputFile = args[1];
HSSFWorkbook workbook = new HSSFWorkbook();
sheet = workbook.createSheet("Picture Test");
new AddDimensionedImage().addImageToSheet("A1", sheet,
imageFile, 125, 125,
AddDimensionedImage.EXPAND_ROW_AND_COLUMN);
fos = new FileOutputStream(outputFile);
workbook.write(fos);
workbook.close();
}
catch(FileNotFoundException fnfEx) {
System.out.println("Caught an: " + fnfEx.getClass().getName());
System.out.println("Message: " + fnfEx.getMessage());
System.out.println("Stacktrace follows...........");
fnfEx.printStackTrace(System.out);
}
catch(IOException ioEx) {
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
sheet = workbook.createSheet("Picture Test");
new AddDimensionedImage().addImageToSheet("A1", sheet,
imageFile, 125, 125,
AddDimensionedImage.EXPAND_ROW_AND_COLUMN);
fos = new FileOutputStream(outputFile);
workbook.write(fos);
}
} catch(IOException ioEx) {
System.out.println("Caught an: " + ioEx.getClass().getName());
System.out.println("Message: " + ioEx.getMessage());
System.out.println("Stacktrace follows...........");
@ -791,9 +787,9 @@ public class AddDimensionedImage {
*/
public class ClientAnchorDetail {
public int fromIndex = 0;
public int toIndex = 0;
public int inset = 0;
public int fromIndex;
public int toIndex;
public int inset;
/**
* Create a new instance of the ClientAnchorDetail class using the

View File

@ -36,23 +36,22 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
*/
public class Alignment {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(2);
createCell(wb, row, 0, HorizontalAlignment.CENTER);
createCell(wb, row, 1, HorizontalAlignment.CENTER_SELECTION);
createCell(wb, row, 2, HorizontalAlignment.FILL);
createCell(wb, row, 3, HorizontalAlignment.GENERAL);
createCell(wb, row, 4, HorizontalAlignment.JUSTIFY);
createCell(wb, row, 5, HorizontalAlignment.LEFT);
createCell(wb, row, 6, HorizontalAlignment.RIGHT);
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(2);
createCell(wb, row, 0, HorizontalAlignment.CENTER);
createCell(wb, row, 1, HorizontalAlignment.CENTER_SELECTION);
createCell(wb, row, 2, HorizontalAlignment.FILL);
createCell(wb, row, 3, HorizontalAlignment.GENERAL);
createCell(wb, row, 4, HorizontalAlignment.JUSTIFY);
createCell(wb, row, 5, HorizontalAlignment.LEFT);
createCell(wb, row, 6, HorizontalAlignment.RIGHT);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
/**

View File

@ -38,138 +38,133 @@ public class BigExample {
public static void main(String[] args) throws IOException {
int rownum;
// create a new file
FileOutputStream out = new FileOutputStream("workbook.xls");
// create a new workbook
HSSFWorkbook wb = new HSSFWorkbook();
// create a new sheet
HSSFSheet s = wb.createSheet();
// declare a row object reference
HSSFRow r = null;
// declare a cell object reference
HSSFCell c = null;
// create 3 cell styles
HSSFCellStyle cs = wb.createCellStyle();
HSSFCellStyle cs2 = wb.createCellStyle();
HSSFCellStyle cs3 = wb.createCellStyle();
// create 2 fonts objects
HSSFFont f = wb.createFont();
HSSFFont f2 = wb.createFont();
try (HSSFWorkbook wb = new HSSFWorkbook()) {
// create a new sheet
HSSFSheet s = wb.createSheet();
// declare a row object reference
HSSFRow r;
// declare a cell object reference
HSSFCell c;
// create 3 cell styles
HSSFCellStyle cs = wb.createCellStyle();
HSSFCellStyle cs2 = wb.createCellStyle();
HSSFCellStyle cs3 = wb.createCellStyle();
// create 2 fonts objects
HSSFFont f = wb.createFont();
HSSFFont f2 = wb.createFont();
//set font 1 to 12 point type
f.setFontHeightInPoints((short) 12);
//make it red
f.setColor(HSSFColorPredefined.RED.getIndex());
// make it bold
//arial is the default font
f.setBold(true);
//set font 1 to 12 point type
f.setFontHeightInPoints((short) 12);
//make it red
f.setColor(HSSFColorPredefined.RED.getIndex());
// make it bold
//arial is the default font
f.setBold(true);
//set font 2 to 10 point type
f2.setFontHeightInPoints((short) 10);
//make it the color at palette index 0xf (white)
f2.setColor(HSSFColorPredefined.WHITE.getIndex());
//make it bold
f2.setBold(true);
//set font 2 to 10 point type
f2.setFontHeightInPoints((short) 10);
//make it the color at palette index 0xf (white)
f2.setColor(HSSFColorPredefined.WHITE.getIndex());
//make it bold
f2.setBold(true);
//set cell stlye
cs.setFont(f);
//set the cell format see HSSFDataFromat for a full list
cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("($#,##0_);[Red]($#,##0)"));
//set cell style
cs.setFont(f);
//set the cell format see HSSFDataFormat for a full list
cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("($#,##0_);[Red]($#,##0)"));
//set a thin border
cs2.setBorderBottom(BorderStyle.THIN);
//fill w fg fill color
cs2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// set foreground fill to red
cs2.setFillForegroundColor(HSSFColorPredefined.RED.getIndex());
//set a thin border
cs2.setBorderBottom(BorderStyle.THIN);
//fill w fg fill color
cs2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// set foreground fill to red
cs2.setFillForegroundColor(HSSFColorPredefined.RED.getIndex());
// set the font
cs2.setFont(f2);
// set the font
cs2.setFont(f2);
// set the sheet name to HSSF Test
wb.setSheetName(0, "HSSF Test");
// create a sheet with 300 rows (0-299)
for (rownum = 0; rownum < 300; rownum++) {
// create a row
r = s.createRow(rownum);
// on every other row
if ((rownum % 2) == 0) {
// make the row height bigger (in twips - 1/20 of a point)
r.setHeight((short) 0x249);
}
//r.setRowNum(( short ) rownum);
// create 50 cells (0-49) (the += 2 becomes apparent later
for (int cellnum = 0; cellnum < 50; cellnum += 2) {
// create a numeric cell
c = r.createCell(cellnum);
// do some goofy math to demonstrate decimals
c.setCellValue(rownum * 10000 + cellnum
+ (((double) rownum / 1000)
+ ((double) cellnum / 10000)));
// on every other row
if ((rownum % 2) == 0) {
// set this cell to the first cell style we defined
c.setCellStyle(cs);
}
// create a string cell (see why += 2 in the
c = r.createCell(cellnum + 1);
// set the cell's string value to "TEST"
c.setCellValue("TEST");
// make this column a bit wider
s.setColumnWidth(cellnum + 1, (int) ((50 * 8) / ((double) 1 / 20)));
// on every other row
if ((rownum % 2) == 0) {
// set this to the white on red cell style
// we defined above
c.setCellStyle(cs2);
}
}
}
//draw a thick black border on the row at the bottom using BLANKS
// advance 2 rows
rownum++;
rownum++;
// set the sheet name to HSSF Test
wb.setSheetName(0, "HSSF Test");
// create a sheet with 300 rows (0-299)
for (rownum = 0; rownum < 300; rownum++)
{
// create a row
r = s.createRow(rownum);
// on every other row
if ((rownum % 2) == 0)
{
// make the row height bigger (in twips - 1/20 of a point)
r.setHeight((short) 0x249);
}
//r.setRowNum(( short ) rownum);
// create 50 cells (0-49) (the += 2 becomes apparent later
for (int cellnum = 0; cellnum < 50; cellnum += 2)
{
// create a numeric cell
// define the third style to be the default
// except with a thick black border at the bottom
cs3.setBorderBottom(BorderStyle.THICK);
//create 50 cells
for (int cellnum = 0; cellnum < 50; cellnum++) {
//create a blank type cell (no value)
c = r.createCell(cellnum);
// do some goofy math to demonstrate decimals
c.setCellValue(rownum * 10000 + cellnum
+ (((double) rownum / 1000)
+ ((double) cellnum / 10000)));
// set it to the thick black border style
c.setCellStyle(cs3);
}
// on every other row
if ((rownum % 2) == 0)
{
// set this cell to the first cell style we defined
c.setCellStyle(cs);
}
//end draw thick black border
// create a string cell (see why += 2 in the
c = r.createCell(cellnum + 1);
// set the cell's string value to "TEST"
c.setCellValue("TEST");
// make this column a bit wider
s.setColumnWidth(cellnum + 1, (int)((50 * 8) / ((double) 1 / 20)));
// on every other row
if ((rownum % 2) == 0)
{
// set this to the white on red cell style
// we defined above
c.setCellStyle(cs2);
}
// demonstrate adding/naming and deleting a sheet
// create a sheet, set its title then delete it
wb.createSheet();
wb.setSheetName(1, "DeletedSheet");
wb.removeSheetAt(1);
//end deleted sheet
// create a new file
try (FileOutputStream out = new FileOutputStream("workbook.xls")) {
// write the workbook to the output stream
// close our file (don't blow out our file handles
wb.write(out);
}
}
//draw a thick black border on the row at the bottom using BLANKS
// advance 2 rows
rownum++;
rownum++;
r = s.createRow(rownum);
// define the third style to be the default
// except with a thick black border at the bottom
cs3.setBorderBottom(BorderStyle.THICK);
//create 50 cells
for (int cellnum =0; cellnum < 50; cellnum++) {
//create a blank type cell (no value)
c = r.createCell(cellnum);
// set it to the thick black border style
c.setCellStyle(cs3);
}
//end draw thick black border
// demonstrate adding/naming and deleting a sheet
// create a sheet, set its title then delete it
wb.createSheet();
wb.setSheetName(1, "DeletedSheet");
wb.removeSheetAt(1);
//end deleted sheet
// write the workbook to the output stream
// close our file (don't blow out our file handles
wb.write(out);
out.close();
wb.close();
}
}

View File

@ -33,33 +33,32 @@ import org.apache.poi.ss.usermodel.BorderStyle;
*/
public class Borders {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(1);
cell.setCellValue(4);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(1);
cell.setCellValue(4);
// Style the cell with borders all around.
HSSFCellStyle style = wb.createCellStyle();
style.setBorderBottom(BorderStyle.THIN);
style.setBottomBorderColor(HSSFColorPredefined.BLACK.getIndex());
style.setBorderLeft(BorderStyle.THIN);
style.setLeftBorderColor(HSSFColorPredefined.GREEN.getIndex());
style.setBorderRight(BorderStyle.THIN);
style.setRightBorderColor(HSSFColorPredefined.BLUE.getIndex());
style.setBorderTop(BorderStyle.MEDIUM_DASHED);
style.setTopBorderColor(HSSFColorPredefined.ORANGE.getIndex());
cell.setCellStyle(style);
// Style the cell with borders all around.
HSSFCellStyle style = wb.createCellStyle();
style.setBorderBottom(BorderStyle.THIN);
style.setBottomBorderColor(HSSFColorPredefined.BLACK.getIndex());
style.setBorderLeft(BorderStyle.THIN);
style.setLeftBorderColor(HSSFColorPredefined.GREEN.getIndex());
style.setBorderRight(BorderStyle.THIN);
style.setRightBorderColor(HSSFColorPredefined.BLUE.getIndex());
style.setBorderTop(BorderStyle.MEDIUM_DASHED);
style.setTopBorderColor(HSSFColorPredefined.ORANGE.getIndex());
cell.setCellStyle(style);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -17,90 +17,108 @@
package org.apache.poi.hssf.usermodel.examples;
import org.apache.poi.hssf.usermodel.HSSFComment;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.Comment;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFComment;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
/**
* Demonstrates how to work with excel cell comments.
* Demonstrates how to work with excel cell comments.<p>
*
* <p>
* Excel comment is a kind of a text shape,
* so inserting a comment is very similar to placing a text box in a worksheet
* </p>
*/
public class CellComments {
public static void main(String[] args) throws IOException {
createWorkbook(false, ".xls");
createWorkbook(true, ".xlsx");
}
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("Cell comments in POI HSSF");
private static void createWorkbook(boolean xssf, String extension) throws IOException {
try (Workbook wb = WorkbookFactory.create(xssf)) {
Sheet sheet = wb.createSheet("Cell comments in POI " + extension);
CreationHelper creationHelper = wb.getCreationHelper();
// Create the drawing patriarch. This is the top level container for all shapes including cell comments.
HSSFPatriarch patr = sheet.createDrawingPatriarch();
// Create the drawing patriarch. This is the top level container for all shapes including cell comments.
Drawing<?> patr = sheet.createDrawingPatriarch();
//create a cell in row 3
HSSFCell cell1 = sheet.createRow(3).createCell(1);
cell1.setCellValue(new HSSFRichTextString("Hello, World"));
//create a cell in row 3
Cell cell1 = sheet.createRow(3).createCell(1);
cell1.setCellValue(creationHelper.createRichTextString("Hello, World"));
//anchor defines size and position of the comment in worksheet
HSSFComment comment1 = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short)4, 2, (short) 6, 5));
//anchor defines size and position of the comment in worksheet
ClientAnchor clientAnchor = creationHelper.createClientAnchor();
clientAnchor.setCol1(4);
clientAnchor.setRow1(2);
clientAnchor.setCol2(6);
clientAnchor.setRow2(5);
Comment comment1 = patr.createCellComment(clientAnchor);
// set text in the comment
comment1.setString(new HSSFRichTextString("We can set comments in POI"));
// set text in the comment
comment1.setString(creationHelper.createRichTextString("We can set comments in POI"));
//set comment author.
//you can see it in the status bar when moving mouse over the commented cell
comment1.setAuthor("Apache Software Foundation");
//set comment author.
//you can see it in the status bar when moving mouse over the commented cell
comment1.setAuthor("Apache Software Foundation");
// The first way to assign comment to a cell is via HSSFCell.setCellComment method
cell1.setCellComment(comment1);
// The first way to assign comment to a cell is via Cell.setCellComment method
cell1.setCellComment(comment1);
//create another cell in row 6
HSSFCell cell2 = sheet.createRow(6).createCell(1);
cell2.setCellValue(36.6);
//create another cell in row 6
Cell cell2 = sheet.createRow(6).createCell(1);
cell2.setCellValue(36.6);
HSSFComment comment2 = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short)4, 8, (short) 6, 11));
//modify background color of the comment
comment2.setFillColor(204, 236, 255);
clientAnchor = creationHelper.createClientAnchor();
clientAnchor.setCol1(4);
clientAnchor.setRow1(8);
clientAnchor.setCol2(6);
clientAnchor.setRow2(11);
Comment comment2 = patr.createCellComment(clientAnchor);
//modify background color of the comment, only available in HSSF currently
if (wb instanceof HSSFWorkbook) {
((HSSFComment) comment2).setFillColor(204, 236, 255);
}
HSSFRichTextString string = new HSSFRichTextString("Normal body temperature");
RichTextString string = creationHelper.createRichTextString("Normal body temperature");
//apply custom font to the text in the comment
HSSFFont font = wb.createFont();
font.setFontName("Arial");
font.setFontHeightInPoints((short)10);
font.setBold(true);
font.setColor(HSSFColorPredefined.RED.getIndex());
string.applyFont(font);
//apply custom font to the text in the comment
Font font = wb.createFont();
font.setFontName("Arial");
font.setFontHeightInPoints((short) 10);
font.setBold(true);
font.setColor(IndexedColors.RED.getIndex());
string.applyFont(font);
comment2.setString(string);
comment2.setVisible(true); //by default comments are hidden. This one is always visible.
comment2.setString(string);
comment2.setVisible(true); //by default comments are hidden. This one is always visible.
comment2.setAuthor("Bill Gates");
comment2.setAuthor("Bill Gates");
/**
* The second way to assign comment to a cell is to implicitly specify its row and column.
* Note, it is possible to set row and column of a non-existing cell.
* It works, the comment is visible.
*/
comment2.setRow(6);
comment2.setColumn(1);
/*
* The second way to assign comment to a cell is to implicitly specify its row and column.
* Note, it is possible to set row and column of a non-existing cell.
* It works, the comment is visible.
*/
comment2.setRow(6);
comment2.setColumn(1);
FileOutputStream out = new FileOutputStream("poi_comment.xls");
wb.write(out);
out.close();
wb.close();
try (FileOutputStream out = new FileOutputStream("poi_comment" + extension)) {
wb.write(out);
}
}
}
}

View File

@ -28,20 +28,19 @@ import org.apache.poi.ss.usermodel.CellType;
public class CellTypes {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(2);
row.createCell(0).setCellValue(1.1);
row.createCell(1).setCellValue(new Date());
row.createCell(2).setCellValue("a string");
row.createCell(3).setCellValue(true);
row.createCell(4).setCellType(CellType.ERROR);
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(2);
row.createCell(0).setCellValue(1.1);
row.createCell(1).setCellValue(new Date());
row.createCell(2).setCellValue("a string");
row.createCell(3).setCellValue(true);
row.createCell(4).setCellType(CellType.ERROR);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -32,25 +32,24 @@ import java.io.IOException;
*/
public class CreateCells {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(0);
cell.setCellValue(1);
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(0);
cell.setCellValue(1);
// Or do it on one line.
row.createCell(1).setCellValue(1.2);
row.createCell(2).setCellValue("This is a string");
row.createCell(3).setCellValue(true);
// Or do it on one line.
row.createCell(1).setCellValue(1.2);
row.createCell(2).setCellValue("This is a string");
row.createCell(3).setCellValue(true);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -35,29 +35,28 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
*/
public class CreateDateCells {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(0);
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(0);
// Create a cell and put a date value in it. The first cell is not styled as a date.
HSSFCell cell = row.createCell(0);
cell.setCellValue(new Date());
// Create a cell and put a date value in it. The first cell is not styled as a date.
HSSFCell cell = row.createCell(0);
cell.setCellValue(new Date());
// we style the second cell as a date (and time). It is important to create a new cell style from the workbook
// otherwise you can end up modifying the built in style and effecting not only this cell but other cells.
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
cell = row.createCell(1);
cell.setCellValue(new Date());
cell.setCellStyle(cellStyle);
// we style the second cell as a date (and time). It is important to create a new cell style from the workbook
// otherwise you can end up modifying the built in style and effecting not only this cell but other cells.
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
cell = row.createCell(1);
cell.setCellValue(new Date());
cell.setCellStyle(cellStyle);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -34,34 +34,34 @@ public class EmbeddedObjects {
@SuppressWarnings("unused")
public static void main(String[] args) throws Exception {
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(args[0]));
HSSFWorkbook workbook = new HSSFWorkbook(fs);
for (HSSFObjectData obj : workbook.getAllEmbeddedObjects()) {
//the OLE2 Class Name of the object
String oleName = obj.getOLE2ClassName();
DirectoryNode dn = (obj.hasDirectoryEntry()) ? (DirectoryNode) obj.getDirectory() : null;
Closeable document = null;
if (oleName.equals("Worksheet")) {
document = new HSSFWorkbook(dn, fs, false);
} else if (oleName.equals("Document")) {
document = new HWPFDocument(dn);
} else if (oleName.equals("Presentation")) {
document = new HSLFSlideShow(dn);
} else {
if(dn != null){
// The DirectoryEntry is a DocumentNode. Examine its entries to find out what it is
for (Entry entry : dn) {
String name = entry.getName();
}
try (HSSFWorkbook workbook = new HSSFWorkbook(fs)) {
for (HSSFObjectData obj : workbook.getAllEmbeddedObjects()) {
//the OLE2 Class Name of the object
String oleName = obj.getOLE2ClassName();
DirectoryNode dn = (obj.hasDirectoryEntry()) ? (DirectoryNode) obj.getDirectory() : null;
Closeable document = null;
if (oleName.equals("Worksheet")) {
document = new HSSFWorkbook(dn, fs, false);
} else if (oleName.equals("Document")) {
document = new HWPFDocument(dn);
} else if (oleName.equals("Presentation")) {
document = new HSLFSlideShow(dn);
} else {
// There is no DirectoryEntry
// Recover the object's data from the HSSFObjectData instance.
byte[] objectData = obj.getObjectData();
if (dn != null) {
// The DirectoryEntry is a DocumentNode. Examine its entries to find out what it is
for (Entry entry : dn) {
String name = entry.getName();
}
} else {
// There is no DirectoryEntry
// Recover the object's data from the HSSFObjectData instance.
byte[] objectData = obj.getObjectData();
}
}
if (document != null) {
document.close();
}
}
if (document != null) {
document.close();
}
}
workbook.close();
}
}

View File

@ -31,9 +31,7 @@ import java.io.InputStream;
/**
* This example shows how to use the event API for reading a file.
*/
public class EventExample
implements HSSFListener
{
public class EventExample implements HSSFListener {
private SSTRecord sstrec;
/**
@ -97,23 +95,22 @@ public class EventExample
{
// create a new file input stream with the input file specified
// at the command line
FileInputStream fin = new FileInputStream(args[0]);
// create a new org.apache.poi.poifs.filesystem.Filesystem
POIFSFileSystem poifs = new POIFSFileSystem(fin);
// get the Workbook (excel part) stream in a InputStream
InputStream din = poifs.createDocumentInputStream("Workbook");
// construct out HSSFRequest object
HSSFRequest req = new HSSFRequest();
// lazy listen for ALL records with the listener shown above
req.addListenerForAllRecords(new EventExample());
// create our event factory
HSSFEventFactory factory = new HSSFEventFactory();
// process our events based on the document input stream
factory.processEvents(req, din);
// once all the events are processed close our file input stream
fin.close();
// and our document input stream (don't want to leak these!)
din.close();
try (FileInputStream fin = new FileInputStream(args[0])) {
// create a new org.apache.poi.poifs.filesystem.Filesystem
try (POIFSFileSystem poifs = new POIFSFileSystem(fin)) {
// get the Workbook (excel part) stream in a InputStream
try (InputStream din = poifs.createDocumentInputStream("Workbook")) {
// construct out HSSFRequest object
HSSFRequest req = new HSSFRequest();
// lazy listen for ALL records with the listener shown above
req.addListenerForAllRecords(new EventExample());
// create our event factory
HSSFEventFactory factory = new HSSFEventFactory();
// process our events based on the document input stream
factory.processEvents(req, din);
}
}
}
System.out.println("done.");
}
}

View File

@ -33,33 +33,32 @@ import org.apache.poi.ss.usermodel.FillPatternType;
*/
public class FrillsAndFills {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Aqua background
HSSFCellStyle style = wb.createCellStyle();
style.setFillBackgroundColor(HSSFColorPredefined.AQUA.getIndex());
style.setFillPattern(FillPatternType.BIG_SPOTS);
HSSFCell cell = row.createCell(1);
cell.setCellValue("X");
cell.setCellStyle(style);
// Aqua background
HSSFCellStyle style = wb.createCellStyle();
style.setFillBackgroundColor(HSSFColorPredefined.AQUA.getIndex());
style.setFillPattern(FillPatternType.BIG_SPOTS);
HSSFCell cell = row.createCell(1);
cell.setCellValue("X");
cell.setCellStyle(style);
// Orange "foreground", foreground being the fill foreground not the font color.
style = wb.createCellStyle();
style.setFillForegroundColor(HSSFColorPredefined.ORANGE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell = row.createCell(2);
cell.setCellValue("X");
cell.setCellStyle(style);
// Orange "foreground", foreground being the fill foreground not the font color.
style = wb.createCellStyle();
style.setFillForegroundColor(HSSFColorPredefined.ORANGE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell = row.createCell(2);
cell.setCellValue("X");
cell.setCellStyle(style);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -47,12 +47,9 @@ public final class HSSFReadWrite {
* creates an {@link HSSFWorkbook} with the specified OS filename.
*/
private static HSSFWorkbook readFile(String filename) throws IOException {
FileInputStream fis = new FileInputStream(filename);
try {
return new HSSFWorkbook(fis); // NOSONAR - should not be closed here
} finally {
fis.close();
}
try (FileInputStream fis = new FileInputStream(filename)) {
return new HSSFWorkbook(fis); // NOSONAR - should not be closed here
}
}
/**
@ -60,8 +57,7 @@ public final class HSSFReadWrite {
* rows/cells.
*/
private static void testCreateSampleSheet(String outputFilename) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
try {
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet s = wb.createSheet();
HSSFCellStyle cs = wb.createCellStyle();
HSSFCellStyle cs2 = wb.createCellStyle();
@ -125,14 +121,9 @@ public final class HSSFReadWrite {
wb.removeSheetAt(1);
// end deleted sheet
FileOutputStream out = new FileOutputStream(outputFilename);
try {
try (FileOutputStream out = new FileOutputStream(outputFilename)) {
wb.write(out);
} finally {
out.close();
}
} finally {
wb.close();
}
}
@ -140,15 +131,15 @@ public final class HSSFReadWrite {
* Method main
*
* Given 1 argument takes that as the filename, inputs it and dumps the
* cell values/types out to sys.out.<br/>
* cell values/types out to sys.out.<br>
*
* given 2 arguments where the second argument is the word "write" and the
* first is the filename - writes out a sample (test) spreadsheet
* see {@link HSSFReadWrite#testCreateSampleSheet(String)}.<br/>
* see {@link HSSFReadWrite#testCreateSampleSheet(String)}.<br>
*
* given 2 arguments where the first is an input filename and the second
* an output filename (not write), attempts to fully read in the
* spreadsheet and fully write it out.<br/>
* spreadsheet and fully write it out.<br>
*
* given 3 arguments where the first is an input filename and the second an
* output filename (not write) and the third is "modify1", attempts to read in the
@ -166,9 +157,7 @@ public final class HSSFReadWrite {
try {
if (args.length < 2) {
HSSFWorkbook wb = HSSFReadWrite.readFile(fileName);
try {
try (HSSFWorkbook wb = HSSFReadWrite.readFile(fileName)) {
System.out.println("Data dump:\n");
for (int k = 0; k < wb.getNumberOfSheets(); k++) {
@ -187,8 +176,8 @@ public final class HSSFReadWrite {
HSSFCell cell = row.getCell(c);
String value;
if(cell != null) {
switch (cell.getCellTypeEnum()) {
if (cell != null) {
switch (cell.getCellType()) {
case FORMULA:
value = "FORMULA value=" + cell.getCellFormula();
@ -215,7 +204,7 @@ public final class HSSFReadWrite {
break;
default:
value = "UNKNOWN value of type " + cell.getCellTypeEnum();
value = "UNKNOWN value of type " + cell.getCellType();
}
System.out.println("CELL col=" + cell.getColumnIndex() + " VALUE="
+ value);
@ -223,8 +212,6 @@ public final class HSSFReadWrite {
}
}
}
} finally {
wb.close();
}
} else if (args.length == 2) {
if (args[1].toLowerCase(Locale.ROOT).equals("write")) {
@ -236,23 +223,16 @@ public final class HSSFReadWrite {
+ " ms generation time");
} else {
System.out.println("readwrite test");
HSSFWorkbook wb = HSSFReadWrite.readFile(fileName);
try {
FileOutputStream stream = new FileOutputStream(args[1]);
try {
try (HSSFWorkbook wb = HSSFReadWrite.readFile(fileName)) {
try (FileOutputStream stream = new FileOutputStream(args[1])) {
wb.write(stream);
} finally {
stream.close();
}
} finally {
wb.close();
}
}
} else if (args.length == 3 && args[2].equalsIgnoreCase("modify1")) {
// delete row 0-24, row 74 - 99 && change cell 3 on row 39 to string "MODIFIED CELL!!"
HSSFWorkbook wb = HSSFReadWrite.readFile(fileName);
try {
try (HSSFWorkbook wb = HSSFReadWrite.readFile(fileName)) {
HSSFSheet sheet = wb.getSheetAt(0);
for (int k = 0; k < 25; k++) {
@ -269,14 +249,9 @@ public final class HSSFReadWrite {
HSSFCell cell = row.getCell(3);
cell.setCellValue("MODIFIED CELL!!!!!");
FileOutputStream stream = new FileOutputStream(args[1]);
try {
try (FileOutputStream stream = new FileOutputStream(args[1])) {
wb.write(stream);
} finally {
stream.close();
}
} finally {
wb.close();
}
}
} catch (Exception e) {

View File

@ -31,17 +31,17 @@ import org.apache.poi.ss.usermodel.CellType;
*/
public class HyperlinkFormula {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(0);
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell(0);
cell.setCellType(CellType.FORMULA);
cell.setCellFormula("HYPERLINK(\"http://127.0.0.1:8080/toto/truc/index.html?test=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", \"test\")");
HSSFCell cell = row.createCell(0);
cell.setCellType(CellType.FORMULA);
cell.setCellFormula("HYPERLINK(\"http://127.0.0.1:8080/toto/truc/index.html?test=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", \"test\")");
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -37,61 +37,61 @@ import org.apache.poi.ss.usermodel.Font;
public class Hyperlinks {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFCreationHelper helper = wb.getCreationHelper();
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFCreationHelper helper = wb.getCreationHelper();
//cell style for hyperlinks
//by default hyperlinks are blue and underlined
HSSFCellStyle hlink_style = wb.createCellStyle();
HSSFFont hlink_font = wb.createFont();
hlink_font.setUnderline(Font.U_SINGLE);
hlink_font.setColor(HSSFColorPredefined.BLUE.getIndex());
hlink_style.setFont(hlink_font);
//cell style for hyperlinks
//by default hyperlinks are blue and underlined
HSSFCellStyle hlink_style = wb.createCellStyle();
HSSFFont hlink_font = wb.createFont();
hlink_font.setUnderline(Font.U_SINGLE);
hlink_font.setColor(HSSFColorPredefined.BLUE.getIndex());
hlink_style.setFont(hlink_font);
HSSFCell cell;
HSSFSheet sheet = wb.createSheet("Hyperlinks");
HSSFCell cell;
HSSFSheet sheet = wb.createSheet("Hyperlinks");
//URL
cell = sheet.createRow(0).createCell(0);
cell.setCellValue("URL Link");
HSSFHyperlink link = helper.createHyperlink(HyperlinkType.URL);
link.setAddress("http://poi.apache.org/");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//URL
cell = sheet.createRow(0).createCell(0);
cell.setCellValue("URL Link");
HSSFHyperlink link = helper.createHyperlink(HyperlinkType.URL);
link.setAddress("http://poi.apache.org/");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//link to a file in the current directory
cell = sheet.createRow(1).createCell(0);
cell.setCellValue("File Link");
link = helper.createHyperlink(HyperlinkType.FILE);
link.setAddress("link1.xls");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//link to a file in the current directory
cell = sheet.createRow(1).createCell(0);
cell.setCellValue("File Link");
link = helper.createHyperlink(HyperlinkType.FILE);
link.setAddress("link1.xls");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//e-mail link
cell = sheet.createRow(2).createCell(0);
cell.setCellValue("Email Link");
link = helper.createHyperlink(HyperlinkType.EMAIL);
//note, if subject contains white spaces, make sure they are url-encoded
link.setAddress("mailto:poi@apache.org?subject=Hyperlinks");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//e-mail link
cell = sheet.createRow(2).createCell(0);
cell.setCellValue("Email Link");
link = helper.createHyperlink(HyperlinkType.EMAIL);
//note, if subject contains white spaces, make sure they are url-encoded
link.setAddress("mailto:poi@apache.org?subject=Hyperlinks");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
//link to a place in this workbook
//link to a place in this workbook
//create a target sheet and cell
HSSFSheet sheet2 = wb.createSheet("Target Sheet");
sheet2.createRow(0).createCell(0).setCellValue("Target Cell");
//create a target sheet and cell
HSSFSheet sheet2 = wb.createSheet("Target Sheet");
sheet2.createRow(0).createCell(0).setCellValue("Target Cell");
cell = sheet.createRow(3).createCell(0);
cell.setCellValue("Worksheet Link");
link = helper.createHyperlink(HyperlinkType.DOCUMENT);
link.setAddress("'Target Sheet'!A1");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
cell = sheet.createRow(3).createCell(0);
cell.setCellValue("Worksheet Link");
link = helper.createHyperlink(HyperlinkType.DOCUMENT);
link.setAddress("'Target Sheet'!A1");
cell.setHyperlink(link);
cell.setCellStyle(hlink_style);
FileOutputStream out = new FileOutputStream("hssf-links.xls");
wb.write(out);
out.close();
wb.close();
try (FileOutputStream out = new FileOutputStream("hssf-links.xls")) {
wb.write(out);
}
}
}
}

View File

@ -20,7 +20,6 @@ package org.apache.poi.hssf.usermodel.examples;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
@ -67,8 +66,7 @@ public class InCellLists {
* the Excel spreadsheet file this code will create.
*/
public void demonstrateMethodCalls(String outputFilename) throws IOException {
HSSFWorkbook workbook = new HSSFWorkbook();
try {
try (HSSFWorkbook workbook = new HSSFWorkbook()) {
HSSFSheet sheet = workbook.createSheet("In Cell Lists");
HSSFRow row = sheet.createRow(0);
@ -81,7 +79,7 @@ public class InCellLists {
// whose items are neither bulleted or numbered - into that cell.
row = sheet.createRow(1);
cell = row.createCell(0);
ArrayList<String> listItems = new ArrayList<String>();
ArrayList<String> listItems = new ArrayList<>();
listItems.add("List Item One.");
listItems.add("List Item Two.");
listItems.add("List Item Three.");
@ -89,7 +87,7 @@ public class InCellLists {
this.listInCell(workbook, listItems, cell);
// The row height and cell width are set here to ensure that the
// list may be seen.
row.setHeight((short)1100);
row.setHeight((short) 1100);
sheet.setColumnWidth(0, 9500);
// Create a cell at A3 and insert a numbered list into that cell.
@ -100,7 +98,7 @@ public class InCellLists {
listItems.add("List Item Five.");
listItems.add("List Item Six.");
this.numberedListInCell(workbook, listItems, cell, 1, 2);
row.setHeight((short)1550);
row.setHeight((short) 1550);
// Create a cell at A4 and insert a numbered list into that cell.
// Note that a couple of items have been added to the listItems
@ -112,7 +110,7 @@ public class InCellLists {
listItems.add("List Item Nine.");
listItems.add("List Item Ten.");
this.bulletedListInCell(workbook, listItems, cell);
row.setHeight((short)2550);
row.setHeight((short) 2550);
// Insert a plain, multi-level list into cell A5. Note that
// the major difference here is that the list items are passed as
@ -125,8 +123,8 @@ public class InCellLists {
// to preserve order.
row = sheet.createRow(4);
cell = row.createCell(0);
ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<MultiLevelListItem>();
listItems = new ArrayList<String>();
ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<>();
listItems = new ArrayList<>();
listItems.add("ML List Item One - Sub Item One.");
listItems.add("ML List Item One - Sub Item Two.");
listItems.add("ML List Item One - Sub Item Three.");
@ -137,13 +135,13 @@ public class InCellLists {
// item
multiLevelListItems.add(new MultiLevelListItem("List Item Two.", null));
multiLevelListItems.add(new MultiLevelListItem("List Item Three.", null));
listItems = new ArrayList<String>();
listItems = new ArrayList<>();
listItems.add("ML List Item Four - Sub Item One.");
listItems.add("ML List Item Four - Sub Item Two.");
listItems.add("ML List Item Four - Sub Item Three.");
multiLevelListItems.add(new MultiLevelListItem("List Item Four.", listItems));
this.multiLevelListInCell(workbook, multiLevelListItems, cell);
row.setHeight((short)2800);
row.setHeight((short) 2800);
// Insert a numbered multi-level list into cell A6. Note that the
// same ArrayList as constructed for the above plain multi-level
@ -151,8 +149,8 @@ public class InCellLists {
row = sheet.createRow(5);
cell = row.createCell(0);
this.multiLevelNumberedListInCell(workbook, multiLevelListItems,
cell, 1, 1, 1, 2);
row.setHeight((short)2800);
cell, 1, 1, 1, 2);
row.setHeight((short) 2800);
// Insert a numbered multi-level list into cell A7. Note that the
// same ArrayList as constructed for the plain multi-level list
@ -160,31 +158,18 @@ public class InCellLists {
row = sheet.createRow(6);
cell = row.createCell(0);
this.multiLevelBulletedListInCell(workbook, multiLevelListItems, cell);
row.setHeight((short)2800);
row.setHeight((short) 2800);
// Save the completed workbook
FileOutputStream fos = new FileOutputStream(new File(outputFilename));
try {
try (FileOutputStream fos = new FileOutputStream(new File(outputFilename))) {
workbook.write(fos);
} finally {
fos.close();
}
}
catch(FileNotFoundException fnfEx) {
System.out.println("Caught a: " + fnfEx.getClass().getName());
System.out.println("Message: " + fnfEx.getMessage());
System.out.println("Stacktrace follows...........");
fnfEx.printStackTrace(System.out);
}
catch(IOException ioEx) {
} catch (IOException ioEx) {
System.out.println("Caught a: " + ioEx.getClass().getName());
System.out.println("Message: " + ioEx.getMessage());
System.out.println("Stacktrace follows...........");
ioEx.printStackTrace(System.out);
}
finally {
workbook.close();
}
}
/**
@ -512,8 +497,8 @@ public class InCellLists {
*/
public final class MultiLevelListItem {
private String itemText = null;
private ArrayList<String> lowerLevelItems = null;
private String itemText;
private ArrayList<String> lowerLevelItems;
/**
* Create a new instance of the MultiLevelListItem class using the

View File

@ -31,19 +31,19 @@ import org.apache.poi.ss.util.CellRangeAddress;
*/
public class MergedCells {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow(1);
HSSFCell cell = row.createCell(1);
cell.setCellValue("This is a test of merging");
HSSFRow row = sheet.createRow(1);
HSSFCell cell = row.createCell(1);
cell.setCellValue("This is a test of merging");
sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 2));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 2));
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -33,31 +33,27 @@ import org.apache.poi.ss.usermodel.CellType;
*/
public class NewLinesInCells {
public static void main( String[] args ) throws IOException {
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet s = wb.createSheet();
HSSFFont f2 = wb.createFont();
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
HSSFRow r = null;
HSSFCell c = null;
HSSFCellStyle cs = wb.createCellStyle();
HSSFFont f2 = wb.createFont();
HSSFCellStyle cs = wb.createCellStyle();
cs = wb.createCellStyle();
cs.setFont(f2);
// Word Wrap MUST be turned on
cs.setWrapText(true);
cs.setFont(f2);
// Word Wrap MUST be turned on
cs.setWrapText(true);
HSSFRow r = s.createRow(2);
r.setHeight((short) 0x349);
HSSFCell c = r.createCell(2);
c.setCellType(CellType.STRING);
c.setCellValue("Use \n with word wrap on to create a new line");
c.setCellStyle(cs);
s.setColumnWidth(2, (int) ((50 * 8) / ((double) 1 / 20)));
r = s.createRow(2);
r.setHeight((short) 0x349);
c = r.createCell(2);
c.setCellType(CellType.STRING);
c.setCellValue("Use \n with word wrap on to create a new line");
c.setCellStyle(cs);
s.setColumnWidth(2, (int) ((50 * 8) / ((double) 1 / 20)));
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -28,16 +28,17 @@ import org.apache.poi.ss.util.WorkbookUtil;
*/
public abstract class NewSheet {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
wb.createSheet("new sheet");
// create with default name
wb.createSheet();
final String name = "second sheet";
// setting sheet name later
wb.setSheetName(1, WorkbookUtil.createSafeSheetName(name));
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (HSSFWorkbook wb = new HSSFWorkbook()) {
wb.createSheet("new sheet");
// create with default name
wb.createSheet();
final String name = "second sheet";
// setting sheet name later
wb.setSheetName(1, WorkbookUtil.createSafeSheetName(name));
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -29,10 +29,10 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
*/
public class NewWorkbook {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (HSSFWorkbook wb = new HSSFWorkbook()) {
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -30,24 +30,25 @@ import java.io.*;
public class OfficeDrawing {
public static void main(String[] args) throws IOException {
// Create the workbook and sheets.
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("new sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
HSSFSheet sheet4 = wb.createSheet("fourth sheet");
HSSFSheet sheet5 = wb.createSheet("fifth sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet1 = wb.createSheet("new sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
HSSFSheet sheet4 = wb.createSheet("fourth sheet");
HSSFSheet sheet5 = wb.createSheet("fifth sheet");
// Draw stuff in them
drawSheet1( sheet1 );
drawSheet2( sheet2 );
drawSheet3( sheet3 );
drawSheet4( sheet4, wb );
drawSheet5( sheet5, wb );
// Draw stuff in them
drawSheet1(sheet1);
drawSheet2(sheet2);
drawSheet3(sheet3);
drawSheet4(sheet4, wb);
drawSheet5(sheet5, wb);
// Write the file out.
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
// Write the file out.
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
private static void drawSheet1( HSSFSheet sheet1 )

View File

@ -32,51 +32,51 @@ public class OfficeDrawingWithGraphics {
public static void main( String[] args ) throws IOException {
// Create a workbook with one sheet and size the first three somewhat
// larger so we can fit the chemical structure diagram in.
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet( "my drawing" );
sheet.setColumnWidth(1, 256 * 27);
HSSFRow row1 = sheet.createRow(0);
row1.setHeightInPoints(10 * 15f);
HSSFRow row2 = sheet.createRow(1);
row2.setHeightInPoints(5 * 15f);
HSSFRow row3 = sheet.createRow(2);
row3.setHeightInPoints(10 * 15f);
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("my drawing");
sheet.setColumnWidth(1, 256 * 27);
HSSFRow row1 = sheet.createRow(0);
row1.setHeightInPoints(10 * 15f);
HSSFRow row2 = sheet.createRow(1);
row2.setHeightInPoints(5 * 15f);
HSSFRow row3 = sheet.createRow(2);
row3.setHeightInPoints(10 * 15f);
// Add some cells so we can test that the anchoring works when we
// sort them.
row1.createCell(0).setCellValue("C");
row2.createCell(0).setCellValue("A");
row3.createCell(0).setCellValue("B");
// Add some cells so we can test that the anchoring works when we
// sort them.
row1.createCell(0).setCellValue("C");
row2.createCell(0).setCellValue("A");
row3.createCell(0).setCellValue("B");
// Create the top level drawing patriarch.
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
// Create the top level drawing patriarch.
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
HSSFClientAnchor a;
HSSFShapeGroup group;
EscherGraphics g;
EscherGraphics2d g2d;
// Anchor entirely within one cell.
a = new HSSFClientAnchor( 0, 0, 1023, 255, (short) 1, 0, (short) 1, 0 );
group = patriarch.createGroup( a );
group.setCoordinates( 0, 0, 320, 276 );
float verticalPointsPerPixel = a.getAnchorHeightInPoints(sheet) / Math.abs(group.getY2() - group.getY1());
g = new EscherGraphics( group, wb, Color.black, verticalPointsPerPixel );
g2d = new EscherGraphics2d( g );
drawStar( g2d );
HSSFClientAnchor a;
HSSFShapeGroup group;
EscherGraphics g;
EscherGraphics2d g2d;
// Anchor entirely within one cell.
a = new HSSFClientAnchor(0, 0, 1023, 255, (short) 1, 0, (short) 1, 0);
group = patriarch.createGroup(a);
group.setCoordinates(0, 0, 320, 276);
float verticalPointsPerPixel = a.getAnchorHeightInPoints(sheet) / Math.abs(group.getY2() - group.getY1());
g = new EscherGraphics(group, wb, Color.black, verticalPointsPerPixel);
g2d = new EscherGraphics2d(g);
drawStar(g2d);
a = new HSSFClientAnchor( 0, 0, 1023, 255, (short) 1, 1, (short) 1, 1 );
group = patriarch.createGroup( a );
group.setCoordinates( 0, 0, 640, 276 );
verticalPointsPerPixel = a.getAnchorHeightInPoints(sheet) / Math.abs(group.getY2() - group.getY1());
a = new HSSFClientAnchor(0, 0, 1023, 255, (short) 1, 1, (short) 1, 1);
group = patriarch.createGroup(a);
group.setCoordinates(0, 0, 640, 276);
verticalPointsPerPixel = a.getAnchorHeightInPoints(sheet) / Math.abs(group.getY2() - group.getY1());
// verticalPixelsPerPoint = (float)Math.abs(group.getY2() - group.getY1()) / a.getAnchorHeightInPoints(sheet);
g = new EscherGraphics( group, wb, Color.black, verticalPointsPerPixel );
g2d = new EscherGraphics2d( g );
drawStar( g2d );
FileOutputStream out = new FileOutputStream("workbook.xls");
wb.write(out);
out.close();
g = new EscherGraphics(group, wb, Color.black, verticalPointsPerPixel);
g2d = new EscherGraphics2d(g);
drawStar(g2d);
try (FileOutputStream out = new FileOutputStream("workbook.xls")) {
wb.write(out);
}
}
}
private static void drawStar( EscherGraphics2d g2d )

View File

@ -37,14 +37,11 @@ public class Outlines implements Closeable {
throws IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
POILogger LOGGER = POILogFactory.getLogger(Outlines.class);
for (int i=1; i<=13; i++) {
Outlines o = new Outlines();
try {
String log = (String)Outlines.class.getDeclaredMethod("test"+i).invoke(o);
String filename = "outline"+i+".xls";
try (Outlines o = new Outlines()) {
String log = (String) Outlines.class.getDeclaredMethod("test" + i).invoke(o);
String filename = "outline" + i + ".xls";
o.writeOut(filename);
LOGGER.log(POILogger.INFO, filename+" written. "+log);
} finally {
o.close();
LOGGER.log(POILogger.INFO, filename + " written. " + log);
}
}
}
@ -53,11 +50,8 @@ public class Outlines implements Closeable {
private final HSSFSheet sheet1 = wb.createSheet("new sheet");
public void writeOut(String filename) throws IOException {
FileOutputStream fileOut = new FileOutputStream(filename);
try {
try (FileOutputStream fileOut = new FileOutputStream(filename)) {
wb.write(fileOut);
} finally {
fileOut.close();
}
}

View File

@ -36,12 +36,7 @@ import org.apache.poi.ss.usermodel.CellType;
*/
public class ReadWriteWorkbook {
public static void main(String[] args) throws IOException {
FileInputStream fileIn = null;
FileOutputStream fileOut = null;
try
{
fileIn = new FileInputStream("workbook.xls");
try (FileInputStream fileIn = new FileInputStream("workbook.xls")) {
POIFSFileSystem fs = new POIFSFileSystem(fileIn);
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
@ -55,13 +50,9 @@ public class ReadWriteWorkbook {
cell.setCellValue("a test");
// Write the output to a file
fileOut = new FileOutputStream("workbookout.xls");
wb.write(fileOut);
} finally {
if (fileOut != null)
fileOut.close();
if (fileIn != null)
fileIn.close();
try (FileOutputStream fileOut = new FileOutputStream("workbookout.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -30,35 +30,35 @@ import org.apache.poi.ss.util.CellRangeAddress;
public class RepeatingRowsAndColumns {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("first sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet1 = wb.createSheet("first sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
HSSFFont boldFont = wb.createFont();
boldFont.setFontHeightInPoints((short)22);
boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
HSSFFont boldFont = wb.createFont();
boldFont.setFontHeightInPoints((short) 22);
boldFont.setBold(true);
HSSFCellStyle boldStyle = wb.createCellStyle();
boldStyle.setFont(boldFont);
HSSFCellStyle boldStyle = wb.createCellStyle();
boldStyle.setFont(boldFont);
HSSFRow row = sheet1.createRow(1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("This quick brown fox");
cell.setCellStyle(boldStyle);
HSSFRow row = sheet1.createRow(1);
HSSFCell cell = row.createCell(0);
cell.setCellValue("This quick brown fox");
cell.setCellStyle(boldStyle);
// Set the columns to repeat from column 0 to 2 on the first sheet
sheet1.setRepeatingColumns(CellRangeAddress.valueOf("A:C"));
// Set the rows to repeat from row 0 to 2 on the second sheet.
sheet2.setRepeatingRows(CellRangeAddress.valueOf("1:3"));
// Set the the repeating rows and columns on the third sheet.
CellRangeAddress cra = CellRangeAddress.valueOf("D1:E2");
sheet3.setRepeatingColumns(cra);
sheet3.setRepeatingRows(cra);
// Set the columns to repeat from column 0 to 2 on the first sheet
sheet1.setRepeatingColumns(CellRangeAddress.valueOf("A:C"));
// Set the rows to repeat from row 0 to 2 on the second sheet.
sheet2.setRepeatingRows(CellRangeAddress.valueOf("1:3"));
// Set the the repeating rows and columns on the third sheet.
CellRangeAddress cra = CellRangeAddress.valueOf("D1:E2");
sheet3.setRepeatingColumns(cra);
sheet3.setRepeatingRows(cra);
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -28,24 +28,24 @@ import org.apache.poi.ss.usermodel.Sheet;
public class SplitAndFreezePanes {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("new sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
HSSFSheet sheet4 = wb.createSheet("fourth sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet1 = wb.createSheet("new sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
HSSFSheet sheet3 = wb.createSheet("third sheet");
HSSFSheet sheet4 = wb.createSheet("fourth sheet");
// Freeze just one row
sheet1.createFreezePane( 0, 1, 0, 1 );
// Freeze just one column
sheet2.createFreezePane( 1, 0, 1, 0 );
// Freeze the columns and rows (forget about scrolling position of the lower right quadrant).
sheet3.createFreezePane( 2, 2 );
// Create a split with the lower left side being the active quadrant
sheet4.createSplitPane( 2000, 2000, 0, 0, Sheet.PANE_LOWER_LEFT );
// Freeze just one row
sheet1.createFreezePane(0, 1, 0, 1);
// Freeze just one column
sheet2.createFreezePane(1, 0, 1, 0);
// Freeze the columns and rows (forget about scrolling position of the lower right quadrant).
sheet3.createFreezePane(2, 2);
// Create a split with the lower left side being the active quadrant
sheet4.createSplitPane(2000, 2000, 0, 0, Sheet.PANE_LOWER_LEFT);
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -32,32 +32,32 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
*/
public class WorkingWithFonts {
public static void main(String[] args) throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow(1);
// Create a new font and alter it.
HSSFFont font = wb.createFont();
font.setFontHeightInPoints((short)24);
font.setFontName("Courier New");
font.setItalic(true);
font.setStrikeout(true);
// Create a new font and alter it.
HSSFFont font = wb.createFont();
font.setFontHeightInPoints((short) 24);
font.setFontName("Courier New");
font.setItalic(true);
font.setStrikeout(true);
// Fonts are set into a style so create a new one to use.
HSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
// Fonts are set into a style so create a new one to use.
HSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(1);
cell.setCellValue("This is a test of fonts");
cell.setCellStyle(style);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell(1);
cell.setCellValue("This is a test of fonts");
cell.setCellStyle(style);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -32,15 +32,14 @@ import java.io.FileOutputStream;
*/
public class ZoomSheet
{
public static void main(String[] args)
throws IOException
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("new sheet");
sheet1.setZoom(75); // 75 percent magnification
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
wb.close();
public static void main(String[] args) throws IOException {
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet1 = wb.createSheet("new sheet");
sheet1.setZoom(75); // 75 percent magnification
try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
wb.write(fileOut);
}
}
}
}

View File

@ -33,19 +33,19 @@ import org.apache.poi.ss.usermodel.BorderStyle;
* @author Jason Height
*/
public class SVBorder extends AbstractBorder {
private Color northColor = null;
private Color eastColor = null;
private Color southColor = null;
private Color westColor = null;
private Color northColor;
private Color eastColor;
private Color southColor;
private Color westColor;
private BorderStyle northBorderType = BorderStyle.NONE;
private BorderStyle eastBorderType = BorderStyle.NONE;
private BorderStyle southBorderType = BorderStyle.NONE;
private BorderStyle westBorderType = BorderStyle.NONE;
private boolean northBorder=false;
private boolean eastBorder=false;
private boolean southBorder=false;
private boolean westBorder=false;
private boolean selected = false;
private boolean northBorder;
private boolean eastBorder;
private boolean southBorder;
private boolean westBorder;
private boolean selected;
public void setBorder(Color northColor, Color eastColor,
Color southColor, Color westColor,
@ -348,14 +348,16 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
// if there are borders on the west or east then
// the second line shouldn't cross them
if (westBorder)
leftx = x+3;
if (westBorder) {
leftx = x + 3;
}
if (eastBorder)
rightx = width-3;
if (eastBorder) {
rightx = width - 3;
}
g.drawLine(x,y,width,y);
g.drawLine(leftx,y+2,rightx,y+2);
g.drawLine(x,y,width,y);
g.drawLine(leftx,y+2,rightx,y+2);
}
if (eastBorder &&
@ -370,11 +372,13 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
int topy=y;
int bottomy=height;
if (northBorder)
topy=y+3;
if (northBorder) {
topy = y + 3;
}
if (southBorder)
bottomy=height-3;
if (southBorder) {
bottomy = height - 3;
}
g.drawLine(width-1,y,width-1,height);
g.drawLine(width-3,topy,width-3,bottomy);
@ -498,13 +502,13 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
* @param y the y origin of the line
* @param thickness the thickness of the line
* @param horizontal or vertical (true for horizontal)
* @param right/bottom or left/top thickness (true for right or top),
* @param rightBottom or left/top thickness (true for right or top),
* if true then the x or y origin will be incremented to provide
* thickness, if false, they'll be decremented. For vertical
* borders, x is incremented or decremented, for horizontal its y.
* Just set to true for north and west, and false for east and
* south.
* @returns length - returns the length of the line.
* @return length - returns the length of the line.
*/
private int drawDashDotDot(Graphics g,int x, int y, int thickness,
boolean horizontal,
@ -529,7 +533,7 @@ public void paintBorder(Component c, Graphics g, int x, int y, int width,
}
/**
* @returns the line thickness for a border based on border type
* @return the line thickness for a border based on border type
*/
private int getThickness(BorderStyle thickness) {
switch (thickness) {

View File

@ -32,12 +32,12 @@ import org.apache.poi.hssf.usermodel.*;
*
* @author Jason Height
*/
public class SVRowHeader extends JList {
public class SVRowHeader extends JList<Object> {
/** This model simply returns an integer number up to the number of rows
* that are present in the sheet.
*
*/
private class SVRowHeaderModel extends AbstractListModel {
private class SVRowHeaderModel extends AbstractListModel<Object> {
private HSSFSheet sheet;
public SVRowHeaderModel(HSSFSheet sheet) {
@ -55,7 +55,7 @@ public class SVRowHeader extends JList {
}
/** Renderes the row number*/
private class RowHeaderRenderer extends JLabel implements ListCellRenderer {
private class RowHeaderRenderer extends JLabel implements ListCellRenderer<Object> {
private HSSFSheet sheet;
private int extraHeight;
@ -90,7 +90,7 @@ public class SVRowHeader extends JList {
}
public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
ListModel lm = new SVRowHeaderModel(sheet);
ListModel<Object> lm = new SVRowHeaderModel(sheet);
this.setModel(lm);
setFixedCellWidth(50);

View File

@ -64,11 +64,11 @@ public class SVSheetTable extends JTable {
/**
* This field is the magic number to convert from a Character width to a java
* pixel width.
* <p/>
* <p>
* When the "normal" font size in a workbook changes, this effects all of the
* heights and widths. Unfortunately there is no way to retrieve this
* information, hence the MAGIC number.
* <p/>
* <p>
* This number may only work for the normal style font size of Arial size 10.
*/
private static final int magicCharFactor = 7;
@ -144,7 +144,7 @@ public class SVSheetTable extends JTable {
HSSFCell cell = (HSSFCell) getValueAt(row, col);
String formula = "";
if (cell != null) {
if (cell.getCellTypeEnum() == CellType.FORMULA) {
if (cell.getCellType() == CellType.FORMULA) {
formula = cell.getCellFormula();
} else {
formula = cell.toString();

View File

@ -40,173 +40,176 @@ import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
/**
* Sheet Viewer Table Cell Editor -- not commented via javadoc as it
* nearly completely consists of overridden methods.
*
* @author Jason Height
* @author Jason Height
*/
public class SVTableCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
private static final Color black = getAWTColor(HSSFColorPredefined.BLACK);
private static final Color white = getAWTColor(HSSFColorPredefined.WHITE);
private static final Color black = getAWTColor(HSSFColorPredefined.BLACK);
private static final Color white = getAWTColor(HSSFColorPredefined.WHITE);
private static final POILogger logger = POILogFactory.getLogger(SVTableCellEditor.class);
private HSSFWorkbook wb;
private JTextField editor;
private HSSFWorkbook wb;
private JTextField editor;
public SVTableCellEditor(HSSFWorkbook wb) {
this.wb = wb;
this.editor = new JTextField();
}
/**
* Gets the cellEditable attribute of the SVTableCellEditor object
*
* @return The cellEditable value
*/
@Override
public boolean isCellEditable(java.util.EventObject e) {
if (e instanceof MouseEvent) {
return ((MouseEvent) e).getClickCount() >= 2;
public SVTableCellEditor(HSSFWorkbook wb) {
this.wb = wb;
this.editor = new JTextField();
}
return false;
}
@Override
public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
public boolean startCellEditing(EventObject anEvent) {
System.out.println("Start Cell Editing");
return true;
}
@Override
public boolean stopCellEditing() {
System.out.println("Stop Cell Editing");
fireEditingStopped();
return true;
}
@Override
public void cancelCellEditing() {
System.out.println("Cancel Cell Editing");
fireEditingCanceled();
}
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
stopCellEditing();
}
/**
* Gets the cellEditorValue attribute of the SVTableCellEditor object
*
* @return The cellEditorValue value
*/
@Override
public Object getCellEditorValue() {
System.out.println("GetCellEditorValue");
//JMH Look at when this method is called. Should it return a HSSFCell?
return editor.getText();
}
/**
* Gets the tableCellEditorComponent attribute of the SVTableCellEditor object
*
* @return The tableCellEditorComponent value
*/
@Override
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected,
int row,
int column) {
System.out.println("GetTableCellEditorComponent");
HSSFCell cell = (HSSFCell) value;
if (cell != null) {
HSSFCellStyle style = cell.getCellStyle();
HSSFFont f = wb.getFontAt(style.getFontIndex());
boolean isbold = f.getBold();
boolean isitalics = f.getItalic();
int fontstyle = Font.PLAIN;
if (isbold) {
fontstyle = Font.BOLD;
}
if (isitalics) {
fontstyle = fontstyle | Font.ITALIC;
}
int fontheight = f.getFontHeightInPoints();
if (fontheight == 9) {
fontheight = 10; //fix for stupid ol Windows
}
Font font = new Font(f.getFontName(),fontstyle,fontheight);
editor.setFont(font);
if (style.getFillPatternEnum() == FillPatternType.SOLID_FOREGROUND) {
editor.setBackground(getAWTColor(style.getFillForegroundColor(), white));
} else {
editor.setBackground(white);
}
editor.setForeground(getAWTColor(f.getColor(), black));
//Set the value that is rendered for the cell
switch (cell.getCellTypeEnum()) {
case BLANK:
editor.setText("");
break;
case BOOLEAN:
if (cell.getBooleanCellValue()) {
editor.setText("true");
} else {
editor.setText("false");
}
break;
case NUMERIC:
editor.setText(Double.toString(cell.getNumericCellValue()));
break;
case STRING:
editor.setText(cell.getRichStringCellValue().getString());
break;
case FORMULA:
default:
editor.setText("?");
}
switch (style.getAlignmentEnum()) {
case LEFT:
case JUSTIFY:
case FILL:
editor.setHorizontalAlignment(SwingConstants.LEFT);
break;
case CENTER:
case CENTER_SELECTION:
editor.setHorizontalAlignment(SwingConstants.CENTER);
break;
case GENERAL:
case RIGHT:
editor.setHorizontalAlignment(SwingConstants.RIGHT);
break;
default:
editor.setHorizontalAlignment(SwingConstants.LEFT);
break;
}
/**
* Gets the cellEditable attribute of the SVTableCellEditor object
*
* @return The cellEditable value
*/
@Override
public boolean isCellEditable(java.util.EventObject e) {
if (e instanceof MouseEvent) {
return ((MouseEvent) e).getClickCount() >= 2;
}
return false;
}
@Override
public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
public boolean startCellEditing(EventObject anEvent) {
logger.log(POILogger.INFO, "Start Cell Editing");
return true;
}
@Override
public boolean stopCellEditing() {
logger.log(POILogger.INFO, "Stop Cell Editing");
fireEditingStopped();
return true;
}
@Override
public void cancelCellEditing() {
logger.log(POILogger.INFO, "Cancel Cell Editing");
fireEditingCanceled();
}
@Override
public void actionPerformed(ActionEvent e) {
logger.log(POILogger.INFO, "Action performed");
stopCellEditing();
}
/**
* Gets the cellEditorValue attribute of the SVTableCellEditor object
*
* @return The cellEditorValue value
*/
@Override
public Object getCellEditorValue() {
logger.log(POILogger.INFO, "GetCellEditorValue");
//JMH Look at when this method is called. Should it return a HSSFCell?
return editor.getText();
}
/**
* Gets the tableCellEditorComponent attribute of the SVTableCellEditor object
*
* @return The tableCellEditorComponent value
*/
@Override
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected,
int row,
int column) {
logger.log(POILogger.INFO, "GetTableCellEditorComponent");
HSSFCell cell = (HSSFCell) value;
if (cell != null) {
HSSFCellStyle style = cell.getCellStyle();
HSSFFont f = wb.getFontAt(style.getFontIndexAsInt());
boolean isbold = f.getBold();
boolean isitalics = f.getItalic();
int fontstyle = Font.PLAIN;
if (isbold) {
fontstyle = Font.BOLD;
}
if (isitalics) {
fontstyle = fontstyle | Font.ITALIC;
}
int fontheight = f.getFontHeightInPoints();
if (fontheight == 9) {
fontheight = 10; //fix for stupid ol Windows
}
Font font = new Font(f.getFontName(), fontstyle, fontheight);
editor.setFont(font);
if (style.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
editor.setBackground(getAWTColor(style.getFillForegroundColor(), white));
} else {
editor.setBackground(white);
}
editor.setForeground(getAWTColor(f.getColor(), black));
//Set the value that is rendered for the cell
switch (cell.getCellType()) {
case BLANK:
editor.setText("");
break;
case BOOLEAN:
if (cell.getBooleanCellValue()) {
editor.setText("true");
} else {
editor.setText("false");
}
break;
case NUMERIC:
editor.setText(Double.toString(cell.getNumericCellValue()));
break;
case STRING:
editor.setText(cell.getRichStringCellValue().getString());
break;
case FORMULA:
default:
editor.setText("?");
}
switch (style.getAlignment()) {
case LEFT:
case JUSTIFY:
case FILL:
editor.setHorizontalAlignment(SwingConstants.LEFT);
break;
case CENTER:
case CENTER_SELECTION:
editor.setHorizontalAlignment(SwingConstants.CENTER);
break;
case GENERAL:
case RIGHT:
editor.setHorizontalAlignment(SwingConstants.RIGHT);
break;
default:
editor.setHorizontalAlignment(SwingConstants.LEFT);
break;
}
}
return editor;
}
return editor;
}
}

View File

@ -52,11 +52,11 @@ import org.apache.poi.ss.usermodel.FillPatternType;
public class SVTableCellRenderer extends JLabel
implements TableCellRenderer, Serializable
{
protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
protected static final Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
protected SVBorder cellBorder = new SVBorder();
private HSSFWorkbook wb = null;
private HSSFWorkbook wb;
/** This class holds the references to the predefined cell formats.
*/
@ -140,7 +140,7 @@ public class SVTableCellRenderer extends JLabel
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
boolean isBorderSet = false;
boolean isBorderSet = false;
//If the JTables default cell renderer has been setup correctly the
//value will be the HSSFCell that we are trying to render
@ -148,10 +148,10 @@ public class SVTableCellRenderer extends JLabel
if (c != null) {
HSSFCellStyle s = c.getCellStyle();
HSSFFont f = wb.getFontAt(s.getFontIndex());
HSSFFont f = wb.getFontAt(s.getFontIndexAsInt());
setFont(SVTableUtils.makeFont(f));
if (s.getFillPatternEnum() == FillPatternType.SOLID_FOREGROUND) {
if (s.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
setBackground(SVTableUtils.getAWTColor(s.getFillForegroundColor(), SVTableUtils.white));
} else setBackground(SVTableUtils.white);
@ -161,14 +161,14 @@ public class SVTableCellRenderer extends JLabel
SVTableUtils.getAWTColor(s.getRightBorderColor(), SVTableUtils.black),
SVTableUtils.getAWTColor(s.getBottomBorderColor(), SVTableUtils.black),
SVTableUtils.getAWTColor(s.getLeftBorderColor(), SVTableUtils.black),
s.getBorderTopEnum(), s.getBorderRightEnum(),
s.getBorderBottomEnum(), s.getBorderLeftEnum(),
s.getBorderTop(), s.getBorderRight(),
s.getBorderBottom(), s.getBorderLeft(),
hasFocus);
setBorder(cellBorder);
isBorderSet=true;
//Set the value that is rendered for the cell
switch (c.getCellTypeEnum()) {
switch (c.getCellType()) {
case BLANK:
setValue("");
break;
@ -195,7 +195,7 @@ public class SVTableCellRenderer extends JLabel
setValue("?");
}
//Set the text alignment of the cell
switch (s.getAlignmentEnum()) {
switch (s.getAlignment()) {
case LEFT:
case JUSTIFY:
case FILL:

View File

@ -34,8 +34,8 @@ import org.apache.poi.hssf.usermodel.HSSFCell;
*/
public class SVTableModel extends AbstractTableModel {
private HSSFSheet st = null;
int maxcol = 0;
private HSSFSheet st;
int maxcol;
public SVTableModel(HSSFSheet st, int maxcol) {
this.st = st;

View File

@ -41,7 +41,7 @@ public class SVTableUtils {
/** Description of the Field */
public final static Color white = getAWTColor(HSSFColorPredefined.WHITE);
/** Description of the Field */
public static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
public static final Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
/**
@ -70,7 +70,7 @@ public class SVTableUtils {
/** This method retrieves the AWT Color representation from the colour hash table
*
*/
/* package */ static final Color getAWTColor(int index, Color deflt) {
/* package */ static Color getAWTColor(int index, Color deflt) {
HSSFColor clr = colors.get(index);
if (clr == null) {
return deflt;
@ -79,7 +79,7 @@ public class SVTableUtils {
return new Color(rgb[0],rgb[1],rgb[2]);
}
/* package */ static final Color getAWTColor(HSSFColorPredefined clr) {
/* package */ static Color getAWTColor(HSSFColorPredefined clr) {
short[] rgb = clr.getTriplet();
return new Color(rgb[0],rgb[1],rgb[2]);
}

View File

@ -40,8 +40,8 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
*/
public class SViewer extends JApplet {
private SViewerPanel panel;
boolean isStandalone = false;
String filename = null;
boolean isStandalone;
String filename;
/**Get a parameter value*/
public String getParameter(String key, String def) {
@ -139,8 +139,7 @@ public String[][] getParameterInfo() {
System.out.println(field);
field = uc.getHeaderField(i);
}
BufferedInputStream is = new BufferedInputStream(uc.getInputStream());
return is;
return new BufferedInputStream(uc.getInputStream());
}

View File

@ -27,10 +27,6 @@ import org.apache.poi.hssf.usermodel.*;
/**
* This class presents the sheets to the user.
*
*
* @author Andrew C. Oliver
* @author Jason Height
*/
public class SViewerPanel extends JPanel {
/** This field is the magic number to convert from a Character width to a
@ -264,15 +260,13 @@ public void paint(Graphics g) {
}
/**Main method*/
public static void main(String[] args) {
if(args.length < 1) {
public static void main(String[] args) throws IOException {
if (args.length < 1) {
throw new IllegalArgumentException("A filename to view must be supplied as the first argument, but none was given");
}
try {
FileInputStream in = new FileInputStream(args[0]);
HSSFWorkbook wb = new HSSFWorkbook(in);
in.close();
try (FileInputStream in = new FileInputStream(args[0]);
HSSFWorkbook wb = new HSSFWorkbook(in)) {
SViewerPanel p = new SViewerPanel(wb, true);
JFrame frame;
frame = new JFrame() {
@ -283,6 +277,7 @@ public void paint(Graphics g) {
System.exit(0);
}
}
@Override
public synchronized void setTitle(String title) {
super.setTitle(title);
@ -291,13 +286,10 @@ public void paint(Graphics g) {
};
frame.setTitle("Viewer Frame");
frame.getContentPane().add(p, BorderLayout.CENTER);
frame.setSize(800,640);
frame.setSize(800, 640);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
frame.setVisible(true);
} catch (IOException ex) {
ex.printStackTrace();
System.exit(1);
}
}
}

View File

@ -29,7 +29,7 @@ import java.util.List;
* initial paint of the component, and then executed at the appropriate time,
* such as at the end of the containing object's {@link
* JComponent#paintChildren(Graphics)} method.
* <p/>
* <p>
* It is up to the parent component to invoke the {@link #paint(Graphics2D)}
* method of this objet at that appropriate time.
*
@ -89,7 +89,7 @@ public class PendingPaintings {
* @param parent
*/
public PendingPaintings(JComponent parent) {
paintings = new ArrayList<Painting>();
paintings = new ArrayList<>();
parent.putClientProperty(PENDING_PAINTINGS, this);
}
@ -153,7 +153,7 @@ public class PendingPaintings {
* is retrieved from the first object found that has a {@link
* #PENDING_PAINTINGS} client property, starting with this component and
* looking up its ancestors (parent, parent's parent, etc.)
* <p/>
* <p>
* This allows any descendant of a component that has a {@link
* PendingPaintings} property to add its own pending paintings.
*

View File

@ -24,7 +24,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import org.apache.poi.hwpf.model.StyleDescription;
import org.apache.poi.hwpf.model.StyleSheet;
@ -40,8 +40,7 @@ public final class Word2Forrest
@SuppressWarnings("unused")
public Word2Forrest(HWPFDocument doc, OutputStream stream) throws IOException
{
OutputStreamWriter out = new OutputStreamWriter (stream, Charset.forName("UTF-8"));
_out = out;
_out = new OutputStreamWriter (stream, StandardCharsets.UTF_8);
_doc = doc;
init ();
@ -217,13 +216,9 @@ public final class Word2Forrest
public static void main(String[] args) throws IOException {
InputStream is = new FileInputStream(args[0]);
OutputStream out = new FileOutputStream("test.xml");
try {
new Word2Forrest(new HWPFDocument(is), out);
} finally {
out.close();
is.close();
}
try (InputStream is = new FileInputStream(args[0]);
OutputStream out = new FileOutputStream("test.xml")) {
new Word2Forrest(new HWPFDocument(is), out);
}
}
}

View File

@ -17,15 +17,22 @@
package org.apache.poi.poifs.poibrowser;
import java.io.*;
import org.apache.poi.poifs.filesystem.*;
import java.io.IOException;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
import org.apache.poi.util.IOUtils;
/**
* <p>Describes the most important (whatever that is) features of a
* {@link POIFSDocument}.</p>
* {@link POIFSDocumentPath}.</p>
*/
public class DocumentDescriptor
class DocumentDescriptor
{
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000;
String name;
POIFSDocumentPath path;
DocumentInputStream stream;
@ -49,26 +56,20 @@ public class DocumentDescriptor
public DocumentDescriptor(final String name,
final POIFSDocumentPath path,
final DocumentInputStream stream,
final int nrOfBytes)
{
final int nrOfBytes) {
this.name = name;
this.path = path;
this.stream = stream;
try
{
size = stream.available();
if (stream.markSupported())
{
try {
if (stream.markSupported()) {
stream.mark(nrOfBytes);
final byte[] b = new byte[nrOfBytes];
final int read = stream.read(b, 0, Math.min(size, b.length));
bytes = new byte[read];
System.arraycopy(b, 0, bytes, 0, read);
bytes = IOUtils.toByteArray(stream, nrOfBytes, MAX_RECORD_LENGTH);
stream.reset();
} else {
bytes = new byte[0];
}
}
catch (IOException ex)
{
size = bytes.length + stream.available();
} catch (IOException ex) {
System.out.println(ex);
}
}

View File

@ -57,23 +57,16 @@ public class DocumentDescriptorRenderer extends DefaultTreeCellRenderer
/**
* <p>Renders {@link DocumentDescriptor} as a string.</p>
*/
protected String renderAsString(final DocumentDescriptor d)
{
final StringBuilder b = new StringBuilder();
b.append("Name: ");
b.append(d.name);
b.append(" ");
b.append(HexDump.toHex(d.name));
b.append("\n");
b.append("Size: ");
b.append(d.size);
b.append(" bytes\n");
b.append("First bytes: ");
b.append(HexDump.toHex(d.bytes));
return b.toString();
protected String renderAsString(final DocumentDescriptor d) {
return "Name: " +
d.name +
" " +
HexDump.toHex(d.name) +
"\n" +
"Size: " +
d.size +
" bytes\n" +
"First bytes: " +
HexDump.toHex(d.bytes);
}
}

View File

@ -46,7 +46,7 @@ public class ExtendableTreeCellRenderer implements TreeCellRenderer
public ExtendableTreeCellRenderer()
{
renderers = new HashMap<Class<?>,TreeCellRenderer>();
renderers = new HashMap<>();
register(Object.class, new DefaultTreeCellRenderer()
{
@Override

View File

@ -19,7 +19,7 @@ package org.apache.poi.poifs.poibrowser;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import javax.swing.JFrame;
@ -42,12 +42,6 @@ import org.apache.poi.poifs.eventfilesystem.POIFSReader;
public class POIBrowser extends JFrame
{
/**
* <p>The tree's root node must be visible to all methods.</p>
*/
protected MutableTreeNode rootNode;
/**
* <p>Takes a bunch of file names as command line parameters,
@ -59,8 +53,6 @@ public class POIBrowser extends JFrame
new POIBrowser().run(args);
}
protected void run(String[] args)
{
addWindowListener(new WindowAdapter()
@ -74,8 +66,11 @@ public class POIBrowser extends JFrame
/* Create the tree model with a root node. The latter is
* invisible but it must be present because a tree model
* always needs a root. */
rootNode = new DefaultMutableTreeNode("POI Filesystems");
* always needs a root.
*
* The tree's root node must be visible to all methods.
*/
MutableTreeNode rootNode = new DefaultMutableTreeNode("POI Filesystems");
DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
/* Create the tree UI element. */
@ -84,21 +79,17 @@ public class POIBrowser extends JFrame
/* Add the POI filesystems to the tree. */
int displayedFiles = 0;
for (int i = 0; i < args.length; i++)
{
final String filename = args[i];
for (final String filename : args) {
try {
FileInputStream fis = new FileInputStream(filename);
POIFSReader r = new POIFSReader();
r.registerListener(new TreeReaderListener(filename, rootNode));
r.read(fis);
fis.close();
r.read(new File(filename));
displayedFiles++;
} catch (IOException ex) {
System.err.println(filename + ": " + ex);
} catch (Exception t) {
System.err.println("Unexpected exception while reading \"" +
filename + "\":");
filename + "\":");
t.printStackTrace(System.err);
}
}

View File

@ -159,7 +159,7 @@ public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
b.append(' ');
System.arraycopy(value, ((byte[])value).length - 4, buf, 0, 4);
} else if (value != null) {
b.append(value.toString());
b.append(value);
} else {
b.append("null");
}

View File

@ -49,7 +49,7 @@ import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
* but it could be any other string.</p>
*
* <p>The value of a tree node is a {@link DocumentDescriptor}. Unlike
* a {@link org.apache.poi.poifs.filesystem.POIFSDocument} which may be as heavy
* a {@link org.apache.poi.poifs.filesystem.OPOIFSDocument} which may be as heavy
* as many megabytes, an instance of {@link DocumentDescriptor} is a
* light-weight object and contains only some meta-information about a
* document.</p>
@ -96,7 +96,7 @@ public class TreeReaderListener implements POIFSReaderListener
{
this.filename = filename;
this.rootNode = rootNode;
pathToNode = new HashMap<Object,MutableTreeNode>(15); // Should be a reasonable guess.
pathToNode = new HashMap<>(15); // Should be a reasonable guess.
}

View File

@ -202,13 +202,13 @@ import org.apache.poi.util.IOUtils;
public class AddDimensionedImage {
// Four constants that determine how - and indeed whether - the rows
// and columns an image may overlie should be expanded to accomodate that
// and columns an image may overlie should be expanded to accommodate that
// image.
// Passing EXPAND_ROW will result in the height of a row being increased
// to accomodate the image if it is not already larger. The image will
// to accommodate the image if it is not already larger. The image will
// be layed across one or more columns.
// Passing EXPAND_COLUMN will result in the width of the column being
// increased to accomodate the image if it is not already larger. The image
// increased to accommodate the image if it is not already larger. The image
// will be layed across one or many rows.
// Passing EXPAND_ROW_AND_COLUMN will result in the height of the row
// bing increased along with the width of the column to accomdate the
@ -333,10 +333,10 @@ public class AddDimensionedImage {
URL imageFile, double reqImageWidthMM, double reqImageHeightMM,
int resizeBehaviour) throws IOException,
IllegalArgumentException {
ClientAnchor anchor = null;
ClientAnchorDetail rowClientAnchorDetail = null;
ClientAnchorDetail colClientAnchorDetail = null;
int imageType = 0;
ClientAnchor anchor;
ClientAnchorDetail rowClientAnchorDetail;
ClientAnchorDetail colClientAnchorDetail;
int imageType;
// Validate the resizeBehaviour parameter.
if((resizeBehaviour != AddDimensionedImage.EXPAND_COLUMN) &&
@ -348,7 +348,7 @@ public class AddDimensionedImage {
}
// Call methods to calculate how the image and sheet should be
// manipulated to accomodate the image; columns and then rows.
// manipulated to accommodate the image; columns and then rows.
colClientAnchorDetail = this.fitImageToColumns(sheet, colNumber,
reqImageWidthMM, resizeBehaviour);
rowClientAnchorDetail = this.fitImageToRows(sheet, rowNumber,
@ -365,12 +365,16 @@ public class AddDimensionedImage {
anchor.setDx1(0);
anchor.setDy1(0);
anchor.setDx2(colClientAnchorDetail.getInset());
anchor.setDy2(rowClientAnchorDetail.getInset());
anchor.setCol1(colClientAnchorDetail.getFromIndex());
anchor.setRow1(rowClientAnchorDetail.getFromIndex());
anchor.setCol2(colClientAnchorDetail.getToIndex());
anchor.setRow2(rowClientAnchorDetail.getToIndex());
if (colClientAnchorDetail != null) {
anchor.setDx2(colClientAnchorDetail.getInset());
anchor.setCol1(colClientAnchorDetail.getFromIndex());
anchor.setCol2(colClientAnchorDetail.getToIndex());
}
if (rowClientAnchorDetail != null) {
anchor.setDy2(rowClientAnchorDetail.getInset());
anchor.setRow1(rowClientAnchorDetail.getFromIndex());
anchor.setRow2(rowClientAnchorDetail.getToIndex());
}
// For now, set the anchor type to do not move or resize the
// image as the size of the row/column is adjusted. This could easily
@ -427,16 +431,16 @@ public class AddDimensionedImage {
private ClientAnchorDetail fitImageToColumns(Sheet sheet, int colNumber,
double reqImageWidthMM, int resizeBehaviour) {
double colWidthMM = 0.0D;
double colCoordinatesPerMM = 0.0D;
int pictureWidthCoordinates = 0;
double colWidthMM;
double colCoordinatesPerMM;
int pictureWidthCoordinates;
ClientAnchorDetail colClientAnchorDetail = null;
// Get the colum's width in millimetres
colWidthMM = ConvertImageUnits.widthUnits2Millimetres(
(short)sheet.getColumnWidth(colNumber));
// Check that the column's width will accomodate the image at the
// Check that the column's width will accommodate the image at the
// required dimension. If the width of the column is LESS than the
// required width of the image, decide how the application should
// respond - resize the column or overlay the image across one or more
@ -496,7 +500,7 @@ public class AddDimensionedImage {
}
/**
* Determines whether the sheets row should be re-sized to accomodate
* Determines whether the sheets row should be re-sized to accommodate
* the image, adjusts the rows height if necessary and creates then
* returns a ClientAnchorDetail object that facilitates construction of
* a ClientAnchor that will fix the image on the sheet and establish
@ -522,10 +526,10 @@ public class AddDimensionedImage {
*/
private ClientAnchorDetail fitImageToRows(Sheet sheet, int rowNumber,
double reqImageHeightMM, int resizeBehaviour) {
Row row = null;
double rowHeightMM = 0.0D;
double rowCoordinatesPerMM = 0.0D;
int pictureHeightCoordinates = 0;
Row row;
double rowHeightMM;
double rowCoordinatesPerMM;
int pictureHeightCoordinates;
ClientAnchorDetail rowClientAnchorDetail = null;
// Get the row and it's height
@ -538,7 +542,7 @@ public class AddDimensionedImage {
// Get the row's height in millimetres
rowHeightMM = row.getHeightInPoints() / ConvertImageUnits.POINTS_PER_MILLIMETRE;
// Check that the row's height will accomodate the image at the required
// Check that the row's height will accommodate the image at the required
// dimensions. If the height of the row is LESS than the required height
// of the image, decide how the application should respond - resize the
// row or overlay the image across a series of rows.
@ -612,13 +616,13 @@ public class AddDimensionedImage {
private ClientAnchorDetail calculateColumnLocation(Sheet sheet,
int startingColumn,
double reqImageWidthMM) {
ClientAnchorDetail anchorDetail = null;
ClientAnchorDetail anchorDetail;
double totalWidthMM = 0.0D;
double colWidthMM = 0.0D;
double overlapMM = 0.0D;
double coordinatePositionsPerMM = 0.0D;
double overlapMM;
double coordinatePositionsPerMM;
int toColumn = startingColumn;
int inset = 0;
int inset;
// Calculate how many columns the image will have to
// span in order to be presented at the required size.
@ -722,14 +726,14 @@ public class AddDimensionedImage {
*/
private ClientAnchorDetail calculateRowLocation(Sheet sheet,
int startingRow, double reqImageHeightMM) {
ClientAnchorDetail clientAnchorDetail = null;
Row row = null;
ClientAnchorDetail clientAnchorDetail;
Row row;
double rowHeightMM = 0.0D;
double totalRowHeightMM = 0.0D;
double overlapMM = 0.0D;
double rowCoordinatesPerMM = 0.0D;
double overlapMM;
double rowCoordinatesPerMM;
int toRow = startingRow;
int inset = 0;
int inset;
// Step through the rows in the sheet and accumulate a total of their
// heights.
@ -813,27 +817,22 @@ public class AddDimensionedImage {
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
String imageFile = null;
String outputFile = null;
FileOutputStream fos = null;
Workbook workbook = null;
Sheet sheet = null;
if(args.length < 2){
System.err.println("Usage: AddDimensionedImage imageFile outputFile");
return;
}
workbook = new HSSFWorkbook(); // OR XSSFWorkbook
sheet = workbook.createSheet("Picture Test");
imageFile = args[0];
outputFile = args[1];
new AddDimensionedImage().addImageToSheet("B5", sheet, sheet.createDrawingPatriarch(),
new File(imageFile).toURI().toURL(), 100, 40,
AddDimensionedImage.EXPAND_ROW_AND_COLUMN);
fos = new FileOutputStream(outputFile);
workbook.write(fos);
fos.close();
workbook.close();
final String imageFile = args[0];
final String outputFile = args[1];
try (final Workbook workbook = new HSSFWorkbook();
final FileOutputStream fos = new FileOutputStream(outputFile)) { // OR XSSFWorkbook
Sheet sheet = workbook.createSheet("Picture Test");
new AddDimensionedImage().addImageToSheet("B5", sheet, sheet.createDrawingPatriarch(),
new File(imageFile).toURI().toURL(), 100, 40,
AddDimensionedImage.EXPAND_ROW_AND_COLUMN);
workbook.write(fos);
}
}
/**
@ -864,9 +863,9 @@ public class AddDimensionedImage {
*/
public class ClientAnchorDetail {
public int fromIndex = 0;
public int toIndex = 0;
public int inset = 0;
public int fromIndex;
public int toIndex;
public int inset;
/**
* Create a new instance of the ClientAnchorDetail class using the
@ -962,8 +961,6 @@ public class AddDimensionedImage {
/**
* pixel units to excel width units(units of 1/256th of a character width)
* @param pxs
* @return
*/
public static short pixel2WidthUnits(int pxs) {
short widthUnits = (short) (EXCEL_COLUMN_WIDTH_FACTOR *
@ -975,9 +972,6 @@ public class AddDimensionedImage {
/**
* excel width units(units of 1/256th of a character width) to pixel
* units.
*
* @param widthUnits
* @return
*/
public static int widthUnits2Pixel(short widthUnits) {
int pixels = (widthUnits / EXCEL_COLUMN_WIDTH_FACTOR)

Some files were not shown because too many files have changed in this diff Show More