From 51ef4a6ca3b4ae9b618cb1c96f84697a2bf4a2b1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 14 Dec 2017 20:43:53 +0000 Subject: Change CXFA_Node::GetChild to return proper types Currently CXFA_Node::GetChild always returns a CXFA_Node* object. We know the type we want when we call GetChild, so this CL changes the code to add a template parameter to GetChild and return the correct CXFA_Node subtype for the desired element. Change-Id: I5aecf2e840504235dc246483abee48e0564841fe Reviewed-on: https://pdfium-review.googlesource.com/21210 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- fxjs/xfa/cjx_object.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fxjs') diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index f4f3030188..c49cc5bbce 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -807,8 +807,9 @@ pdfium::Optional CJX_Object::TryContent(bool bScriptModify, if (ToNode(GetXFAObject())->GetElementType() == XFA_Element::ExclGroup) { pNode = ToNode(GetXFAObject()); } else { - CXFA_Node* pValue = - ToNode(GetXFAObject())->GetChild(0, XFA_Element::Value, false); + CXFA_Value* pValue = + ToNode(GetXFAObject()) + ->GetChild(0, XFA_Element::Value, false); if (!pValue) return {}; -- cgit v1.2.3