Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend CustomWordPlaceholderData to insert into header/footer #252

Merged
merged 1 commit into from
May 28, 2024

Conversation

AntonOellerer
Copy link
Contributor

Up until now, the processing flow when inserting a paragraph into a header or footer lead to a ClassCastException, as jocument assumed that the insertion happened into a XWPFDocument.
To fix this, the abstract method for transforming a placeholder now expects an IBody element instead of a XWPFDocument, where IBody is an interface which describes the possible insertion methods.
This allows jocument to insert paragraphs into any kind of xwpf part.

@AntonOellerer AntonOellerer added the bug Something isn't working label May 28, 2024
@AntonOellerer AntonOellerer requested a review from alexpartsch May 28, 2024 12:29
@AntonOellerer AntonOellerer self-assigned this May 28, 2024
Up until now, the processing flow when inserting a paragraph into
a header or footer lead to a `ClassCastException`, as
jocument assumed that the insertion happened into a
`XWPFDocument`.
To fix this, the abstract method for transforming a placeholder
now expects an `IBody` element instead of a `XWPFDocument`, where
`IBody` is an interface which describes the possible insertion
methods.
This allows jocument to insert paragraphs into any kind of
xwpf part.
@AntonOellerer AntonOellerer force-pushed the fix/insert-into-header-footer branch from f3ee686 to 22e62ce Compare May 28, 2024 12:30
@alexpartsch alexpartsch merged commit 6672eb3 into main May 28, 2024
@alexpartsch alexpartsch deleted the fix/insert-into-header-footer branch May 28, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants