Skip to content

Commit

Permalink
Fix getStructureTypeStandardStructureType
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Aug 6, 2024
1 parent 96773e7 commit 009749f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/verapdf/pd/structure/PDStructElem.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static StructureType getStructureTypeStandardStructureType(StructureType
}
if (!PDFFlavour.isFlavourPDFSpecification(flavour, PDFFlavour.PDFSpecification.ISO_32000_2_0) || PDFFlavour.isFlavourFamily(flavour, PDFFlavour.SpecificationFamily.WCAG)) {
if (type != null) {
return new StructureType(ASAtom.getASAtom(
return StructureType.createStructureType(ASAtom.getASAtom(
StaticResources.getRoleMapHelper().getStandardType(type.getType())), type.getNameSpace());
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/verapdf/pd/structure/StructureType.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class StructureType {
private final ASAtom type;
private final PDStructureNameSpace nameSpace;

public StructureType(ASAtom type, PDStructureNameSpace nameSpace) {
private StructureType(ASAtom type, PDStructureNameSpace nameSpace) {
this.type = type;
this.nameSpace = nameSpace;
}
Expand Down Expand Up @@ -62,6 +62,13 @@ public static StructureType createStructureType(COSObject type, COSObject ns) {
return null;
}

public static StructureType createStructureType(ASAtom type, PDStructureNameSpace nameSpace) {
if (type != null) {
return new StructureType(type, nameSpace);
}
return null;
}

public static StructureType createStructureType(ASAtom type) {
if (type != null) {
return new StructureType(type, null);
Expand Down

0 comments on commit 009749f

Please sign in to comment.