From 070fcdfeafb17a9d3ada1418f48fd7f19aa4cf83 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 22 Jun 2016 22:04:54 -0700 Subject: 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 --- xfa/fxfa/parser/xfa_object.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'xfa/fxfa/parser/xfa_object.h') 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; @@ -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; -- cgit v1.2.3