From 990c09373b733346a06b03167ca43252cb93e986 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 31 Jan 2018 19:54:25 +0000 Subject: Create CXFA_Node::PresenceRequiresSpace This CL replaces XFA_ItemLayoutProcessor_IsTakingSpace with a PresenceRequiresSpace call on CXFA_Node. Change-Id: Ibf570f25eeb3404d72e87cb62e06a7ad70f0916f Reviewed-on: https://pdfium-review.googlesource.com/24850 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_layoutpagemgr.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_layoutpagemgr.cpp') diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp index 123cafb1e9..f921d8014f 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp @@ -398,8 +398,7 @@ bool CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { bProBreakBefore = true; pRootSubform = pRootSubform->GetFirstChildByClass(XFA_Element::Subform); - while (pRootSubform && - !XFA_ItemLayoutProcessor_IsTakingSpace(pRootSubform)) { + while (pRootSubform && !pRootSubform->PresenceRequiresSpace()) { pRootSubform = pRootSubform->GetNextSameClassSibling( XFA_Element::Subform); } @@ -885,7 +884,7 @@ bool CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter( CXFA_Node* pLeaderTemplate = nullptr; CXFA_Node* pTrailerTemplate = nullptr; CXFA_Node* pFormNode = pBreakNode->GetContainerParent(); - if (XFA_ItemLayoutProcessor_IsTakingSpace(pFormNode)) { + if (pFormNode->PresenceRequiresSpace()) { bCreatePage = ExecuteBreakBeforeOrAfter(pBreakNode, bBefore, pLeaderTemplate, pTrailerTemplate); CXFA_Document* pDocument = pBreakNode->GetDocument(); @@ -1760,8 +1759,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() { pFormLayout = pFormLayout->m_pFirstChild; if (iLevel == 2) { while (pFormLayout && - !XFA_ItemLayoutProcessor_IsTakingSpace( - pFormLayout->m_pFormNode)) { + !pFormLayout->m_pFormNode->PresenceRequiresSpace()) { pFormLayout = pFormLayout->m_pNextSibling; } } -- cgit v1.2.3