From c5a8f217fedc1224104b34f7577044776a9d83d8 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 20 Jun 2016 11:11:12 -0700 Subject: Split the XFA_OBJECTTYPE enum into two parts. Currently the object type and the node flags are both mixed into the single XFA_OBJECTTYPE_* enum. These two things are un-related and should not share a single type. This Cl creates an XFA_ObjectType enum class and a XFA_NodeFlag enum to hold the two types. Accessors are added to determine if the flags are set (or called where they already existed. Review-Url: https://codereview.chromium.org/2083453003 --- xfa/fxfa/parser/xfa_script_imp.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/xfa_script_imp.cpp') diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index 7a97899c96..e9b70202be 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -156,14 +156,13 @@ void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes; CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); - if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { + if (lpOrginalNode->IsVariablesThis()) pRefNode = ToNode(lpCurNode); - } if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, dwFlag, TRUE)) { return; } - if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { + if (lpOrginalNode->IsVariablesThis()) { if (pValue && pValue->IsUndefined()) { pObject->SetObjectOwnProperty(szPropName, pValue); return; @@ -226,7 +225,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject, uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes; CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); - if (pOriginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) { + if (pOriginalObject->IsVariablesThis()) { pRefNode = ToNode(lpCurNode); } if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue, @@ -433,7 +432,7 @@ CFXJSE_Context* CXFA_ScriptContext::CreateVariablesContext( } CXFA_Object* CXFA_ScriptContext::GetVariablesThis(CXFA_Object* pObject, FX_BOOL bScriptNode) { - if (pObject->GetObjectType() != XFA_OBJECTTYPE_VariablesThis) + if (!pObject->IsVariablesThis()) return pObject; CXFA_ThisProxy* pProxy = static_cast(pObject); -- cgit v1.2.3