diff options
Diffstat (limited to 'fxjs')
-rw-r--r-- | fxjs/cfxjse_engine.cpp | 12 | ||||
-rw-r--r-- | fxjs/xfa/cjx_list.cpp | 2 | ||||
-rw-r--r-- | fxjs/xfa/cjx_node.cpp | 8 | ||||
-rw-r--r-- | fxjs/xfa/cjx_node.h | 3 | ||||
-rw-r--r-- | fxjs/xfa/cjx_treelist.cpp | 2 |
5 files changed, 10 insertions, 17 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp index e297ed16e2..cc584a3fa3 100644 --- a/fxjs/cfxjse_engine.cpp +++ b/fxjs/cfxjse_engine.cpp @@ -67,9 +67,7 @@ const char kFormCalcRuntime[] = "pfm_rt"; CXFA_ThisProxy* ToThisProxy(CFXJSE_Value* pValue) { CFXJSE_HostObject* pHostObject = pValue->ToHostObject(); - if (!pHostObject) - return nullptr; - return CXFA_ThisProxy::FromCXFAObject(pHostObject->AsCXFAObject()); + return pHostObject ? ToThisProxy(pHostObject->AsCXFAObject()) : nullptr; } } // namespace @@ -181,7 +179,7 @@ void CFXJSE_Engine::GlobalPropertySetter(CFXJSE_Value* pObject, CXFA_Document* pDoc = lpOrginalNode->GetDocument(); CFXJSE_Engine* lpScriptContext = pDoc->GetScriptContext(); CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); - if (lpOrginalNode->IsVariablesThis()) + if (lpOrginalNode->IsThisProxy()) pRefNode = ToNode(lpScriptContext->GetVariablesThis(lpOrginalNode)); WideString wsPropName = WideString::FromUTF8(szPropName); @@ -193,7 +191,7 @@ void CFXJSE_Engine::GlobalPropertySetter(CFXJSE_Value* pObject, true)) { return; } - if (lpOrginalNode->IsVariablesThis()) { + if (lpOrginalNode->IsThisProxy()) { if (pValue && pValue->IsUndefined()) { pObject->SetObjectOwnProperty(szPropName, pValue); return; @@ -234,7 +232,7 @@ void CFXJSE_Engine::GlobalPropertyGetter(CFXJSE_Value* pObject, } CXFA_Node* pRefNode = ToNode(lpScriptContext->GetThisObject()); - if (pOriginalObject->IsVariablesThis()) + if (pOriginalObject->IsThisProxy()) pRefNode = ToNode(lpScriptContext->GetVariablesThis(pOriginalObject)); if (lpScriptContext->QueryNodeByFlag( @@ -473,7 +471,7 @@ CFXJSE_Context* CFXJSE_Engine::CreateVariablesContext(CXFA_Node* pScriptNode, CXFA_Object* CFXJSE_Engine::GetVariablesThis(CXFA_Object* pObject, bool bScriptNode) { - CXFA_ThisProxy* pProxy = CXFA_ThisProxy::FromCXFAObject(pObject); + CXFA_ThisProxy* pProxy = ToThisProxy(pObject); if (!pProxy) return pObject; diff --git a/fxjs/xfa/cjx_list.cpp b/fxjs/xfa/cjx_list.cpp index fcac45f58c..e56515d0b1 100644 --- a/fxjs/xfa/cjx_list.cpp +++ b/fxjs/xfa/cjx_list.cpp @@ -28,7 +28,7 @@ CJX_List::CJX_List(CXFA_List* list) : CJX_Object(list) { CJX_List::~CJX_List() {} CXFA_List* CJX_List::GetXFAList() { - return static_cast<CXFA_List*>(GetXFAObject()); + return ToList(GetXFAObject()); } CJS_Return CJX_List::append(CFX_V8* runtime, diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index 856fea5267..efef5af87b 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -103,12 +103,8 @@ CJX_Node::CJX_Node(CXFA_Node* node) : CJX_Tree(node) { CJX_Node::~CJX_Node() = default; -CXFA_Node* CJX_Node::GetXFANode() { - return static_cast<CXFA_Node*>(GetXFAObject()); -} - -const CXFA_Node* CJX_Node::GetXFANode() const { - return static_cast<const CXFA_Node*>(GetXFAObject()); +CXFA_Node* CJX_Node::GetXFANode() const { + return ToNode(GetXFAObject()); } CJS_Return CJX_Node::applyXSL(CFX_V8* runtime, diff --git a/fxjs/xfa/cjx_node.h b/fxjs/xfa/cjx_node.h index 8d266424ab..af6800b5e5 100644 --- a/fxjs/xfa/cjx_node.h +++ b/fxjs/xfa/cjx_node.h @@ -38,8 +38,7 @@ class CJX_Node : public CJX_Tree { JSE_PROP(ns); JSE_PROP(oneOfChild); - CXFA_Node* GetXFANode(); - const CXFA_Node* GetXFANode() const; + CXFA_Node* GetXFANode() const; protected: int32_t execSingleEventByName(const WideStringView& wsEventName, diff --git a/fxjs/xfa/cjx_treelist.cpp b/fxjs/xfa/cjx_treelist.cpp index b79b9e16b4..53c3ec1b54 100644 --- a/fxjs/xfa/cjx_treelist.cpp +++ b/fxjs/xfa/cjx_treelist.cpp @@ -25,7 +25,7 @@ CJX_TreeList::CJX_TreeList(CXFA_TreeList* list) : CJX_List(list) { CJX_TreeList::~CJX_TreeList() {} CXFA_TreeList* CJX_TreeList::GetXFATreeList() { - return static_cast<CXFA_TreeList*>(GetXFAObject()); + return ToTreeList(GetXFAObject()); } CJS_Return CJX_TreeList::namedItem( |