From b981876d8695975cec855ea908dfd2c780485726 Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Thu, 25 Apr 2024 12:14:35 +0300 Subject: [PATCH] update common models --- .../wordfiletransformer/word/WordBuilderImpl.java | 10 +++++----- pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/eu/eudat/file/transformer/service/wordfiletransformer/word/WordBuilderImpl.java b/core/src/main/java/eu/eudat/file/transformer/service/wordfiletransformer/word/WordBuilderImpl.java index 4264eb8..e45ef7c 100644 --- a/core/src/main/java/eu/eudat/file/transformer/service/wordfiletransformer/word/WordBuilderImpl.java +++ b/core/src/main/java/eu/eudat/file/transformer/service/wordfiletransformer/word/WordBuilderImpl.java @@ -326,7 +326,7 @@ public class WordBuilderImpl implements WordBuilder { // CTDecimalNumber number = paragraph.getCTP().getPPr().getNumPr().addNewIlvl(); // number.setVal(BigInteger.valueOf(indent)); paragraphPos = mainDocumentPart.getPosOfParagraph(paragraph); - if (!fieldSetModel.getMultiplicity().getTableView() && propertyDefinitionFieldSetItemModels.size() > 1) { + if (fieldSetModel.getMultiplicity() != null && !fieldSetModel.getMultiplicity().getTableView() && propertyDefinitionFieldSetItemModels.size() > 1) { XWPFParagraph paragraphInner = addParagraphContent(c + ". ", mainDocumentPart, ParagraphStyle.TEXT, numId, indent); paragraphPosInner = mainDocumentPart.getPosOfParagraph(paragraphInner); hasMultiplicityItems = true; @@ -336,7 +336,7 @@ public class WordBuilderImpl implements WordBuilder { XWPFTable tbl = null; XWPFTableRow row = null; int numOfRows = 0; - if (fieldSetModel.getMultiplicity().getTableView()) { + if (fieldSetModel.getMultiplicity() != null && fieldSetModel.getMultiplicity().getTableView()) { tbl = mainDocumentPart.createTable(); tbl.setTableAlignment(TableRowAlign.CENTER); mainDocumentPart.createParagraph(); @@ -344,7 +344,7 @@ public class WordBuilderImpl implements WordBuilder { numOfRows = tbl.getRows().size(); row = tbl.createRow(); } - if (fieldSetModel.getMultiplicity().getTableView()) { + if (fieldSetModel.getMultiplicity() != null && fieldSetModel.getMultiplicity().getTableView()) { hasValue = createFieldsInTable(fieldSetModel, propertyDefinitionFieldSetItemModels.getFirst(), row, indent, createListing, hasMultiplicityItems, numOfRows, visibilityService); numOfRows++; } else { @@ -360,7 +360,7 @@ public class WordBuilderImpl implements WordBuilder { if (propertyDefinitionFieldSetItemModels.size() > 1) { for (PropertyDefinitionFieldSetItemModel multiplicityFieldset : propertyDefinitionFieldSetItemModels.stream().skip(1).toList()) { paragraphPosInner = -1; - if (!fieldSetModel.getMultiplicity().getTableView() && !createListing) { + if (fieldSetModel.getMultiplicity() != null && !fieldSetModel.getMultiplicity().getTableView() && !createListing) { c++; // addParagraphContent(c + ". ", mainDocumentPart, ParagraphStyle.HEADER6, numId); XWPFParagraph paragraphInner = addParagraphContent(c + ". ", mainDocumentPart, ParagraphStyle.TEXT, numId, indent); @@ -370,7 +370,7 @@ public class WordBuilderImpl implements WordBuilder { } // hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService, hasMultiplicityItems); boolean hasValueInner = false; - if (fieldSetModel.getMultiplicity().getTableView()) { + if (fieldSetModel.getMultiplicity() != null && fieldSetModel.getMultiplicity().getTableView()) { row = tbl.createRow(); hasValueInner = createFieldsInTable(fieldSetModel, multiplicityFieldset, row, indent, createListing, hasMultiplicityItems, numOfRows, visibilityService); numOfRows++; diff --git a/pom.xml b/pom.xml index a01b2bd..a806fb4 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ gr.cite.opendmp file-transformer-base - 0.0.13 + 0.0.14 org.yaml