summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-10 16:40:56 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-10 16:40:56 +0000
commit93cfa060aa6324b2a79f25782e3c986750479ac5 (patch)
treeca2ef7a14861235877b084f9433502b5507b36bb /xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
parent18a6069f5ce332b2bab97bf3a6d8ea9528d69791 (diff)
downloadpdfium-93cfa060aa6324b2a79f25782e3c986750479ac5.tar.xz
Remove 2 param CXFA_Node::GetNodeItem
This CL removes the CXFA_Node::GetNodeItem(kind, object_type) method in favour of explicit methods. All of the callers passed in a XFA_ObjectType::ContainerNode. Change-Id: I713184d3fa188a122284f50ac2a6b0fd3d7aed26 Reviewed-on: https://pdfium-review.googlesource.com/22651 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
index 0b8daa8970..6275650370 100644
--- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp
@@ -521,12 +521,8 @@ bool ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) {
if (!pCurNode || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode))
return false;
- XFA_NODEITEM eItemType = XFA_NODEITEM_PrevSibling;
- if (!bPreFind)
- eItemType = XFA_NODEITEM_NextSibling;
-
- CXFA_Node* pPreContainer =
- pCurNode->GetNodeItem(eItemType, XFA_ObjectType::ContainerNode);
+ CXFA_Node* pPreContainer = bPreFind ? pCurNode->GetPrevContainerSibling()
+ : pCurNode->GetNextContainerSibling();
if (!pPreContainer)
return false;
@@ -1470,15 +1466,12 @@ void CXFA_ItemLayoutProcessor::GotoNextContainerNode(
CheckNextChildContainer : {
CXFA_Node* pNextChildContainer =
pChildContainer == XFA_LAYOUT_INVALIDNODE
- ? pEntireContainer->GetNodeItem(XFA_NODEITEM_FirstChild,
- XFA_ObjectType::ContainerNode)
- : pChildContainer->GetNodeItem(XFA_NODEITEM_NextSibling,
- XFA_ObjectType::ContainerNode);
+ ? pEntireContainer->GetFirstContainerChild()
+ : pChildContainer->GetNextContainerSibling();
while (pNextChildContainer &&
pNextChildContainer->IsLayoutGeneratedNode()) {
CXFA_Node* pSaveNode = pNextChildContainer;
- pNextChildContainer = pNextChildContainer->GetNodeItem(
- XFA_NODEITEM_NextSibling, XFA_ObjectType::ContainerNode);
+ pNextChildContainer = pNextChildContainer->GetNextContainerSibling();
if (pSaveNode->IsUnusedNode())
DeleteLayoutGeneratedNode(pSaveNode);
}
@@ -2171,11 +2164,8 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
bool bFocrTb = false;
if (pParentNode &&
GetLayout(pParentNode, &bFocrTb) == XFA_AttributeEnum::Row) {
- CXFA_Node* pChildContainer = m_pFormNode->GetNodeItem(
- XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode);
- if (pChildContainer &&
- pChildContainer->GetNodeItem(XFA_NODEITEM_NextSibling,
- XFA_ObjectType::ContainerNode)) {
+ CXFA_Node* pChildContainer = m_pFormNode->GetFirstContainerChild();
+ if (pChildContainer && pChildContainer->GetNextContainerSibling()) {
containerSize.height = 0;
bContainerHeightAutoSize = true;
}