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 --- fpdfsdk/javascript/Field.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/javascript') diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index 2a739deed0..5808982b43 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -144,9 +144,9 @@ void Field::ParseFieldName(const std::wstring& strFieldNameParsed, std::wstring suffixal = strFieldNameParsed.substr(iStart + 1); iControlNo = FXSYS_wtoi(suffixal.c_str()); if (iControlNo == 0) { - int iStart; - while ((iStart = suffixal.find_last_of(L" ")) != -1) { - suffixal.erase(iStart, 1); + int iSpaceStart; + while ((iSpaceStart = suffixal.find_last_of(L" ")) != -1) { + suffixal.erase(iSpaceStart, 1); } if (suffixal.compare(L"0") != 0) { @@ -249,8 +249,8 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, FX_BOOL bRefresh) { ASSERT(pFormControl); - CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); - CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl); + CPDFSDK_InterForm* pForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); + CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl); if (pWidget) { if (bResetAP) { -- cgit v1.2.3