summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_object_imp.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-02 15:48:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-02 15:48:16 -0700
commitdb444d2063df6c574882d9263e885c4fe1134133 (patch)
tree27ce4a3f181ae0b5ad4eff6893016e7d49dfce0a /xfa/fxfa/parser/xfa_object_imp.cpp
parentad700c2c1fc3c3843dae71e5982f462e42efc987 (diff)
downloadpdfium-db444d2063df6c574882d9263e885c4fe1134133.tar.xz
Fix all the code which has duplicate variable declarations
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
Diffstat (limited to 'xfa/fxfa/parser/xfa_object_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index f3bb4fefb2..cfe65ed864 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -1393,8 +1393,8 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage(
if (!pValueNode) {
return;
}
- XFA_ELEMENT eType = pValueNode->GetClassID();
- if (eType == XFA_ELEMENT_Value) {
+ XFA_ELEMENT eNodeType = pValueNode->GetClassID();
+ if (eNodeType == XFA_ELEMENT_Value) {
bNeedFindContainer = true;
CXFA_Node* pNode = pValueNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pNode && pNode->IsContainerNode()) {
@@ -1407,7 +1407,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage(
pNode->GetNodeItem(XFA_NODEITEM_Parent));
}
} else {
- if (eType == XFA_ELEMENT_Items) {
+ if (eNodeType == XFA_ELEMENT_Items) {
CXFA_Node* pNode = pValueNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pNode && pNode->IsContainerNode()) {
pNotify->OnValueChanged(this, eAttribute, pValueNode, pNode);
@@ -4190,12 +4190,10 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
CXFA_NodeArray nodeArray;
pBind->GetBindItems(nodeArray);
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
- CXFA_Node* pNode = nodeArray[i];
- if (pNode == this) {
- continue;
+ if (nodeArray[i] != this) {
+ nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify,
+ bScriptModify, FALSE);
}
- pNode->SetScriptContent(wsContent, wsContent, bNotify,
- bScriptModify, FALSE);
}
}
break;
@@ -4215,11 +4213,10 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
CXFA_NodeArray nodeArray;
pBindNode->GetBindItems(nodeArray);
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
- CXFA_Node* pNode = nodeArray[i];
- if (pNode == this) {
- continue;
+ if (nodeArray[i] != this) {
+ nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify, true,
+ FALSE);
}
- pNode->SetScriptContent(wsContent, wsContent, bNotify, true, FALSE);
}
}
pBindNode = nullptr;
@@ -4280,9 +4277,8 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
CXFA_NodeArray nodeArray;
pBindNode->GetBindItems(nodeArray);
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
- CXFA_Node* pNode = nodeArray[i];
- pNode->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify,
- FALSE);
+ nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify,
+ bScriptModify, FALSE);
}
}
return TRUE;