Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions src/core/xfa/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,9 +1225,13 @@ class Caption extends XFAObject {

const children = [];
if (typeof value === "string") {
const parent = this[$getParent]();
const needsSpace = parent?.ui?.checkButton;
children.push({
name: "#text",
value,
value: needsSpace && !value.startsWith("\u00A0")
? "\u00A0" + value
: value,
});
} else {
children.push(value);
Expand Down Expand Up @@ -3890,26 +3894,26 @@ class Occur extends XFAObject {
this.initial =
attributes.initial !== ""
? getInteger({
data: attributes.initial,
defaultValue: "",
validate: x => true,
})
data: attributes.initial,
defaultValue: "",
validate: x => true,
})
: "";
this.max =
attributes.max !== ""
? getInteger({
data: attributes.max,
defaultValue: -1,
validate: x => true,
})
data: attributes.max,
defaultValue: -1,
validate: x => true,
})
: "";
this.min =
attributes.min !== ""
? getInteger({
data: attributes.min,
defaultValue: 1,
validate: x => true,
})
data: attributes.min,
defaultValue: 1,
validate: x => true,
})
: "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
Expand Down Expand Up @@ -4378,9 +4382,8 @@ class Pattern extends XFAObject {
const endColor = this.color ? this.color[$toStyle]() : "#000000";
const width = 5;
const cmd = "repeating-linear-gradient";
const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${
2 * width
}px`;
const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width
}px`;
switch (this.type) {
case "crossHatch":
return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;
Expand Down