Calculate.java
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.template.automation;
import com.adobe.xfa.AppModel;
import com.adobe.xfa.Attribute;
import com.adobe.xfa.Element;
import com.adobe.xfa.EnumValue;
import com.adobe.xfa.Node;
import com.adobe.xfa.ProtoableNode;
import com.adobe.xfa.TextNode;
import com.adobe.xfa.XFA;
import com.adobe.xfa.ut.StringUtils;
import org.xml.sax.Attributes;
public class Calculate
extends ProtoableNode {
public Calculate(Element pParent, Node prevSibling) {
super(pParent, prevSibling, null, "calculate", "calculate", null, XFA.CALCULATETAG, "calculate");
}
@Override
public Attribute defaultAttribute(int eTag) {
if (eTag == XFA.OVERRIDETAG) {
Element poScript = this.getElement(XFA.SCRIPTTAG, true, 0, false, false);
if (poScript == null) {
return super.defaultAttribute(eTag);
}
TextNode poText = poScript.getText(true, false, false);
if (poText == null) {
return super.defaultAttribute(eTag);
}
String sScript = poText.getValue();
if (StringUtils.isEmpty(sScript)) {
return super.defaultAttribute(eTag);
}
if (!this.getAppModel().getLegacySetting(AppModel.XFA_LEGACY_CALCOVERRIDE)) {
return EnumValue.getEnum(XFA.OVERRIDETAG, -2144862206);
}
}
return super.defaultAttribute(eTag);
}
}