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
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
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
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
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
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
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
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
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
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
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
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
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
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
This removes the POILogger and POILogFactory mechanism for logging. This mechanism was created at a time when the Java landscape looked very different than it does today.
Log4j 2 is an Apache Foundation project that is well maintained and is widely regarded as having good performance and capabilities. We use only the Log4j API artifact. This lets application developers choose how they want to capture logging events if at all. Integrations with Log4j 2 Core and Logback are available from the Log4j project.
Closes#224
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886770 13f79535-47bb-0310-9956-ffa450edef68