summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffdocview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:51:03 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:51:03 +0000
commitdf4f30eaaa469c3703118f89579d506209a49237 (patch)
tree881eb4c93dadd3b07414cc950ed5cbbbb3c9693a /xfa/fxfa/cxfa_ffdocview.cpp
parent51ef4a6ca3b4ae9b618cb1c96f84697a2bf4a2b1 (diff)
downloadpdfium-df4f30eaaa469c3703118f89579d506209a49237.tar.xz
Add types to the CXFA_Node::Get*{Child|Sibling}* methods
This CL templates the various Get methods in CXFA_Node in order to return the correct node type. Change-Id: I4f50df6dd9213873deb8f8f262eaf579c6c4ca7d Reviewed-on: https://pdfium-review.googlesource.com/21230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffdocview.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index ed91020dff..3fea83c0e7 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -32,6 +32,7 @@
#include "xfa/fxfa/parser/cxfa_acrobat.h"
#include "xfa/fxfa/parser/cxfa_binditemsdata.h"
#include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
+#include "xfa/fxfa/parser/cxfa_pageset.h"
#include "xfa/fxfa/parser/cxfa_present.h"
#include "xfa/fxfa/parser/cxfa_subform.h"
#include "xfa/fxfa/parser/cxfa_validate.h"
@@ -120,8 +121,8 @@ void CXFA_FFDocView::StopLayout() {
if (!pSubformNode)
return;
- CXFA_Node* pPageSetNode =
- pSubformNode->GetFirstChildByClass(XFA_Element::PageSet);
+ CXFA_PageSet* pPageSetNode =
+ pSubformNode->GetFirstChildByClass<CXFA_PageSet>(XFA_Element::PageSet);
if (!pPageSetNode)
return;
@@ -315,7 +316,7 @@ CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() {
std::unique_ptr<CXFA_WidgetAccIterator>
CXFA_FFDocView::CreateWidgetAccIterator() {
- CXFA_Node* pFormRoot = GetRootSubform();
+ CXFA_Subform* pFormRoot = GetRootSubform();
return pFormRoot ? pdfium::MakeUnique<CXFA_WidgetAccIterator>(pFormRoot)
: nullptr;
}
@@ -775,11 +776,12 @@ void CXFA_FFDocView::SetChangeMark() {
m_pDoc->GetDocEnvironment()->SetChangeMark(m_pDoc.Get());
}
-CXFA_Node* CXFA_FFDocView::GetRootSubform() {
+CXFA_Subform* CXFA_FFDocView::GetRootSubform() {
CXFA_Node* pFormPacketNode =
ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form));
if (!pFormPacketNode)
return nullptr;
- return pFormPacketNode->GetFirstChildByClass(XFA_Element::Subform);
+ return pFormPacketNode->GetFirstChildByClass<CXFA_Subform>(
+ XFA_Element::Subform);
}