From 312ce172c276089309214a027450241edb2aa399 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 6 Mar 2017 14:00:07 -0800 Subject: Remove CFX_StackTemplate in xfa_utils.h. Tree traversal doesn't require a stack as we always have parent pointers in nodes. Break the code into smaller units to help make more comprehensible what is going on. Remove init methods and force callers to pass us root in the constructor. The operations are complicated by the lack of a last child or previous sibling pointer in our nodes. Change-Id: Ia32bb44354352686cb79ccd67fe8aa5cd5ccef58 Reviewed-on: https://pdfium-review.googlesource.com/2913 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- xfa/fxfa/app/xfa_ffpageview.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xfa/fxfa/app') diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index 7ae5493ba6..caff52c6c0 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -146,15 +146,15 @@ IXFA_WidgetIterator* CXFA_FFPageView::CreateWidgetIterator( } CXFA_FFPageWidgetIterator::CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, - uint32_t dwFilter) { - m_pPageView = pPageView; - m_dwFilter = dwFilter; - m_sIterator.Init(pPageView); + uint32_t dwFilter) + : m_pPageView(pPageView), m_dwFilter(dwFilter), m_sIterator(pPageView) { m_bIgnorerelevant = m_pPageView->GetDocView()->GetDoc()->GetXFADoc()->GetCurVersionMode() < XFA_VERSION_205; } + CXFA_FFPageWidgetIterator::~CXFA_FFPageWidgetIterator() {} + void CXFA_FFPageWidgetIterator::Reset() { m_sIterator.Reset(); } @@ -432,8 +432,7 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer( } void CXFA_FFTabOrderPageWidgetIterator::CreateSpaceOrderWidgetArray( std::vector* WidgetArray) { - CXFA_LayoutItemIterator sIterator; - sIterator.Init(m_pPageView); + CXFA_LayoutItemIterator sIterator(m_pPageView); auto pParam = pdfium::MakeUnique(); bool bCurrentItem = false; bool bContentArea = false; -- cgit v1.2.3