diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-30 20:21:00 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-30 20:21:00 +0000 |
commit | 5fda35f2b0a658e310f778c2dc40ef24e6d05975 (patch) | |
tree | 3daddbde21cef2a9aa3aa2827a1c34ef06ad6a85 /xfa/fxfa/parser/cxfa_node.h | |
parent | 0be087619a60b8bc6e2ed2e14c54f67aa8e963e4 (diff) | |
download | pdfium-5fda35f2b0a658e310f778c2dc40ef24e6d05975.tar.xz |
Generate XFA node attribute information
This CL moves the attribute information out of the xfa basic data array
and stores in the generated nodes.
Change-Id: Id8e280324bf0f75a1da9c937c2734d161324242d
Reviewed-on: https://pdfium-review.googlesource.com/19271
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.h')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 7465f31106..238bb12b06 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -53,8 +53,19 @@ class CXFA_Node : public CXFA_Object { uint8_t flags; }; - static WideString AttributeToName(XFA_Attribute attr); + struct AttributeData { + XFA_Attribute attribute; + XFA_AttributeType type; + uint32_t packets; + void* default_value; + }; + +#ifndef NDEBUG + static WideString ElementToName(XFA_Element elem); +#endif // NDEBUG + static XFA_Attribute NameToAttribute(const WideStringView& name); + static WideString AttributeToName(XFA_Attribute attr); static XFA_Element NameToElement(const WideString& name); static std::unique_ptr<CXFA_Node> Create(CXFA_Document* doc, XFA_Element element, @@ -175,20 +186,21 @@ class CXFA_Node : public CXFA_Object { XFA_ObjectType oType, XFA_Element eType, const PropertyData* properties, - const XFA_Attribute* attributes, + const AttributeData* attributes, const WideStringView& elementName); private: bool HasFlag(XFA_NodeFlag dwFlag) const; CXFA_Node* Deprecated_GetPrevSibling(); const PropertyData* GetPropertyData(XFA_Element property) const; + const AttributeData* GetAttributeData(XFA_Attribute attr) const; pdfium::Optional<XFA_Element> GetFirstPropertyWithFlag(uint8_t flag); void OnRemoved(bool bNotify); pdfium::Optional<void*> GetDefaultValue(XFA_Attribute attr, XFA_AttributeType eType) const; const PropertyData* m_Properties; - const XFA_Attribute* m_Attributes; + const AttributeData* m_Attributes; uint32_t m_ValidPackets; CXFA_Node* m_pNext; CXFA_Node* m_pChild; |