pjfanning opened a new pull request, #1605: URL: https://github.com/apache/poi/pull/1605
Follow-ups to #1570 and #1571, from reviewing those changes. **`XSSFReader.getSheetDrawingParts`** - An internal drawing relationship whose target is an absolute URI (e.g. `http://example.com/drawing1.xml` without `TargetMode="External"`) failed with an `IllegalArgumentException` when the target was resolved. It is now skipped, like the other unusable targets. - Invalid targets are logged without a stack trace, as a file can hold many of them. The relationship id is logged rather than the target, because resolving the target is what fails. **`XSSFReader.SheetIterator.getShapes`** - A drawing that cannot be parsed is now skipped, instead of the whole call returning null and hiding the shapes of the sheet's other drawings. - The failure is remembered, so the drawing is not parsed again on a later call or for another sheet that shares it. This is a behaviour change: `getShapes()` used to return null when any drawing of the sheet failed to parse. It still returns null when the drawing relationships of the sheet cannot be read. The javadoc is updated. **`XSLFSheet`** - Removing a graphic frame also removes the external relationships it used, e.g. those of the hyperlinks in the cells of a table. `removeRelation` only handles relations to parts of the package, so these were left behind in the sheet's `.rels`. Only reference relationships and relationships with an external target are removed this way. - `getRelationIds` ignores empty ids. An action hyperlink (e.g. to the next slide) has `r:id=""`, which is not the id of a relation, but it caused a scan of the whole sheet each time such a frame was removed. **Tests** New tests in `TestXSSFReader` (`testDrawingRelationshipWithAbsoluteInternalTarget`, `testUnparseableDrawingDoesNotHideOtherDrawings`) and `TestXSLFGraphicFrame` (`testRemoveTableRemovesHyperlinkRelationships`, `testRelationIdsIgnoreActionHyperlinks`). All four fail without the changes to the main code. Run locally: those two test classes, passing. The full test suite is left to CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
