From db444d2063df6c574882d9263e885c4fe1134133 Mon Sep 17 00:00:00 2001 From: weili Date: Thu, 2 Jun 2016 15:48:15 -0700 Subject: 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 --- xfa/fxfa/app/xfa_ffdocview.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/app/xfa_ffdocview.cpp') diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index beb7dec1a3..d8b65c4c5b 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -721,8 +721,7 @@ FX_BOOL CXFA_FFDocView::RunEventLayoutReady() { return TRUE; } void CXFA_FFDocView::RunBindItems() { - int32_t iCount = m_BindItems.GetSize(); - for (int32_t i = 0; i < iCount; i++) { + for (int32_t i = 0; i < m_BindItems.GetSize(); i++) { if (m_BindItems[i]->HasFlag(XFA_NODEFLAG_HasRemoved)) continue; @@ -757,8 +756,8 @@ void CXFA_FFDocView::RunBindItems() { CFX_WideString wsValue; CFX_WideString wsLabel; uint32_t uValueHash = FX_HashCode_GetW(wsValueRef, false); - for (int32_t i = 0; i < iCount; i++) { - CXFA_Object* refObj = rs.nodes[i]; + for (int32_t j = 0; j < iCount; j++) { + CXFA_Object* refObj = rs.nodes[j]; if (!refObj->IsNode()) { continue; } -- cgit v1.2.3