fix missing section titles from word export
This commit is contained in:
parent
14550e0536
commit
815fc05af6
|
@ -191,6 +191,7 @@ public class WordBuilder {
|
||||||
private Boolean createCompositeFields(List<FieldSet> compositeFields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService, Integer page, String section) {
|
private Boolean createCompositeFields(List<FieldSet> compositeFields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService, Integer page, String section) {
|
||||||
if (createListing) this.addListing(mainDocumentPart, indent, true, true);
|
if (createListing) this.addListing(mainDocumentPart, indent, true, true);
|
||||||
boolean hasValue = false;
|
boolean hasValue = false;
|
||||||
|
boolean returnedValue = false;
|
||||||
for (FieldSet compositeField: compositeFields) {
|
for (FieldSet compositeField: compositeFields) {
|
||||||
if (visibilityRuleService.isElementVisible(compositeField.getId()) && hasVisibleFields(compositeField, visibilityRuleService)) {
|
if (visibilityRuleService.isElementVisible(compositeField.getId()) && hasVisibleFields(compositeField, visibilityRuleService)) {
|
||||||
char c = 'a';
|
char c = 'a';
|
||||||
|
@ -205,6 +206,9 @@ public class WordBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||||
|
if(hasValue){
|
||||||
|
returnedValue = true;
|
||||||
|
}
|
||||||
if (compositeField.getMultiplicityItems() != null && !compositeField.getMultiplicityItems().isEmpty()) {
|
if (compositeField.getMultiplicityItems() != null && !compositeField.getMultiplicityItems().isEmpty()) {
|
||||||
List<FieldSet> list = compositeField.getMultiplicityItems().stream().sorted(Comparator.comparingInt(FieldSet::getOrdinal)).collect(Collectors.toList());
|
List<FieldSet> list = compositeField.getMultiplicityItems().stream().sorted(Comparator.comparingInt(FieldSet::getOrdinal)).collect(Collectors.toList());
|
||||||
for (FieldSet multiplicityFieldset : list) {
|
for (FieldSet multiplicityFieldset : list) {
|
||||||
|
@ -213,6 +217,9 @@ public class WordBuilder {
|
||||||
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||||
}
|
}
|
||||||
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||||
|
if(hasValue){
|
||||||
|
returnedValue = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasValue && compositeField.getHasCommentField() && compositeField.getCommentFieldValue() != null && !compositeField.getCommentFieldValue().isEmpty() && !createListing) {
|
if (hasValue && compositeField.getHasCommentField() && compositeField.getCommentFieldValue() != null && !compositeField.getCommentFieldValue().isEmpty() && !createListing) {
|
||||||
|
@ -225,7 +232,7 @@ public class WordBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return hasValue;
|
return returnedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService) {
|
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService) {
|
||||||
|
|
Loading…
Reference in New Issue