Quick and Dirty fix of the Nullpointer Exception when calling li tags…#89
Closed
ChristophKronberger wants to merge 2 commits into
Closed
Quick and Dirty fix of the Nullpointer Exception when calling li tags…#89ChristophKronberger wants to merge 2 commits into
ChristophKronberger wants to merge 2 commits into
Conversation
… without ol or ul container.
…st witch takes a target Part. This can be used to convert XHTML String with Images into Header or Footer. Also added for that the XHTMLImageHandlerDifferentTarget class.
Author
|
I also added a convert Method in XHTML importer, witch takes a TargetPart to add Images in Header or Footer |
Owner
|
closing, since everything here is handled in 17_0_1 |
plutext
added a commit
that referenced
this pull request
Jul 27, 2026
Relationship ids are resolved per part, so XHTML converted for a header or footer had its images added as relationships of the main document part, where the r:embed in the header can't resolve them; the image was missing in Word, and no header1.xml.rels was written at all. XHTMLImageHandlerDefault.setTargetPart names the part images should belong to, using BinaryPartAbstractImage.createImagePart(OpcPackage, Part, byte[]). It defaults to null, meaning the main document part, so existing behaviour is unchanged; XHTMLImageHandler is untouched, so custom implementations still compile. Setting a different target part clears the image part cache: cached parts are relationships of the part they were created for, so reusing one for another target would reintroduce the unresolvable r:embed. Addresses the use case of PR #89, whose implementation stored the target part but never used it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… without ol or ul container.
Since I encountered the same problem as #21 I changed the list helper so that when the .peek() returns null a new standard object is created.
This means that the li tags are not handled, but the null pointer is avoided.