summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_nodehelper.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-01 22:52:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-01 22:52:42 +0000
commitb8d86800487df4021860f08407c323ed82243c79 (patch)
treeac91e7e9405cf47594316623b26a0aadd9544e79 /xfa/fxfa/parser/cxfa_nodehelper.cpp
parentdca380ffe0571be4023b11b06b8aecad9934bb06 (diff)
downloadpdfium-b8d86800487df4021860f08407c323ed82243c79.tar.xz
Get rid of else after break/continue/return.chromium/3284chromium/3283
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3 Reviewed-on: https://pdfium-review.googlesource.com/20110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_nodehelper.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_nodehelper.cpp62
1 files changed, 27 insertions, 35 deletions
diff --git a/xfa/fxfa/parser/cxfa_nodehelper.cpp b/xfa/fxfa/parser/cxfa_nodehelper.cpp
index 6428a3ca4a..f11472a112 100644
--- a/xfa/fxfa/parser/cxfa_nodehelper.cpp
+++ b/xfa/fxfa/parser/cxfa_nodehelper.cpp
@@ -267,16 +267,13 @@ void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode,
}
bool CXFA_NodeHelper::NodeIsTransparent(CXFA_Node* refNode) {
- if (!refNode) {
+ if (!refNode)
return false;
- }
+
XFA_Element refNodeType = refNode->GetElementType();
- if ((refNode->IsUnnamed() && refNode->IsContainerNode()) ||
- refNodeType == XFA_Element::SubformSet ||
- refNodeType == XFA_Element::Area || refNodeType == XFA_Element::Proto) {
- return true;
- }
- return false;
+ return (refNode->IsUnnamed() && refNode->IsContainerNode()) ||
+ refNodeType == XFA_Element::SubformSet ||
+ refNodeType == XFA_Element::Area || refNodeType == XFA_Element::Proto;
}
bool CXFA_NodeHelper::CreateNode_ForCondition(WideString& wsCondition) {
@@ -287,34 +284,29 @@ bool CXFA_NodeHelper::CreateNode_ForCondition(WideString& wsCondition) {
m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne;
return false;
}
- if (wsCondition[0] == '[') {
- int32_t i = 1;
- for (; i < iLen; ++i) {
- wchar_t ch = wsCondition[i];
- if (ch == ' ') {
- continue;
- }
- if (ch == '+' || ch == '-') {
- break;
- } else if (ch == '*') {
- bAll = true;
- break;
- } else {
- break;
- }
- }
- if (bAll) {
- wsIndex = L"1";
- m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeAll;
- } else {
- m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne;
- wsIndex = wsCondition.Mid(i, iLen - 1 - i);
- }
- int32_t iIndex = wsIndex.GetInteger();
- m_iCreateCount = iIndex;
- return true;
+ if (wsCondition[0] != '[')
+ return false;
+
+ int32_t i = 1;
+ for (; i < iLen; ++i) {
+ wchar_t ch = wsCondition[i];
+ if (ch == ' ')
+ continue;
+
+ if (ch == '*')
+ bAll = true;
+ break;
+ }
+ if (bAll) {
+ wsIndex = L"1";
+ m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeAll;
+ } else {
+ m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne;
+ wsIndex = wsCondition.Mid(i, iLen - 1 - i);
}
- return false;
+ int32_t iIndex = wsIndex.GetInteger();
+ m_iCreateCount = iIndex;
+ return true;
}
bool CXFA_NodeHelper::ResolveNodes_CreateNode(WideString wsName,