Skip to content

Commit

Permalink
Check if custom placeholder before loop
Browse files Browse the repository at this point in the history
If we have a custom placeholder, which is a set,
jocument would attempt to unroll it before it
does the custom placeholder resolving
  • Loading branch information
AntonOellerer committed Feb 15, 2022
1 parent 09170d2 commit c97a7eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.docutools'
version = '1.4.0-alpha.8'
version = '1.4.0-alpha.9'

sourceCompatibility = 17
targetCompatibility = 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ private void generate() {

private void transform(IBodyElement element, List<IBodyElement> remaining) {
logger.debug("Trying to transform element {}", element);
if (isLoopStart(element)) {
unrollLoop((XWPFParagraph) element, remaining);
} else if (isCustomPlaceholder(element)) {
if (isCustomPlaceholder(element)) {
resolver.resolve(WordUtilities.extractPlaceholderName((XWPFParagraph) element))
.ifPresent(placeholderData -> placeholderData.transform(element, options));
} else if (isLoopStart(element)) {
unrollLoop((XWPFParagraph) element, remaining);
} else if (element instanceof XWPFParagraph xwpfParagraph) {
transform(xwpfParagraph);
} else if (element instanceof XWPFTable xwpfTable) {
Expand Down

0 comments on commit c97a7eb

Please sign in to comment.