summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffpageview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:43:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:43:53 +0000
commit51ef4a6ca3b4ae9b618cb1c96f84697a2bf4a2b1 (patch)
treea365a0c3f25fff2f6511fbc23fd0e4d6b8d4eada /xfa/fxfa/cxfa_ffpageview.cpp
parent8489e901fb16fe508e23a36cd3eff93d8332c2a2 (diff)
downloadpdfium-51ef4a6ca3b4ae9b618cb1c96f84697a2bf4a2b1.tar.xz
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 <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffpageview.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffpageview.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp
index 2234b4cfb1..1305938db3 100644
--- a/xfa/fxfa/cxfa_ffpageview.cpp
+++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -21,6 +21,8 @@
#include "xfa/fxfa/cxfa_ffwidget.h"
#include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
#include "xfa/fxfa/parser/cxfa_node.h"
+#include "xfa/fxfa/parser/cxfa_traversal.h"
+#include "xfa/fxfa/parser/cxfa_traverse.h"
namespace {
@@ -308,11 +310,11 @@ bool CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget(
CXFA_FFWidget* pWidget) {
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
- CXFA_Node* pTraversal =
- pAcc->GetNode()->GetChild(0, XFA_Element::Traversal, false);
+ CXFA_Traversal* pTraversal = pAcc->GetNode()->GetChild<CXFA_Traversal>(
+ 0, XFA_Element::Traversal, false);
if (pTraversal) {
- CXFA_Node* pTraverse =
- pTraversal->GetChild(0, XFA_Element::Traverse, false);
+ CXFA_Traverse* pTraverse =
+ pTraversal->GetChild<CXFA_Traverse>(0, XFA_Element::Traverse, false);
if (pTraverse) {
pdfium::Optional<WideString> traverseWidgetName =
pTraverse->JSObject()->TryAttribute(XFA_Attribute::Ref, true);