diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-22 22:04:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-22 22:04:54 -0700 |
commit | 070fcdfeafb17a9d3ada1418f48fd7f19aa4cf83 (patch) | |
tree | 2e9d0daaf76b0d2ac13f8b6d0b10dec11d1c6264 /xfa/fxfa/parser/xfa_object.h | |
parent | a5ab26b8aa9ed12af8bdf323cb297f61cbfeb1fa (diff) | |
download | pdfium-070fcdfeafb17a9d3ada1418f48fd7f19aa4cf83.tar.xz |
Update GetClassID to GetElementType
The GetClassID method actually returns the XFA_Element, change the name of the
method to be more suggestive of the return value.
The GetClassID was sort-of polymorphich and would call down to subclasses. This
CL changes the data to be stored on the CXFA_Object class and just returns what
is set. The values are set in the constructor as needed.
Review-Url: https://codereview.chromium.org/2082573007
Diffstat (limited to 'xfa/fxfa/parser/xfa_object.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_object.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index 4da2f1045b..67e4a2efad 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -47,7 +47,9 @@ enum XFA_NodeFlag { class CXFA_Object : public CFXJSE_HostObject { public: - CXFA_Object(CXFA_Document* pDocument, XFA_ObjectType type); + CXFA_Object(CXFA_Document* pDocument, + XFA_ObjectType objectType, + XFA_Element elementType); ~CXFA_Object() override; CXFA_Document* GetDocument() const { return m_pDocument; } @@ -90,7 +92,7 @@ class CXFA_Object : public CFXJSE_HostObject { const CXFA_OrdinaryObject* AsOrdinaryObject() const; const CXFA_NodeList* AsNodeList() const; - XFA_Element GetClassID() const; + XFA_Element GetElementType() const; void GetClassName(CFX_WideStringC& wsName) const; uint32_t GetClassHashCode() const; void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, @@ -101,6 +103,7 @@ class CXFA_Object : public CFXJSE_HostObject { protected: CXFA_Document* const m_pDocument; XFA_ObjectType m_objectType; + XFA_Element m_elementType; }; using CXFA_ObjArray = CFX_ArrayTemplate<CXFA_Object*>; @@ -150,7 +153,6 @@ struct XFA_MAPMODULEDATA { class CXFA_Node : public CXFA_Object { public: - XFA_Element GetClassID() const { return m_eNodeClass; } uint32_t GetPacketID() const { return m_ePacket; } void SetFlag(uint32_t dwFlag, bool bNotify); @@ -675,7 +677,6 @@ class CXFA_Node : public CXFA_Object { CXFA_Node* m_pLastChild; CXFA_Node* m_pParent; CFDE_XMLNode* m_pXMLNode; - XFA_Element m_eNodeClass; uint16_t m_ePacket; uint16_t m_uNodeFlags; uint32_t m_dwNameHash; @@ -687,11 +688,6 @@ class CXFA_OrdinaryObject : public CXFA_Object { public: CXFA_OrdinaryObject(CXFA_Document* pDocument, XFA_Element eElement); ~CXFA_OrdinaryObject() override; - - XFA_Element GetClassID() const; - - protected: - XFA_Element m_eNodeClass; }; class CXFA_ThisProxy : public CXFA_Object { @@ -712,7 +708,6 @@ class CXFA_NodeList : public CXFA_Object { explicit CXFA_NodeList(CXFA_Document* pDocument); ~CXFA_NodeList() override; - XFA_Element GetClassID() const; CXFA_Node* NamedItem(const CFX_WideStringC& wsName); virtual int32_t GetLength() = 0; virtual FX_BOOL Append(CXFA_Node* pNode) = 0; |