summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index ccbf31048d..4402208900 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -138,6 +138,19 @@ const XFA_ATTRIBUTEENUMINFO* GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName) {
return g_XFAEnumData + eName;
}
+// static
+WideString CXFA_Node::AttributeToName(XFA_Attribute attr) {
+ return XFA_GetAttributeByID(attr)->pName;
+}
+
+// static
+XFA_Attribute CXFA_Node::NameToAttribute(const WideStringView& name) {
+ const XFA_ATTRIBUTEINFO* attr = XFA_GetAttributeByName(name);
+ if (!attr)
+ return XFA_Attribute::Unknown;
+ return attr->eName;
+}
+
CXFA_Node::CXFA_Node(CXFA_Document* pDoc,
uint16_t ePacket,
uint32_t validPackets,