Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: xfa/fxfa/parser/xfa_object_imp.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fxfa/parser/xfa_object_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index eed103643bfbe50beb5bc343151f51ca4ccc3857..c2af4595a46624d617463b4225ade94df7440642 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -1398,8 +1398,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()) {
@@ -1412,7 +1412,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);
@@ -4220,12 +4220,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;
@@ -4245,11 +4243,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;
@@ -4310,9 +4307,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;

Powered by Google App Engine
This is Rietveld 408576698