summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-23 17:02:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-23 17:02:23 +0000
commit6aec70bc09cb65b169fe6ca1af65e8929aeea43a (patch)
tree34d55cf15cba0fe71e87a896184ecdc891d4752f /xfa/fxfa/parser/cxfa_node.cpp
parentd49254bc9323883deba14d27026ec2bb9af096fa (diff)
downloadpdfium-chromium/3277.tar.xz
Cleanup CXFA_WidgetDatachromium/3277
This CL cleans up return values, out-params and changes simple methods to boolean checks where possible in CXFA_WidgetData. Change-Id: I29daa67993730f3e9d61cb6fdf918a886cc9120e Reviewed-on: https://pdfium-review.googlesource.com/19230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 185b2a935a..a947374814 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -465,38 +465,36 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() {
if (eType == XFA_Element::Field) {
CXFA_WidgetData* pFieldWidgetData = GetWidgetData();
- if (pFieldWidgetData &&
- pFieldWidgetData->GetChoiceListOpen() ==
- XFA_ATTRIBUTEENUM_MultiSelect) {
+ if (pFieldWidgetData && pFieldWidgetData->IsChoiceListMultiSelect())
return nullptr;
- } else {
- WideString wsPicture;
+
+ WideString wsPicture;
+ if (pFieldWidgetData) {
+ wsPicture =
+ pFieldWidgetData->GetPictureContent(XFA_VALUEPICTURE_DataBind);
+ }
+ if (!wsPicture.IsEmpty())
+ return pFieldWidgetData;
+
+ CXFA_Node* pDataNode = GetBindData();
+ if (!pDataNode)
+ return nullptr;
+ pFieldWidgetData = nullptr;
+ for (const auto& pFormNode : *(pDataNode->GetBindItems())) {
+ if (!pFormNode || pFormNode->HasRemovedChildren())
+ continue;
+ pFieldWidgetData = pFormNode->GetWidgetData();
if (pFieldWidgetData) {
wsPicture =
pFieldWidgetData->GetPictureContent(XFA_VALUEPICTURE_DataBind);
}
if (!wsPicture.IsEmpty())
- return pFieldWidgetData;
-
- CXFA_Node* pDataNode = GetBindData();
- if (!pDataNode)
- return nullptr;
+ break;
pFieldWidgetData = nullptr;
- for (const auto& pFormNode : *(pDataNode->GetBindItems())) {
- if (!pFormNode || pFormNode->HasRemovedChildren())
- continue;
- pFieldWidgetData = pFormNode->GetWidgetData();
- if (pFieldWidgetData) {
- wsPicture =
- pFieldWidgetData->GetPictureContent(XFA_VALUEPICTURE_DataBind);
- }
- if (!wsPicture.IsEmpty())
- break;
- pFieldWidgetData = nullptr;
- }
- return pFieldWidgetData;
}
+ return pFieldWidgetData;
}
+
CXFA_Node* pGrandNode =
pParentNode ? pParentNode->GetNodeItem(XFA_NODEITEM_Parent) : nullptr;
CXFA_Node* pValueNode =