From 7aa04fa14c2c3d8b42e384b1e38a59587421a4be Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 13 Dec 2023 14:25:32 +0300 Subject: [PATCH] Add getcontainsParent to GFPDStructElem --- .../java/org/verapdf/gf/model/impl/pd/GFPDStructElem.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDStructElem.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDStructElem.java index 0339124e4..cd72dbdb8 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDStructElem.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDStructElem.java @@ -120,6 +120,9 @@ public String getparentStandardType() { parentStandardStructureType = org.verapdf.pd.structure.PDStructElem.getStructureElementStandardStructureType(parent); parentStandardType = parentStandardStructureType != null ? parentStandardStructureType.getType().getValue() : null; } + if (parent.getType() == ASAtom.STRUCT_TREE_ROOT) { + return ASAtom.STRUCT_TREE_ROOT.getValue(); + } if (org.verapdf.pd.structure.PDStructElem.isMathStandardType(parentStandardStructureType)) { return TaggedPDFConstants.MATH_ML; } @@ -128,6 +131,11 @@ public String getparentStandardType() { return null; } + @Override + public Boolean getcontainsParent() { + return ((org.verapdf.pd.structure.PDStructElem) simplePDObject).getParent() != null; + } + @Override public String getvalueS() { COSName type = ((org.verapdf.pd.structure.PDStructElem) this.simplePDObject).getCOSStructureType();