diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-12-07 14:39:01 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-07 14:39:01 +0000 |
commit | bb6ecbad918e52c46400caffbff6ffc70a494bce (patch) | |
tree | 6cbf0ab9745af433b50e537346b34bd6592ec087 /xfa/fxfa/parser/cxfa_node.cpp | |
parent | 7b0be4ced5f3687e922fc9ed11a4c49fe9848221 (diff) | |
download | pdfium-bb6ecbad918e52c46400caffbff6ffc70a494bce.tar.xz |
Fix nits from previous CL.
This CL fixs up some nits from previous CL.
Change-Id: I3d24d149d91b1290258291f5b79894496b195459
Reviewed-on: https://pdfium-review.googlesource.com/20290
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 378d3063a9..b2966457b1 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -684,53 +684,46 @@ XFA_AttributeEnum CXFA_Node::GetIntact() { return *intact; } } + switch (GetElementType()) { case XFA_Element::Subform: switch (eLayoutType) { case XFA_AttributeEnum::Position: case XFA_AttributeEnum::Row: return XFA_AttributeEnum::ContentArea; - case XFA_AttributeEnum::Tb: - case XFA_AttributeEnum::Table: - case XFA_AttributeEnum::Lr_tb: - case XFA_AttributeEnum::Rl_tb: - return XFA_AttributeEnum::None; default: - break; + return XFA_AttributeEnum::None; } - break; case XFA_Element::Field: { - CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); - if (!pParentNode || - pParentNode->GetElementType() == XFA_Element::PageArea) + CXFA_Node* parent = GetNodeItem(XFA_NODEITEM_Parent); + if (!parent || parent->GetElementType() == XFA_Element::PageArea) return XFA_AttributeEnum::ContentArea; - if (pParentNode->GetIntact() == XFA_AttributeEnum::None) { - XFA_AttributeEnum eParLayout = - pParentNode->JSNode() - ->TryEnum(XFA_Attribute::Layout, true) - .value_or(XFA_AttributeEnum::Position); - if (eParLayout == XFA_AttributeEnum::Position || - eParLayout == XFA_AttributeEnum::Row || - eParLayout == XFA_AttributeEnum::Table) { - return XFA_AttributeEnum::None; - } - XFA_VERSION version = m_pDocument->GetCurVersionMode(); - if (eParLayout == XFA_AttributeEnum::Tb && version < XFA_VERSION_208) { - pdfium::Optional<CXFA_Measurement> measureH = - JSNode()->TryMeasure(XFA_Attribute::H, false); - if (measureH) - return XFA_AttributeEnum::ContentArea; - } + if (parent->GetIntact() != XFA_AttributeEnum::None) + return XFA_AttributeEnum::ContentArea; + + XFA_AttributeEnum eParLayout = parent->JSNode() + ->TryEnum(XFA_Attribute::Layout, true) + .value_or(XFA_AttributeEnum::Position); + if (eParLayout == XFA_AttributeEnum::Position || + eParLayout == XFA_AttributeEnum::Row || + eParLayout == XFA_AttributeEnum::Table) { return XFA_AttributeEnum::None; } - return XFA_AttributeEnum::ContentArea; + + XFA_VERSION version = m_pDocument->GetCurVersionMode(); + if (eParLayout == XFA_AttributeEnum::Tb && version < XFA_VERSION_208) { + pdfium::Optional<CXFA_Measurement> measureH = + JSNode()->TryMeasure(XFA_Attribute::H, false); + if (measureH) + return XFA_AttributeEnum::ContentArea; + } + return XFA_AttributeEnum::None; } case XFA_Element::Draw: return XFA_AttributeEnum::ContentArea; default: - break; + return XFA_AttributeEnum::None; } - return XFA_AttributeEnum::None; } CXFA_Node* CXFA_Node::GetDataDescriptionNode() { |