Skip to content

Commit

Permalink
WCAG. Fix exceptions
Browse files Browse the repository at this point in the history
MaximPlusov authored and bdoubrov committed Apr 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent cba668e commit d3d600b
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -706,9 +706,15 @@ private List<Double> parseTextShowArgument(COSBase argument, StringBuilder unico
}
}
unicodeValue.append(textPieces.getValue());
textMatrix.concatenate(Matrix.getTranslateInstance(textPieces.getStartX(), 0));
if (!textPieces.isEmpty()) {
textMatrix.concatenate(Matrix.getTranslateInstance(textPieces.getStartX(), 0));
}
textRenderingMatrix.concatenate(calculateTextRenderingMatrix());
textMatrix.concatenate(Matrix.getTranslateInstance(textPieces.getEndX() - textPieces.getStartX(), 0));
if (!textPieces.isEmpty()) {
textMatrix.concatenate(Matrix.getTranslateInstance(textPieces.getEndX() - textPieces.getStartX(), 0));
} else {
textMatrix.concatenate(Matrix.getTranslateInstance(textPieces.getCurrentX(), 0));
}
symbolEnds = textPieces.getSymbolEnds();
}
symbolEnds.add(0, 0.0);
Original file line number Diff line number Diff line change
@@ -58,6 +58,10 @@ public double getCurrentX() {
public void shiftCurrentX(double shift) {
currentX += shift;
}

public boolean isEmpty() {
return textPieces.isEmpty();
}

public void setCurrentX(double currentX) {
this.currentX = currentX;
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
*/
package org.verapdf.gf.model.impl.sa;

import org.verapdf.cos.COSKey;
import org.verapdf.wcag.algorithms.entities.INode;
import org.verapdf.wcag.algorithms.entities.SemanticNode;
import org.verapdf.wcag.algorithms.entities.maps.SemanticTypeMapper;
@@ -35,10 +36,15 @@ public class GFSANode extends SemanticNode {

public GFSANode(GFSAStructElem structElem) {
super(SemanticTypeMapper.getSemanticType(structElem.getstandardType()), structElem.getErrorCodes(),
structElem.getErrorArguments(), structElem.getStructElemDictionary().getObject().getKey().getNumber());
structElem.getErrorArguments(), getObjectKeyNumber(structElem));
this.structElem = structElem;
setAttributesDictionary(new GFSAAttributesDictionary(structElem.getStructElemDictionary()));
}

private static Integer getObjectKeyNumber(GFSAStructElem structElem) {
COSKey key = structElem.getStructElemDictionary().getObject().getKey();
return key != null ? key.getNumber() : null;
}

@Override
public List<INode> getChildren() {

0 comments on commit d3d600b

Please sign in to comment.