diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-24 19:51:06 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-24 19:51:06 +0000 |
commit | 4327b48d249ad61020e353c794a08b2969949eba (patch) | |
tree | 00b387c48e88c4379baab8a4f6fab1c2d6762e21 /xfa/fxfa/parser/cxfa_ui.cpp | |
parent | 4ad801bdc86405888290037065de5d3a3b447167 (diff) | |
download | pdfium-4327b48d249ad61020e353c794a08b2969949eba.tar.xz |
Cleanup CreateUIChild pUI usage
This CL cleans up the usage of pUI in CreateUIChild. The node can't be
null per spec so ASSERT that's true. Cleanup the search for children to
make it clearer what is happening.
Change-Id: I856de8ebf89fe0bc61942e7ad2a1131a7878c511
Reviewed-on: https://pdfium-review.googlesource.com/23730
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_ui.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_ui.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/cxfa_ui.cpp b/xfa/fxfa/parser/cxfa_ui.cpp index 883e79ac59..e6a3963334 100644 --- a/xfa/fxfa/parser/cxfa_ui.cpp +++ b/xfa/fxfa/parser/cxfa_ui.cpp @@ -24,7 +24,6 @@ const CXFA_Node::PropertyData kPropertyData[] = { {XFA_Element::NumericEdit, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::Signature, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::TextEdit, 1, XFA_PROPERTYFLAG_OneOf}, - {XFA_Element::ExObject, 1, XFA_PROPERTYFLAG_OneOf}, {XFA_Element::Extras, 1, 0}, {XFA_Element::Unknown, 0, 0}}; const CXFA_Node::AttributeData kAttributeData[] = { @@ -49,3 +48,13 @@ CXFA_Ui::CXFA_Ui(CXFA_Document* doc, XFA_PacketType packet) pdfium::MakeUnique<CJX_Ui>(this)) {} CXFA_Ui::~CXFA_Ui() {} + +bool CXFA_Ui::IsAOneOfChild(CXFA_Node* child) const { + for (auto& prop : kPropertyData) { + if (prop.property != child->GetElementType()) + continue; + if (!!(prop.flags & XFA_PROPERTYFLAG_OneOf)) + return true; + } + return false; +} |