Commit Graph

10850 Commits

Author SHA1 Message Date
Marius Volkhart 21ba7dc108 Specify more granular Batik dependencies
Batik-all is a strange artifact. It's POM declares dependencies on all the sub-JARs, but its JAR has all of the sub-jars repackaged. This results in multiple JARs with the same packages being added to consuming applications. This leads to problems for JPMS users. See [bug-65183].

The Ant build does not use batik-all, so the Maven and Gradle builds should not either.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887642 13f79535-47bb-0310-9956-ffa450edef68
2021-03-14 18:51:12 +00:00
Marius Volkhart bce76497fe Disable parallel tests on Gradle again
Something is causing parallel tests to fail on CI. I haven't been able to track down what it is. The symptoms look similar to others where the cause was a test modifying the test-data directory.

The integration tests also sometimes run into OutOfMemoryErrors when I run them in parallel.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887631 13f79535-47bb-0310-9956-ffa450edef68
2021-03-14 11:31:18 +00:00
Marius Volkhart 677ae9b8b9 Limit which tests can run in parallel
Some tests modify global resources. Those tests cannot be run in parallel with others, as they cause problems or become flaky. Where possible, indicate to JUnit the resources in contention. Otherwise, mark the tests as needing to run in isolation.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887630 13f79535-47bb-0310-9956-ffa450edef68
2021-03-14 10:42:15 +00:00
Marius Volkhart 5d77d4e798 Get Gradle GitHub Action past downloading the XMLBeans JAR
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887614 13f79535-47bb-0310-9956-ffa450edef68
2021-03-14 01:46:05 +00:00
PJ Fanning c70b649e73 [bug-65184] Improve performance of POFSMiniStore getBlockAt. Thanks to sits
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887604 13f79535-47bb-0310-9956-ffa450edef68
2021-03-13 18:09:13 +00:00
PJ Fanning 5758145ce8 update key
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887516 13f79535-47bb-0310-9956-ffa450edef68
2021-03-11 21:39:48 +00:00
Marius Volkhart 6a967ae622 Streamline HPSF CustomProperties collection retrieval
Reduce the number of map lookups necessary to compute the return values for methods that return collections of property details. Since we maintain parity between the `props` and `dictionary` contents, when retrieving property details, we can reference the `props` directly and avoid the `dictionary` indirection.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887453 13f79535-47bb-0310-9956-ffa450edef68
2021-03-10 21:42:19 +00:00
Andreas Beeker 74b4a460b2 update key for kiwiwings - downrating sha1 - see https://infra.apache.org/release-signing.html
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887398 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 22:04:11 +00:00
Marius Volkhart e4f6756c93 Parse PPDrawing more deterministically
The [MS-PPT] spec is very clear about what the format of the PPDrawing record must be, and parsing deterministically makes for clearer code.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887396 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 20:59:24 +00:00
Marius Volkhart 7db6fa4ba1 Additional debug logging for unknown records in HSLF
Recently, while debugging app behavior on HSLF documents, I had to dig into the OOXML that Microsoft PowerPoint places into files saved in PPT format. Having information in the logs about when records were not parsed by POI was very helpful. The hex identifier was critical in being able to quickly search the [MS-PPT] spec for what type of record it was, and the integer identifier was helpful in quickly finding the Record type in RecordTypes.java.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887393 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 19:26:31 +00:00
Marius Volkhart c05dbedbc5 Cleanup documentation of EscherChildAnchorRecord and EscherClientAnchorRecord
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887391 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 18:28:59 +00:00
Andreas Beeker cee9eb7e2b try to fix windows path issues in exception messages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887346 13f79535-47bb-0310-9956-ffa450edef68
2021-03-08 23:14:11 +00:00
Andreas Beeker afbef57d35 raise XmlBeans to 5.0.0 (nightly) also in the gradle build
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887345 13f79535-47bb-0310-9956-ffa450edef68
2021-03-08 22:36:08 +00:00
Andreas Beeker 943b18f8d1 remove old batik jar
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887344 13f79535-47bb-0310-9956-ffa450edef68
2021-03-08 22:29:26 +00:00
Andreas Beeker e4e7f3842a Use XmlBeans 5 nightly
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887309 13f79535-47bb-0310-9956-ffa450edef68
2021-03-08 00:35:10 +00:00
PJ Fanning 78452956ce add DeferredGeneration sample
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887250 13f79535-47bb-0310-9956-ffa450edef68
2021-03-06 09:10:58 +00:00
PJ Fanning d3c7aa4dcf convert tabs to spaces
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887239 13f79535-47bb-0310-9956-ffa450edef68
2021-03-06 01:51:17 +00:00
PJ Fanning 90e58b6a04 add DeferredGeneration sample
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887238 13f79535-47bb-0310-9956-ffa450edef68
2021-03-06 01:48:57 +00:00
Marius Volkhart 86dec87499 Remove unnecessary array conversion in HWPF FSPATable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887044 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 19:06:28 +00:00
Marius Volkhart 8ea3d2274d Remove deprecated HWPF FSPA methods
These methods have been @Deprecated for years, and are part of @Internal structures.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887039 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 18:46:35 +00:00
Marius Volkhart a134b9abb3 Improve performance of HSLFPictureData#write
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887022 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 00:37:11 +00:00
Marius Volkhart 8ab53c6489 Deprecate functions that duplicate functionality
DrawingGroupRecord#processChildRecords and AbstractEscherHolderRecord#convertRawBytesToEscherRecords duplicate the functionality of AbstractEscherHolderRecord#decode. This makes the code harder to follow, as it is not clear when certain access patterns repeat. Accordingly, these functions are deprecated and flagged for removal.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887021 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 00:25:23 +00:00
Marius Volkhart 402d0fc5e5 Review EscherContainerRecord#getChildRecords() call sites for unnecessary work
This started off as wanting to add the EscherContainerRecord#getChildCount() function in order to do an efficient check for how many children the container has. This was desirable in new code for editing HSSF pictures. The existing option of calling getChildRecords().size() was undesirable as this requires a list copy first.

In the process of finding call sites that would benefit from replacing getChildRecords().size(), I realized that several other patterns would benefit from eliminating a copy, such as iterating over the children in a for-each loop, and indexed access to specific children.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887020 13f79535-47bb-0310-9956-ffa450edef68
2021-03-01 00:04:51 +00:00
Marius Volkhart d1c9a07860 Add the ability to edit HSLFPictureData contents
Pictures can now be edited by calling HSLFPictureData#setData(byte[]). The byte[] should contain the image data as an image viewer might read it.

To enable this functionality, a tighter coupling between the EscherBSERecords of the slideshow and the HSLFPictureData was required. This ensures that changes in image data size are accurately recorded in the records.

In the course of coupling the records and the HSLFPictureData, various scenarios arose where a mapping of records to pictures was non-trivial. Accordingly, the HSLFSlideShowImpl#matchPicturesAndRecords(...) function was added to perform a more sophisticated matching pass. This function is heavily exercised by org.apache.poi.hslf.usermodel.TestBugs.testFile[5] and PPTX2PNG.render[2], as well as the new TestPictures#testSlideshowWithIncorrectOffsets().

Closes #225

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887017 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 23:16:14 +00:00
Marius Volkhart 77ec895ee0 Make picture loading in HWPF PicturesTable easier to understand
The recursion is no longer necessary due to the more defined structure of OfficeArtContent.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887016 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 21:06:05 +00:00
Marius Volkhart c08763fad0 Add documentation to PICFAndOfficeArtData
Adjust call sites based on defined behavior.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887015 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 20:44:39 +00:00
PJ Fanning 39ac99440e change gradle build to get unreleased xmlbeans jar from ci-builds (like ant build does)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887012 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 19:48:22 +00:00
Marius Volkhart 5350121bfe Simplify OfficeArtContent#getBStoreContainer method
Due to the new structure of the class, we can be more specific about how we load the BStore.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887011 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 19:40:23 +00:00
PJ Fanning b02866c2a7 change gradle build to get unreleased xmlbeans jar from ci-builds (like ant build does)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887010 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 19:28:39 +00:00
Marius Volkhart e7b9a5af13 Rename EscherRecordHolder to OfficeArtContent
While the class does indeed hold EscherRecords, due to recent refactoring it is much more structured now than it was before. The contents of the class now closely resemble the OfficeArtContent structure referenced in the MS-DOC spec. Naming the class after the specification structure makes it easier to find and understand.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887009 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 19:18:13 +00:00
Marius Volkhart 9c88bb2201 Rework EscherRecordHolder parsing
Modify the parsing done by EscherRecordHolder to be more deterministic. The format of the OfficeArtContent structure, which the EscherRecordHolder represents, is well defined in the MS-DOC spec. A clear class structure makes it easier to reason about the availability of data.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887008 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 18:49:42 +00:00
Marius Volkhart fab0ec3e08 Add documentation to EscherRecordTypes#DG_CONTAINER
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887007 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 18:39:51 +00:00
Marius Volkhart b7038df14d Simplify initialization of HWPF EscherRecordHolder
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886999 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 16:47:43 +00:00
Marius Volkhart 12857e68ac Add documentation for HWPF FileInformationBlock DggInfo methods
This documentation comes from [MS-DOC] - v20191119.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886998 13f79535-47bb-0310-9956-ffa450edef68
2021-02-28 15:08:39 +00:00
Marius Volkhart cfee75c9b6 Revert "Replace magic constant with reference" changes
Reverts r1886986, r1886987 and r1886988. Incorrect conversion between int and shorts led to incorrect logic.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886989 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 19:08:49 +00:00
Marius Volkhart 66e08f08d3 Replace magic constant use of Escher Blip End type ID with reference
Instead of referring to the magic constant 0xF117, reference the value in the EscherRecordTypes enum.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886988 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 18:33:56 +00:00
Marius Volkhart b9bbac0005 Replace magic constant use of Escher Blip Start type ID with reference
Instead of referring to the magic constant 0xF018, reference the value in the EscherRecordTypes enum.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886987 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 18:26:36 +00:00
Marius Volkhart d543e89185 Replace magic constant use of EscherBSERecord type ID with reference
Instead of referring to the magic constant 0xF007, reference the value in the EscherRecordTypes enum.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886986 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 18:22:33 +00:00
PJ Fanning 16561e85c7 add missing license
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886965 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 01:29:21 +00:00
Marius Volkhart 50757bca8e Fix bug with record indexes for HSSF Workbooks
We have encountered workbooks that do not have a TabIdRecord (see 55982.xls). However, the WorkbookRecordList#updateRecordPos() method would still increment the position of the TabIdRecord for such workbooks. Changing the default position of the record from 0 to -1 indicates that the record position has now been set.

This bug was discovered while adding support for editing pictures in HSSF documents.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886963 13f79535-47bb-0310-9956-ffa450edef68
2021-02-27 00:43:56 +00:00
Marius Volkhart 451684aa91 Enable running more integration tests from Gradle.
This is particularly relevant for developers who import the Gradle project into their IDE and run tests using the Gradle test runner. Those developers were previously unable to debug integration tests.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886962 13f79535-47bb-0310-9956-ffa450edef68
2021-02-26 22:14:17 +00:00
Marius Volkhart 0fbf8f2e58 Remove the integrationTest task from the Gradle integrationtest project
This task adds no additional configuration over the regular test task.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886961 13f79535-47bb-0310-9956-ffa450edef68
2021-02-26 22:07:14 +00:00
Marius Volkhart a49347e8d0 Remove the test exclusion for RecordStresser and RecordsStresser from Gradle integration tests
These classes don't exist.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886960 13f79535-47bb-0310-9956-ffa450edef68
2021-02-26 22:05:16 +00:00
Marius Volkhart 6fe733c92a Enable parallel tests from Gradle
Parallel tests are already enabled from Ant. This does the same for Gradle users.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886959 13f79535-47bb-0310-9956-ffa450edef68
2021-02-26 21:15:12 +00:00
PJ Fanning 7a10b863f6 xmlsec version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886893 13f79535-47bb-0310-9956-ffa450edef68
2021-02-24 21:42:01 +00:00
PJ Fanning bba9aa2b66 missing ooxml-schemas-lite classes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886892 13f79535-47bb-0310-9956-ffa450edef68
2021-02-24 21:26:33 +00:00
Andreas Beeker 72ad5857f4 include batik in poi-bin artifact
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886863 13f79535-47bb-0310-9956-ffa450edef68
2021-02-23 22:29:51 +00:00
Andreas Beeker 6470765bbe add batik to forbidden-apis-check classpath
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886862 13f79535-47bb-0310-9956-ffa450edef68
2021-02-23 21:59:56 +00:00
Marius Volkhart 3c9f29a8c2 [bug-63046] Fix Java 16 build
org.apache.santuario:xmlsec:2.2.0 has a dependency on SLF4J. We use this in SignatureInfo.java.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886811 13f79535-47bb-0310-9956-ffa450edef68
2021-02-22 18:27:14 +00:00
Andreas Beeker eb30f2e1c8 Use upcoming XmlBeans 5.0.0 (working version 4.0.1)
Make batik optional as it doesn't work on the module-path
Use sub-components of batik as batik-all references them all again resulting in duplicated entries (maven poms haven't been migrated yet ...)
Remove SLF4j dependency

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886777 13f79535-47bb-0310-9956-ffa450edef68
2021-02-22 00:18:37 +00:00