diff options
author | weili <weili@chromium.org> | 2016-06-02 15:48:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-02 15:48:16 -0700 |
commit | db444d2063df6c574882d9263e885c4fe1134133 (patch) | |
tree | 27ce4a3f181ae0b5ad4eff6893016e7d49dfce0a /xfa/fxfa/parser/xfa_script_imp.cpp | |
parent | ad700c2c1fc3c3843dae71e5982f462e42efc987 (diff) | |
download | pdfium-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_script_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_script_imp.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp index 357566ed9c..528758f6f8 100644 --- a/xfa/fxfa/parser/xfa_script_imp.cpp +++ b/xfa/fxfa/parser/xfa_script_imp.cpp @@ -219,10 +219,10 @@ void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject, XFA_HashCode uHashCode = static_cast<XFA_HashCode>( FX_HashCode_GetW(wsPropName.AsStringC(), false)); if (uHashCode != XFA_HASHCODE_Layout) { - CXFA_Object* pObject = + CXFA_Object* pObj = lpScriptContext->GetDocument()->GetXFAObject(uHashCode); - if (pObject) { - FXJSE_Value_Set(pValue, lpScriptContext->GetJSValueFromMap(pObject)); + if (pObj) { + FXJSE_Value_Set(pValue, lpScriptContext->GetJSValueFromMap(pObj)); return; } } @@ -335,12 +335,12 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue, } if (pPropOrChild) { CFX_WideString wsDefaultName(L"{default}"); - const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = + const XFA_SCRIPTATTRIBUTEINFO* lpAttrInfo = XFA_GetScriptAttributeByName(pPropOrChild->GetClassID(), wsDefaultName.AsStringC()); - if (lpAttributeInfo) { - (pPropOrChild->*(lpAttributeInfo->lpfnCallback))( - pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute); + if (lpAttrInfo) { + (pPropOrChild->*(lpAttrInfo->lpfnCallback))( + pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute); return; } } |