From 1f7db295b1deeecb562d6213b3ea17b9168405eb Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 25 Jul 2018 16:59:38 +0000 Subject: Move CXFA_ThisProxy helper to CXFA_Object. Because the other helpers are declared here. Rename VariablesThis to ThisProxy in a few places; VariablesThis is a slightly different concept (see GetVariablesThis()). Then introduce helper for CXFA_List subclass as well. Remove unused const version of some helpers. Change-Id: Ia328d8cd170a8b97015e98c1c770fa8a44810455 Reviewed-on: https://pdfium-review.googlesource.com/38670 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fxjs/xfa/cjx_list.cpp | 2 +- fxjs/xfa/cjx_node.cpp | 8 ++------ fxjs/xfa/cjx_node.h | 3 +-- fxjs/xfa/cjx_treelist.cpp | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) (limited to 'fxjs/xfa') 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(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(GetXFAObject()); -} - -const CXFA_Node* CJX_Node::GetXFANode() const { - return static_cast(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(GetXFAObject()); + return ToTreeList(GetXFAObject()); } CJS_Return CJX_TreeList::namedItem( -- cgit v1.2.3