XFA - Fix error when creating a new data node
- fix for issue #13556; - value in a field can be empty.
This commit is contained in:
parent
a4e8f3bdee
commit
150fa3d96e
@ -313,7 +313,7 @@ function createDataNode(root, container, expr) {
|
||||
}
|
||||
root = child;
|
||||
} else {
|
||||
parsed[i].index = children.length - index;
|
||||
parsed[i].index = index - children.length;
|
||||
return createNodes(root, parsed.slice(i));
|
||||
}
|
||||
}
|
||||
|
@ -2396,9 +2396,15 @@ class Field extends XFAObject {
|
||||
if (this.ui.imageEdit) {
|
||||
ui.children.push(this.value[$toHTML]().html);
|
||||
} else if (!this.ui.button) {
|
||||
const value = this.value.exData
|
||||
? this.value.exData[$text]()
|
||||
: this.value[$toHTML]().html.value;
|
||||
let value = "";
|
||||
if (this.value.exData) {
|
||||
value = this.value.exData[$text]();
|
||||
} else {
|
||||
const htmlValue = this.value[$toHTML]().html;
|
||||
if (htmlValue !== null) {
|
||||
value = htmlValue.value;
|
||||
}
|
||||
}
|
||||
if (value) {
|
||||
if (ui.children[0].name === "textarea") {
|
||||
ui.children[0].attributes.textContent = value;
|
||||
|
1
test/pdfs/xfa_issue13556.pdf.link
Normal file
1
test/pdfs/xfa_issue13556.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://web.archive.org/web/20210422084343/https://mail.gnome.org/archives/evince-list/2013-November/pdfNC0hkVW67a.pdf
|
@ -938,6 +938,14 @@
|
||||
"enableXfa": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "xfa_issue13556",
|
||||
"file": "pdfs/xfa_issue13556.pdf",
|
||||
"md5": "197e93a010763c3b6f9845595ee66c70",
|
||||
"link": true,
|
||||
"rounds": 1,
|
||||
"enableXfa": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "xfa_issue13213",
|
||||
"file": "pdfs/xfa_issue13213.pdf",
|
||||
"md5": "8a0e3179bffbac721589d1b1df863b49",
|
||||
|
Loading…
Reference in New Issue
Block a user