Keep.java 1.25 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.template.formatting;

import com.adobe.xfa.Attribute;
import com.adobe.xfa.Element;
import com.adobe.xfa.EnumAttr;
import com.adobe.xfa.EnumValue;
import com.adobe.xfa.Node;
import com.adobe.xfa.ProtoableNode;
import com.adobe.xfa.XFA;
import com.adobe.xfa.template.containers.Field;
import com.adobe.xfa.template.containers.Subform;
import org.xml.sax.Attributes;

public final class Keep
extends ProtoableNode {
    public Keep(Element parent, Node prevSibling) {
        super(parent, prevSibling, null, "keep", "keep", null, XFA.KEEPTAG, "keep");
    }

    @Override
    public Attribute defaultAttribute(int eTag) {
        if (eTag == XFA.INTACTTAG) {
            int oIntact = 3538945;
            Element oParent = this.getXFAParent();
            if (oParent instanceof Subform) {
                int oLayout = oParent.getEnum(XFA.LAYOUTTAG);
                if (1769475 != oLayout && 1769477 != oLayout) {
                    oIntact = 3538944;
                }
            } else if (oParent instanceof Field) {
                oIntact = 3538944;
            }
            return EnumValue.getEnum(XFA.INTACTTAG, EnumAttr.getEnum(oIntact));
        }
        return super.defaultAttribute(eTag);
    }
}