Rename "iIndex" instances to "index" Mass rename a common variable name to follow Google C++ style via search and replace. Also rename "iIndexFoo" to "index_foo" or "foo_index", depending on which seems to read better. Bug: 42271580 Change-Id: Iab04a0c52a4c03e35bd70067b550b8caccc0d6c8 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/137750 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp index 83a0383..57cd513 100644 --- a/core/fpdfdoc/cpdf_action.cpp +++ b/core/fpdfdoc/cpdf_action.cpp
@@ -203,7 +203,7 @@ return pArray ? pArray->size() : 0; } -CPDF_Action CPDF_Action::GetSubAction(size_t iIndex) const { +CPDF_Action CPDF_Action::GetSubAction(size_t index) const { if (!dict_ || !dict_->KeyExist("Next")) { return CPDF_Action(nullptr); } @@ -214,11 +214,11 @@ } if (const CPDF_Array* pArray = pNext->AsArray()) { - return CPDF_Action(pArray->GetDictAt(iIndex)); + return CPDF_Action(pArray->GetDictAt(index)); } if (const CPDF_Dictionary* dict = pNext->AsDictionary()) { - if (iIndex == 0) { + if (index == 0) { return CPDF_Action(pdfium::WrapRetain(dict)); } }
diff --git a/core/fpdfdoc/cpdf_action.h b/core/fpdfdoc/cpdf_action.h index 93fc16b..b0545c6 100644 --- a/core/fpdfdoc/cpdf_action.h +++ b/core/fpdfdoc/cpdf_action.h
@@ -68,7 +68,7 @@ WideString GetJavaScript() const; size_t GetSubActionsCount() const; - CPDF_Action GetSubAction(size_t iIndex) const; + CPDF_Action GetSubAction(size_t index) const; private: RetainPtr<const CPDF_Object> GetJavaScriptObject() const;
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index 60f2181..a43252b 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -191,14 +191,14 @@ case kListBox: { ClearSelection(NotificationOption::kDoNotNotify); WideString csValue; - int iIndex = GetDefaultSelectedItem(); - if (iIndex >= 0) { - csValue = GetOptionLabel(iIndex); + int index = GetDefaultSelectedItem(); + if (index >= 0) { + csValue = GetOptionLabel(index); } if (!NotifyListOrComboBoxBeforeChange(csValue)) { return; } - SetItemSelection(iIndex, NotificationOption::kDoNotNotify); + SetItemSelection(index, NotificationOption::kDoNotNotify); NotifyListOrComboBoxAfterChange(); break; } @@ -394,13 +394,13 @@ : pdfium::form_fields::kV); dict_->SetNewFor<CPDF_String>(key, csValue.AsStringView()); - int iIndex; + int index; if (GetType() == kComboBox) { - iIndex = FindOption(csValue); + index = FindOption(csValue); } else { - iIndex = -1; + index = -1; } - if (iIndex < 0) { + if (index < 0) { if (type_ == kRichText && !bDefault) { dict_->SetFor(pdfium::form_fields::kRV, dict_->GetObjectFor(key.AsStringView())->Clone()); @@ -409,7 +409,7 @@ } else { if (!bDefault) { ClearSelection(NotificationOption::kDoNotNotify); - SetItemSelection(iIndex, NotificationOption::kDoNotNotify); + SetItemSelection(index, NotificationOption::kDoNotNotify); } } if (notify == NotificationOption::kNotify) { @@ -418,12 +418,12 @@ break; } case kListBox: { - int iIndex = FindOption(value); - if (iIndex < 0) { + int index = FindOption(value); + if (index < 0) { return false; } - if (bDefault && iIndex == GetDefaultSelectedItem()) { + if (bDefault && index == GetDefaultSelectedItem()) { return false; } @@ -433,7 +433,7 @@ } if (!bDefault) { ClearSelection(NotificationOption::kDoNotNotify); - SetItemSelection(iIndex, NotificationOption::kDoNotNotify); + SetItemSelection(index, NotificationOption::kDoNotNotify); } if (notify == NotificationOption::kNotify) { form_->NotifyAfterSelectionChange(this); @@ -527,9 +527,9 @@ bool CPDF_FormField::ClearSelection(NotificationOption notify) { if (notify == NotificationOption::kNotify) { WideString csValue; - int iIndex = GetSelectedIndex(0); - if (iIndex >= 0) { - csValue = GetOptionLabel(iIndex); + int index = GetSelectedIndex(0); + if (index >= 0) { + csValue = GetOptionLabel(index); } if (!NotifyListOrComboBoxBeforeChange(csValue)) { return false;
diff --git a/core/fxcrt/cfx_seekablestreamproxy.cpp b/core/fxcrt/cfx_seekablestreamproxy.cpp index 33cc528..c358401 100644 --- a/core/fxcrt/cfx_seekablestreamproxy.cpp +++ b/core/fxcrt/cfx_seekablestreamproxy.cpp
@@ -33,10 +33,10 @@ int32_t iPending = 0; size_t iSrcNum = 0; size_t iDstNum = 0; - for (size_t iIndex = 0; iIndex < pSrc.size() && iDstNum < pDst.size(); - ++iIndex) { + for (size_t index = 0; index < pSrc.size() && iDstNum < pDst.size(); + ++index) { ++iSrcNum; - uint8_t byte = pSrc[iIndex]; + uint8_t byte = pSrc[index]; if (byte < 0x80) { iPending = 0; pDst[iDstNum++] = byte;
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index cf81db2..f19be3a 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp
@@ -201,8 +201,8 @@ ByteString ParseStyle(const ByteString& bsStyle, size_t iStart) { ByteStringView bsRegion = bsStyle.AsStringView().Substr(iStart); - size_t iIndex = bsRegion.Find(',').value_or(bsRegion.GetLength()); - return ByteString(bsRegion.First(iIndex)); + size_t index = bsRegion.Find(',').value_or(bsRegion.GetLength()); + return ByteString(bsRegion.First(index)); } struct FX_FontStyle {
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp index 22d0926..e0680bf 100644 --- a/fxjs/cjs_field.cpp +++ b/fxjs/cjs_field.cpp
@@ -2262,14 +2262,14 @@ if (pFormField->CountSelectedItems() > 1) { v8::Local<v8::Array> ValueArray = pRuntime->NewArray(); v8::Local<v8::Value> ElementValue; - int iIndex; + int index; for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++) { - iIndex = pFormField->GetSelectedIndex(i); + index = pFormField->GetSelectedIndex(i); ElementValue = pRuntime->NewString( - pFormField->GetOptionValue(iIndex).AsStringView()); + pFormField->GetOptionValue(index).AsStringView()); if (pRuntime->ToWideString(ElementValue).IsEmpty()) { ElementValue = pRuntime->NewString( - pFormField->GetOptionLabel(iIndex).AsStringView()); + pFormField->GetOptionLabel(index).AsStringView()); } pRuntime->PutArrayElement(ValueArray, i, ElementValue); }
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp index 71ca536..22c1cae 100644 --- a/fxjs/cjs_publicmethods.cpp +++ b/fxjs/cjs_publicmethods.cpp
@@ -1044,10 +1044,10 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int iIndex = + int index = WithinBoundsOrZero(pRuntime->ToInt32(params[0]), std::size(kDateFormats)); v8::LocalVector<v8::Value> newParams(pRuntime->GetIsolate()); - newParams.push_back(pRuntime->NewString(kDateFormats[iIndex])); + newParams.push_back(pRuntime->NewString(kDateFormats[index])); return AFDate_FormatEx(pRuntime, newParams); } @@ -1059,10 +1059,10 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int iIndex = + int index = WithinBoundsOrZero(pRuntime->ToInt32(params[0]), std::size(kDateFormats)); v8::LocalVector<v8::Value> newParams(pRuntime->GetIsolate()); - newParams.push_back(pRuntime->NewString(kDateFormats[iIndex])); + newParams.push_back(pRuntime->NewString(kDateFormats[index])); return AFDate_KeystrokeEx(pRuntime, newParams); } @@ -1074,10 +1074,10 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int iIndex = + int index = WithinBoundsOrZero(pRuntime->ToInt32(params[0]), std::size(kTimeFormats)); v8::LocalVector<v8::Value> newParams(pRuntime->GetIsolate()); - newParams.push_back(pRuntime->NewString(kTimeFormats[iIndex])); + newParams.push_back(pRuntime->NewString(kTimeFormats[index])); return AFDate_FormatEx(pRuntime, newParams); } @@ -1088,10 +1088,10 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int iIndex = + int index = WithinBoundsOrZero(pRuntime->ToInt32(params[0]), std::size(kTimeFormats)); v8::LocalVector<v8::Value> newParams(pRuntime->GetIsolate()); - newParams.push_back(pRuntime->NewString(kTimeFormats[iIndex])); + newParams.push_back(pRuntime->NewString(kTimeFormats[index])); return AFDate_KeystrokeEx(pRuntime, newParams); } @@ -1176,13 +1176,13 @@ return CJS_Result::Success(); } - size_t iIndex = 0; - for (iIndex = 0; iIndex < valEvent.GetLength(); ++iIndex) { - if (!MaskSatisfied(valEvent[iIndex], wstrMask[iIndex])) { + size_t index = 0; + for (index = 0; index < valEvent.GetLength(); ++index) { + if (!MaskSatisfied(valEvent[index], wstrMask[index])) { break; } } - if (iIndex != wstrMask.GetLength()) { + if (index != wstrMask.GetLength()) { AlertIfPossible(pEvent, WideString::FromASCII("AFSpecial_KeystrokeEx"), JSGetStringFromID(JSMessage::kInvalidInputError)); pEvent->Rc() = false; @@ -1196,7 +1196,7 @@ } WideString wChange = wideChange; - size_t iIndexMask = pEvent->SelStart(); + size_t mask_index = pEvent->SelStart(); size_t combined_len = valEvent.GetLength() + wChange.GetLength() + pEvent->SelStart() - pEvent->SelEnd(); if (combined_len > wstrMask.GetLength()) { @@ -1206,7 +1206,7 @@ return CJS_Result::Success(); } - if (iIndexMask >= wstrMask.GetLength() && !wChange.IsEmpty()) { + if (mask_index >= wstrMask.GetLength() && !wChange.IsEmpty()) { AlertIfPossible(pEvent, WideString::FromASCII("AFSpecial_KeystrokeEx"), JSGetStringFromID(JSMessage::kParamTooLongError)); pEvent->Rc() = false; @@ -1214,13 +1214,13 @@ } for (size_t i = 0; i < wChange.GetLength(); ++i) { - if (iIndexMask >= wstrMask.GetLength()) { + if (mask_index >= wstrMask.GetLength()) { AlertIfPossible(pEvent, WideString::FromASCII("AFSpecial_KeystrokeEx"), JSGetStringFromID(JSMessage::kParamTooLongError)); pEvent->Rc() = false; return CJS_Result::Success(); } - wchar_t wMask = wstrMask[iIndexMask]; + wchar_t wMask = wstrMask[mask_index]; if (!IsReservedMaskChar(wMask)) { wChange.SetAt(i, wMask); } @@ -1229,7 +1229,7 @@ pEvent->Rc() = false; return CJS_Result::Success(); } - iIndexMask++; + mask_index++; } wideChange = std::move(wChange); return CJS_Result::Success();
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp index 4932203..96f64d5 100644 --- a/fxjs/xfa/cfxjse_formcalc_context.cpp +++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -391,18 +391,18 @@ wsPattern.MakeLower(); const wchar_t* pData = wsPattern.c_str(); int32_t iLength = wsPattern.GetLength(); - int32_t iIndex = 0; + int32_t index = 0; bool bSingleQuotation = false; UNSAFE_TODO({ - while (iIndex < iLength) { - wchar_t wsPatternChar = pData[iIndex]; + while (index < iLength) { + wchar_t wsPatternChar = pData[index]; if (wsPatternChar == 0x27) { bSingleQuotation = !bSingleQuotation; - iIndex++; + index++; continue; } if (bSingleQuotation) { - iIndex++; + index++; continue; } @@ -418,19 +418,19 @@ return {false, CXFA_LocaleValue::ValueType::kFloat}; } if (wsPatternChar == 'y' || wsPatternChar == 'j') { - iIndex++; + index++; wchar_t timePatternChar; - while (iIndex < iLength) { - timePatternChar = pData[iIndex]; + while (index < iLength) { + timePatternChar = pData[index]; if (timePatternChar == 0x27) { bSingleQuotation = !bSingleQuotation; - iIndex++; + index++; continue; } if (!bSingleQuotation && timePatternChar == 't') { return {false, CXFA_LocaleValue::ValueType::kDateTime}; } - iIndex++; + index++; } return {false, CXFA_LocaleValue::ValueType::kDate}; } @@ -442,7 +442,7 @@ wsPatternChar == '.') { type = CXFA_LocaleValue::ValueType::kFloat; } - iIndex++; + index++; } return {false, type}; }); @@ -718,9 +718,9 @@ if (ch <= 0x1f || (ch >= 0x7f && ch <= 0xff) || pdfium::Contains(kStrUnsafe, ch) || pdfium::Contains(kStrReserved, ch)) { - int32_t iIndex = ch / 16; - encode_buffer[1] = kStrCode[iIndex]; - encode_buffer[2] = kStrCode[ch - iIndex * 16]; + int32_t index = ch / 16; + encode_buffer[1] = kStrCode[index]; + encode_buffer[2] = kStrCode[ch - index * 16]; wsResultBuf << WideStringView(encode_buffer); continue; } @@ -741,21 +741,21 @@ break; } - int32_t iIndex = 0; + int32_t index = 0; if (iLen % 2 != 0) { encode_buffer[1] = '0'; encode_buffer[2] = wsBuffer[iLen - 1]; - iIndex = iLen - 2; + index = iLen - 2; } else { encode_buffer[1] = wsBuffer[iLen - 1]; encode_buffer[2] = wsBuffer[iLen - 2]; - iIndex = iLen - 3; + index = iLen - 3; } wsResultBuf << WideStringView(encode_buffer); - while (iIndex > 0) { - encode_buffer[1] = wsBuffer[iIndex]; - encode_buffer[2] = wsBuffer[iIndex - 1]; - iIndex -= 2; + while (index > 0) { + encode_buffer[1] = wsBuffer[index]; + encode_buffer[2] = wsBuffer[index - 1]; + index -= 2; wsResultBuf << WideStringView(encode_buffer); } } @@ -778,9 +778,9 @@ } else if (ch >= 32 && ch <= 126) { wsResultBuf.AppendChar(static_cast<wchar_t>(ch)); } else if (ch < 256) { - int32_t iIndex = ch / 16; - encode_buffer[3] = kStrCode[iIndex]; - encode_buffer[4] = kStrCode[ch - iIndex * 16]; + int32_t index = ch / 16; + encode_buffer[3] = kStrCode[index]; + encode_buffer[4] = kStrCode[ch - index * 16]; encode_buffer[5] = ';'; wsResultBuf << WideStringView(encode_buffer).First(6); } else if (ch < 65536) { @@ -837,9 +837,9 @@ if (ch >= 32 && ch <= 126) { wsResultBuf.AppendChar(static_cast<wchar_t>(ch)); } else if (ch < 256) { - int32_t iIndex = ch / 16; - encode_buffer[3] = kStrCode[iIndex]; - encode_buffer[4] = kStrCode[ch - iIndex * 16]; + int32_t index = ch / 16; + encode_buffer[3] = kStrCode[index]; + encode_buffer[4] = kStrCode[ch - index * 16]; encode_buffer[5] = ';'; wsResultBuf << WideStringView(encode_buffer).First(6); } else if (ch < 65536) { @@ -892,73 +892,73 @@ } ByteString strBuf; - int32_t iIndex = 0; + int32_t index = 0; UNSAFE_TODO({ if (iFirstCount == 3) { - if (pData[iIndex] != '0') { - strBuf += kCapUnits[pData[iIndex] - '0']; + if (pData[index] != '0') { + strBuf += kCapUnits[pData[index] - '0']; strBuf += kComm[0]; } - if (pData[iIndex + 1] == '0') { - strBuf += kCapUnits[pData[iIndex + 2] - '0']; + if (pData[index + 1] == '0') { + strBuf += kCapUnits[pData[index + 2] - '0']; } else { - if (pData[iIndex + 1] > '1') { - strBuf += kLastTens[pData[iIndex + 1] - '2']; + if (pData[index + 1] > '1') { + strBuf += kLastTens[pData[index + 1] - '2']; strBuf += "-"; - strBuf += kUnits[pData[iIndex + 2] - '0']; - } else if (pData[iIndex + 1] == '1') { - strBuf += kTens[pData[iIndex + 2] - '0']; - } else if (pData[iIndex + 1] == '0') { - strBuf += kCapUnits[pData[iIndex + 2] - '0']; + strBuf += kUnits[pData[index + 2] - '0']; + } else if (pData[index + 1] == '1') { + strBuf += kTens[pData[index + 2] - '0']; + } else if (pData[index + 1] == '0') { + strBuf += kCapUnits[pData[index + 2] - '0']; } } - iIndex += 3; + index += 3; } else if (iFirstCount == 2) { - if (pData[iIndex] == '0') { - strBuf += kCapUnits[pData[iIndex + 1] - '0']; + if (pData[index] == '0') { + strBuf += kCapUnits[pData[index + 1] - '0']; } else { - if (pData[iIndex] > '1') { - strBuf += kLastTens[pData[iIndex] - '2']; + if (pData[index] > '1') { + strBuf += kLastTens[pData[index] - '2']; strBuf += "-"; - strBuf += kUnits[pData[iIndex + 1] - '0']; - } else if (pData[iIndex] == '1') { - strBuf += kTens[pData[iIndex + 1] - '0']; - } else if (pData[iIndex] == '0') { - strBuf += kCapUnits[pData[iIndex + 1] - '0']; + strBuf += kUnits[pData[index + 1] - '0']; + } else if (pData[index] == '1') { + strBuf += kTens[pData[index + 1] - '0']; + } else if (pData[index] == '0') { + strBuf += kCapUnits[pData[index + 1] - '0']; } } - iIndex += 2; + index += 2; } else if (iFirstCount == 1) { - strBuf += kCapUnits[pData[iIndex] - '0']; - ++iIndex; + strBuf += kCapUnits[pData[index] - '0']; + ++index; } if (iLength > 3 && iFirstCount > 0) { strBuf += kComm[iComm]; --iComm; } - while (iIndex < iLength) { - if (pData[iIndex] != '0') { - strBuf += kCapUnits[pData[iIndex] - '0']; + while (index < iLength) { + if (pData[index] != '0') { + strBuf += kCapUnits[pData[index] - '0']; strBuf += kComm[0]; } - if (pData[iIndex + 1] == '0') { - strBuf += kCapUnits[pData[iIndex + 2] - '0']; + if (pData[index + 1] == '0') { + strBuf += kCapUnits[pData[index + 2] - '0']; } else { - if (pData[iIndex + 1] > '1') { - strBuf += kLastTens[pData[iIndex + 1] - '2']; + if (pData[index + 1] > '1') { + strBuf += kLastTens[pData[index + 1] - '2']; strBuf += "-"; - strBuf += kUnits[pData[iIndex + 2] - '0']; - } else if (pData[iIndex + 1] == '1') { - strBuf += kTens[pData[iIndex + 2] - '0']; - } else if (pData[iIndex + 1] == '0') { - strBuf += kCapUnits[pData[iIndex + 2] - '0']; + strBuf += kUnits[pData[index + 2] - '0']; + } else if (pData[index + 1] == '1') { + strBuf += kTens[pData[index + 2] - '0']; + } else if (pData[index + 1] == '0') { + strBuf += kCapUnits[pData[index + 2] - '0']; } } - if (iIndex < iLength - 3) { + if (index < iLength - 3) { strBuf += kComm[iComm]; --iComm; } - iIndex += 3; + index += 3; } return strBuf; }); @@ -971,24 +971,24 @@ int32_t iLength = bsData.GetLength(); ByteString strBuf; - int32_t iIndex = 0; - while (iIndex < iLength) { - if (bsData[iIndex] == '.') { + int32_t index = 0; + while (index < iLength) { + if (bsData[index] == '.') { break; } - ++iIndex; + ++index; } - int32_t iInteger = iIndex; - iIndex = 0; - while (iIndex < iInteger) { - int32_t iCount = (iInteger - iIndex) % 12; - if (!iCount && iInteger - iIndex > 0) { + int32_t iInteger = index; + index = 0; + while (index < iInteger) { + int32_t iCount = (iInteger - index) % 12; + if (!iCount && iInteger - index > 0) { iCount = 12; } - strBuf += TrillionUS(bsData.Substr(iIndex, iCount)); - iIndex += iCount; - if (iIndex < iInteger) { + strBuf += TrillionUS(bsData.Substr(index, iCount)); + index += iCount; + if (index < iInteger) { strBuf += " Trillion "; } } @@ -999,16 +999,16 @@ if (iStyle > 1 && iInteger < iLength) { strBuf += " And "; - iIndex = iInteger + 1; - while (iIndex < iLength) { - int32_t iCount = (iLength - iIndex) % 12; - if (!iCount && iLength - iIndex > 0) { + index = iInteger + 1; + while (index < iLength) { + int32_t iCount = (iLength - index) % 12; + if (!iCount && iLength - index > 0) { iCount = 12; } - strBuf += TrillionUS(bsData.Substr(iIndex, iCount)); - iIndex += iCount; - if (iIndex < iLength) { + strBuf += TrillionUS(bsData.Substr(index, iCount)); + index += iCount; + if (index < iLength) { strBuf += " Trillion "; } } @@ -2875,9 +2875,9 @@ return; } - int32_t iIndex = + int32_t index = static_cast<int32_t>(ValueToFloat(info.GetIsolate(), info[0])); - if (iIndex < 1) { + if (index < 1) { info.GetReturnValue().SetEmptyString(); return; } @@ -2896,11 +2896,11 @@ } iValueIndex += (iLength - 2); - if (iValueIndex >= iIndex) { + if (iValueIndex >= index) { v8::Local<v8::Value> propertyValue = fxv8::ReentrantGetArrayElementHelper(info.GetIsolate(), arr, 1); v8::Local<v8::Value> jsValue = fxv8::ReentrantGetArrayElementHelper( - info.GetIsolate(), arr, (iLength - 1) - (iValueIndex - iIndex)); + info.GetIsolate(), arr, (iLength - 1) - (iValueIndex - index)); v8::Local<v8::Value> newPropertyValue; if (fxv8::IsObject(jsValue)) { v8::Local<v8::Object> jsObjectValue = jsValue.As<v8::Object>(); @@ -2922,7 +2922,7 @@ } } else { iValueIndex++; - if (iValueIndex == iIndex) { + if (iValueIndex == index) { ByteString bsChosen = ValueToUTF8String(info.GetIsolate(), argIndexValue); info.GetReturnValue().Set( @@ -5053,34 +5053,34 @@ // static ByteString CFXJSE_FormCalcContext::GenerateSomExpression(ByteStringView bsName, - int32_t iIndexFlags, - int32_t iIndexValue, + int32_t index_flags, + int32_t index_value, bool bIsStar) { if (bIsStar) { return ByteString(bsName, "[*]"); } - // `iIndexFlags` values are the same as enum class + // `index_flags` values are the same as enum class // `CXFA_FMIndexExpression::AccessorIndex` values. - if (iIndexFlags == 0) { + if (index_flags == 0) { return ByteString(bsName); } - if (iIndexFlags == 1 || iIndexValue == 0) { - return ByteString(bsName, "[") + ByteString::FormatInteger(iIndexValue) + + if (index_flags == 1 || index_value == 0) { + return ByteString(bsName, "[") + ByteString::FormatInteger(index_value) + "]"; } - const bool bNegative = iIndexValue < 0; + const bool bNegative = index_value < 0; ByteString bsSomExp(bsName); - if (iIndexFlags == 2) { + if (index_flags == 2) { bsSomExp += bNegative ? "[-" : "[+"; } else { - DCHECK_EQ(iIndexFlags, 3); + DCHECK_EQ(index_flags, 3); bsSomExp += bNegative ? "[" : "[-"; } - FX_SAFE_INT32 safe_index = iIndexValue; + FX_SAFE_INT32 safe_index = index_value; if (bNegative) { safe_index = -safe_index; } @@ -5151,10 +5151,10 @@ } bool bIsStar = true; - int32_t iIndexValue = 0; + int32_t index_value = 0; if (argc > 4) { bIsStar = false; - iIndexValue = ValueToInteger(info.GetIsolate(), info[4]); + index_value = ValueToInteger(info.GetIsolate(), info[4]); } const ByteString bsName = @@ -5162,7 +5162,7 @@ const bool bHasNoResolveName = bDotAccessor && bsName.IsEmpty(); ByteString bsSomExp = GenerateSomExpression( bsName.AsStringView(), - fxv8::ReentrantToInt32Helper(info.GetIsolate(), info[3]), iIndexValue, + fxv8::ReentrantToInt32Helper(info.GetIsolate(), info[3]), index_value, bIsStar); v8::Local<v8::Value> argAccessor = info[0]; @@ -5357,10 +5357,10 @@ char szBuffer[3] = {}; // Last char always stays NUL for termination. State state = kHour; - size_t iIndex = 0; - while (iIndex + 1 < iZone) { - szBuffer[0] = pData[iIndex]; - szBuffer[1] = pData[iIndex + 1]; + size_t index = 0; + while (index + 1 < iZone) { + szBuffer[0] = pData[index]; + szBuffer[1] = pData[index + 1]; if (!FXSYS_IsDecimalDigit(szBuffer[0]) || !FXSYS_IsDecimalDigit(szBuffer[1])) { return false; @@ -5385,22 +5385,22 @@ } else { return false; } - iIndex += 2; - if (iIndex < iZone && pData[iIndex] == ':') { - ++iIndex; + index += 2; + if (index < iZone && pData[index] == ':') { + ++index; } } - if (iIndex < pData.size() && pData[iIndex] == '.') { + if (index < pData.size() && pData[index] == '.') { static constexpr int kSubSecondLength = 3; - if (iIndex + kSubSecondLength >= pData.size()) { + if (index + kSubSecondLength >= pData.size()) { return false; } - ++iIndex; + ++index; std::array<char, kSubSecondLength + 1> szMilliSeconds = {}; for (int j = 0; j < kSubSecondLength; ++j) { - char c = pData[iIndex + j]; + char c = pData[index + j]; if (!FXSYS_IsDecimalDigit(c)) { return false; } @@ -5409,24 +5409,24 @@ if (FXSYS_atoi(szMilliSeconds.data()) >= 1000) { return false; } - iIndex += kSubSecondLength; + index += kSubSecondLength; } - if (iIndex < pData.size() && FXSYS_towlower(pData[iIndex]) == 'z') { + if (index < pData.size() && FXSYS_towlower(pData[index]) == 'z') { return true; } - if (iIndex < pData.size()) { - if (pData[iIndex] == '+') { - ++iIndex; - } else if (pData[iIndex] == '-') { - ++iIndex; + if (index < pData.size()) { + if (pData[index] == '+') { + ++index; + } else if (pData[index] == '-') { + ++index; } } state = kZoneHour; - while (iIndex + 1 < pData.size()) { - szBuffer[0] = pData[iIndex]; - szBuffer[1] = pData[iIndex + 1]; + while (index + 1 < pData.size()) { + szBuffer[0] = pData[index]; + szBuffer[1] = pData[index + 1]; if (!FXSYS_IsDecimalDigit(szBuffer[0]) || !FXSYS_IsDecimalDigit(szBuffer[1])) { return false; @@ -5445,14 +5445,14 @@ } else { return false; } - iIndex += 2; - if (iIndex < pData.size() && pData[iIndex] == ':') { - ++iIndex; + index += 2; + if (index < pData.size() && pData[index] == ':') { + ++index; } } // Success if all input was processed. - return iIndex == pData.size(); + return index == pData.size(); } bool CFXJSE_FormCalcContext::IsIsoDateTimeFormat(ByteStringView bsData, @@ -5463,19 +5463,19 @@ *pMonth = 0; *pDay = 0; - size_t iIndex = 0; - while (iIndex < bsData.GetLength()) { - if (bsData[iIndex] == 'T' || bsData[iIndex] == 't') { + size_t index = 0; + while (index < bsData.GetLength()) { + if (bsData[index] == 'T' || bsData[index] == 't') { break; } - ++iIndex; + ++index; } - if (iIndex == bsData.GetLength() || (iIndex != 8 && iIndex != 10)) { + if (index == bsData.GetLength() || (index != 8 && index != 10)) { return false; } - ByteStringView date_part = bsData.First(iIndex); - ByteStringView time_part = bsData.Substr(iIndex + 1); + ByteStringView date_part = bsData.First(index); + ByteStringView time_part = bsData.Substr(index + 1); return IsIsoDateFormat(date_part, pYear, pMonth, pDay) && IsIsoTimeFormat(time_part); }
diff --git a/fxjs/xfa/cfxjse_formcalc_context.h b/fxjs/xfa/cfxjse_formcalc_context.h index 6ea039d..1fcd18a 100644 --- a/fxjs/xfa/cfxjse_formcalc_context.h +++ b/fxjs/xfa/cfxjse_formcalc_context.h
@@ -281,8 +281,8 @@ friend class FormCalcContextTest_IsIsoTimeFormat_Test; static ByteString GenerateSomExpression(ByteStringView bsName, - int32_t iIndexFlags, - int32_t iIndexValue, + int32_t index_flags, + int32_t index_value, bool bIsStar); static void DotAccessorCommon(CFXJSE_HostObject* pThis,
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.cpp b/fxjs/xfa/cfxjse_resolveprocessor.cpp index 48d18d3..cc900cb 100644 --- a/fxjs/xfa/cfxjse_resolveprocessor.cpp +++ b/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -658,20 +658,20 @@ return; } - int32_t iIndex = wsCondition.Substr(i, iLen - 1 - i).GetInteger(); + int32_t index = wsCondition.Substr(i, iLen - 1 - i).GetInteger(); if (bRelative) { - iIndex += iCurIndex; + index += iCurIndex; } - if (iIndex < 0 || static_cast<size_t>(iIndex) >= iFoundCount) { + if (index < 0 || static_cast<size_t>(index) >= iFoundCount) { if (pRnd->styles_ & XFA_ResolveFlag::kCreateNode) { node_helper_->create_parent_ = ToNode(pRnd->cur_object_); - node_helper_->create_count_ = iIndex - iFoundCount + 1; + node_helper_->create_count_ = index - iFoundCount + 1; } pRnd->result_.objects.clear(); } else { pRnd->result_.objects = std::vector<cppgc::Member<CXFA_Object>>( - 1, pRnd->result_.objects[iIndex]); + 1, pRnd->result_.objects[index]); } }
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index 2ab79a3..6d2793b 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp
@@ -106,8 +106,8 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int32_t iIndex = runtime->ToInt32(params[0]); - if (iIndex < 0) { + int32_t index = runtime->ToInt32(params[0]); + if (index < 0) { return CJS_Result::Success(runtime->NewNull()); } @@ -116,7 +116,7 @@ return CJS_Result::Success(runtime->NewNull()); } - std::optional<WideString> value = node->GetChoiceListItem(iIndex, true); + std::optional<WideString> value = node->GetChoiceListItem(index, true); if (!value.has_value()) { return CJS_Result::Success(runtime->NewNull()); } @@ -178,8 +178,8 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int32_t iIndex = runtime->ToInt32(params[0]); - if (iIndex < 0) { + int32_t index = runtime->ToInt32(params[0]); + if (index < 0) { return CJS_Result::Success(runtime->NewNull()); } @@ -188,7 +188,7 @@ return CJS_Result::Success(runtime->NewNull()); } - std::optional<WideString> value = node->GetChoiceListItem(iIndex, false); + std::optional<WideString> value = node->GetChoiceListItem(index, false); if (!value.has_value()) { return CJS_Result::Success(runtime->NewNull()); } @@ -208,13 +208,13 @@ return CJS_Result::Success(); } - int32_t iIndex = runtime->ToInt32(params[0]); + int32_t index = runtime->ToInt32(params[0]); if (runtime->ToInt32(params[1]) != 0) { - node->SetItemState(iIndex, true, true, true); + node->SetItemState(index, true, true, true); return CJS_Result::Success(); } - if (node->GetItemState(iIndex)) { - node->SetItemState(iIndex, false, true, true); + if (node->GetItemState(index)) { + node->SetItemState(index, false, true, true); } return CJS_Result::Success(); @@ -413,13 +413,13 @@ return; } - int32_t iIndex = fxv8::ReentrantToInt32Helper(pIsolate, *pValue); - if (iIndex == -1) { + int32_t index = fxv8::ReentrantToInt32Helper(pIsolate, *pValue); + if (index == -1) { node->ClearAllSelections(); return; } - node->SetItemState(iIndex, true, true, true); + node->SetItemState(index, true, true, true); } void CJX_Field::rawValue(v8::Isolate* pIsolate,
diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp index 154a738..c553a54 100644 --- a/fxjs/xfa/cjx_instancemanager.cpp +++ b/fxjs/xfa/cjx_instancemanager.cpp
@@ -182,9 +182,9 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int32_t iIndex = runtime->ToInt32(params[0]); + int32_t index = runtime->ToInt32(params[0]); int32_t iCount = GetXFANode()->GetCount(); - if (iIndex < 0 || iIndex >= iCount) { + if (index < 0 || index >= iCount) { return CJS_Result::Failure(JSMessage::kInvalidInputError); } @@ -194,7 +194,7 @@ return CJS_Result::Failure(JSMessage::kTooManyOccurrences); } - CXFA_Node* pRemoveInstance = GetXFANode()->GetItemIfExists(iIndex); + CXFA_Node* pRemoveInstance = GetXFANode()->GetItemIfExists(index); if (!pRemoveInstance) { return CJS_Result::Failure(JSMessage::kParamError); } @@ -204,7 +204,7 @@ CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (pNotify) { CXFA_Node* pXFA = GetXFANode(); - for (int32_t i = iIndex; i < iCount - 1; i++) { + for (int32_t i = index; i < iCount - 1; i++) { auto* pSubformInstance = CXFA_Subform::FromNode(pXFA->GetItemIfExists(i)); if (pSubformInstance) { pNotify->RunSubformIndexChange(pSubformInstance); @@ -284,14 +284,14 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int32_t iIndex = runtime->ToInt32(params[0]); + int32_t index = runtime->ToInt32(params[0]); bool bBind = false; if (params.size() == 2) { bBind = runtime->ToBoolean(params[1]); } int32_t iCount = GetXFANode()->GetCount(); - if (iIndex < 0 || iIndex > iCount) { + if (index < 0 || index > iCount) { return CJS_Result::Failure(JSMessage::kInvalidInputError); } @@ -306,7 +306,7 @@ return CJS_Result::Success(runtime->NewNull()); } - GetXFANode()->InsertItem(pNewInstance, iIndex, iCount, true); + GetXFANode()->InsertItem(pNewInstance, index, iCount, true); CXFA_FFNotify* pNotify = GetDocument()->GetNotify(); if (pNotify) {
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp index 7035be0..8649975 100644 --- a/fxjs/xfa/cjx_layoutpseudomodel.cpp +++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -103,7 +103,7 @@ unit = std::move(tmp_unit); } } - int32_t iIndex = params.size() >= 3 ? runtime->ToInt32(params[2]) : 0; + int32_t index = params.size() >= 3 ? runtime->ToInt32(params[2]) : 0; auto* pDocLayout = CXFA_LayoutProcessor::FromDocument(GetDocument()); CXFA_ContentLayoutItem* pLayoutItem = ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode)); @@ -111,9 +111,9 @@ return CJS_Result::Success(); } - while (iIndex > 0 && pLayoutItem) { + while (index > 0 && pLayoutItem) { pLayoutItem = pLayoutItem->GetNext(); - --iIndex; + --index; } if (!pLayoutItem) { @@ -380,9 +380,9 @@ return CJS_Result::Failure(JSMessage::kParamError); } - int32_t iIndex = 0; + int32_t index = 0; if (params.size() >= 1) { - iIndex = runtime->ToInt32(params[0]); + index = runtime->ToInt32(params[0]); } WideString wsType; @@ -406,7 +406,7 @@ doc->GetHeap()->GetAllocationHandle(), doc); doc->GetNodeOwner()->PersistList(pArrayNodeList); pArrayNodeList->SetArrayNodeList( - GetObjArray(pDocLayout, iIndex, wsType, bOnPageArea)); + GetObjArray(pDocLayout, index, wsType, bOnPageArea)); return CJS_Result::Success(runtime->NewNormalXFAObject(pArrayNodeList)); }
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index 43d3a6b..59fe716 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp
@@ -195,13 +195,13 @@ } bool bParent = params.size() < 2 || runtime->ToBoolean(params[1]); - int32_t iIndex = params.size() == 3 ? runtime->ToInt32(params[2]) : 0; - bool bHas = !!GetOrCreateProperty<CXFA_Node>(iIndex, eType); + int32_t index = params.size() == 3 ? runtime->ToInt32(params[2]) : 0; + bool bHas = !!GetOrCreateProperty<CXFA_Node>(index, eType); if (!bHas && bParent && GetXFANode()->GetParent()) { // Also check on the parent. auto* jsnode = GetXFANode()->GetParent()->JSObject(); bHas = jsnode->HasAttribute(attr.value().attribute) || - !!jsnode->GetOrCreateProperty<CXFA_Node>(iIndex, eType); + !!jsnode->GetOrCreateProperty<CXFA_Node>(index, eType); } return CJS_Result::Success(runtime->NewBoolean(bHas)); }
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index c88e3c7..5f7af6e 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp
@@ -73,19 +73,19 @@ int32_t g = 0; int32_t b = 0; - size_t iIndex = 0; + size_t index = 0; for (size_t i = 0; i < strRGB.GetLength(); ++i) { wchar_t ch = strRGB[i]; if (ch == L',') { - ++iIndex; + ++index; } - if (iIndex > 2) { + if (index > 2) { break; } int32_t iValue = ch - L'0'; if (iValue >= 0 && iValue <= 9) { - switch (iIndex) { + switch (index) { case 0: r = r * 10 + iValue; break;
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp index 6665cc6..2aed683 100644 --- a/fxjs/xfa/cjx_tree.cpp +++ b/fxjs/xfa/cjx_tree.cpp
@@ -172,9 +172,9 @@ } CXFA_Node* pNode = GetXFANode(); - size_t iIndex = pNode ? pNode->GetIndexByName() : 0; + size_t index = pNode ? pNode->GetIndexByName() : 0; *pValue = - fxv8::NewNumberHelper(pIsolate, pdfium::checked_cast<int32_t>(iIndex)); + fxv8::NewNumberHelper(pIsolate, pdfium::checked_cast<int32_t>(index)); } void CJX_Tree::classIndex(v8::Isolate* pIsolate, @@ -187,9 +187,9 @@ } CXFA_Node* pNode = GetXFANode(); - size_t iIndex = pNode ? pNode->GetIndexByClassName() : 0; + size_t index = pNode ? pNode->GetIndexByClassName() : 0; *pValue = - fxv8::NewNumberHelper(pIsolate, pdfium::checked_cast<int32_t>(iIndex)); + fxv8::NewNumberHelper(pIsolate, pdfium::checked_cast<int32_t>(index)); } void CJX_Tree::somExpression(v8::Isolate* pIsolate,
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index 75136ac..0f394cf 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp
@@ -57,8 +57,8 @@ list_box_->AddString(wsText); } -void CFWL_ComboBox::RemoveAt(int32_t iIndex) { - list_box_->RemoveAt(iIndex); +void CFWL_ComboBox::RemoveAt(int32_t index) { + list_box_->RemoveAt(index); } void CFWL_ComboBox::RemoveAll() { @@ -134,8 +134,8 @@ } } -WideString CFWL_ComboBox::GetTextByIndex(int32_t iIndex) const { - CFWL_ListBox::Item* pItem = list_box_->GetItem(list_box_, iIndex); +WideString CFWL_ComboBox::GetTextByIndex(int32_t index) const { + CFWL_ListBox::Item* pItem = list_box_->GetItem(list_box_, index); return pItem ? pItem->GetText() : WideString(); }
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h index 8583556..d7ab7aa 100644 --- a/xfa/fwl/cfwl_combobox.h +++ b/xfa/fwl/cfwl_combobox.h
@@ -52,12 +52,12 @@ void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; - WideString GetTextByIndex(int32_t iIndex) const; + WideString GetTextByIndex(int32_t index) const; int32_t GetCurSel() const { return cur_sel_; } void SetCurSel(int32_t iSel); void AddString(const WideString& wsText); - void RemoveAt(int32_t iIndex); + void RemoveAt(int32_t index); void RemoveAll(); void SetEditText(const WideString& wsText);
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index eb91d3e..18ca34e 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp
@@ -905,11 +905,11 @@ return item_array_.back().get(); } -void CFWL_ListBox::RemoveAt(int32_t iIndex) { - if (iIndex < 0 || static_cast<size_t>(iIndex) >= item_array_.size()) { +void CFWL_ListBox::RemoveAt(int32_t index) { + if (index < 0 || static_cast<size_t>(index) >= item_array_.size()) { return; } - item_array_.erase(item_array_.begin() + iIndex); + item_array_.erase(item_array_.begin() + index); } void CFWL_ListBox::DeleteString(Item* pItem) {
diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h index e4c21bf..cf64ea5 100644 --- a/xfa/fwl/cfwl_listbox.h +++ b/xfa/fwl/cfwl_listbox.h
@@ -70,7 +70,7 @@ Item* GetItem(const CFWL_Widget* pWidget, int32_t nIndex) const; int32_t GetItemIndex(CFWL_Widget* pWidget, Item* pItem); Item* AddString(const WideString& wsAdd); - void RemoveAt(int32_t iIndex); + void RemoveAt(int32_t index); void DeleteString(Item* pItem); void DeleteAll(); int32_t CountSelItems();
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index b5d35b9..c16dd77 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -61,7 +61,7 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_Node* pSender, const WideString& wsLabel, - int32_t iIndex) { + int32_t index) { if (pSender->GetFFWidgetType() != XFA_FFWidgetType::kChoiceList) { return; } @@ -69,13 +69,12 @@ CXFA_FFWidget* pWidget = doc_->GetDocView()->GetWidgetForNode(pSender); for (; pWidget; pWidget = pWidget->GetNextFFWidget()) { if (pWidget->IsLoaded()) { - ToDropDown(ToField(pWidget))->InsertItem(wsLabel, iIndex); + ToDropDown(ToField(pWidget))->InsertItem(wsLabel, index); } } } -void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_Node* pSender, - int32_t iIndex) { +void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_Node* pSender, int32_t index) { if (pSender->GetFFWidgetType() != XFA_FFWidgetType::kChoiceList) { return; } @@ -83,7 +82,7 @@ CXFA_FFWidget* pWidget = doc_->GetDocView()->GetWidgetForNode(pSender); for (; pWidget; pWidget = pWidget->GetNextFFWidget()) { if (pWidget->IsLoaded()) { - ToDropDown(ToField(pWidget))->DeleteItem(iIndex); + ToDropDown(ToField(pWidget))->DeleteItem(index); } } }
diff --git a/xfa/fxfa/cxfa_ffnotify.h b/xfa/fxfa/cxfa_ffnotify.h index 4606223..f186fe6 100644 --- a/xfa/fxfa/cxfa_ffnotify.h +++ b/xfa/fxfa/cxfa_ffnotify.h
@@ -35,8 +35,8 @@ void OnWidgetListItemAdded(CXFA_Node* pSender, const WideString& wsLabel, - int32_t iIndex); - void OnWidgetListItemRemoved(CXFA_Node* pSender, int32_t iIndex); + int32_t index); + void OnWidgetListItemRemoved(CXFA_Node* pSender, int32_t index); // Node events void OnNodeReady(CXFA_Node* pNode);
diff --git a/xfa/fxfa/parser/cxfa_arraynodelist.h b/xfa/fxfa/parser/cxfa_arraynodelist.h index a9f2fb6..e8599a4 100644 --- a/xfa/fxfa/parser/cxfa_arraynodelist.h +++ b/xfa/fxfa/parser/cxfa_arraynodelist.h
@@ -28,7 +28,7 @@ bool Append(CXFA_Node* pNode) override; bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; void Remove(CXFA_Node* pNode) override; - CXFA_Node* Item(size_t iIndex) override; + CXFA_Node* Item(size_t index) override; void SetArrayNodeList(const std::vector<CXFA_Node*>& srcArray);
diff --git a/xfa/fxfa/parser/cxfa_attachnodelist.h b/xfa/fxfa/parser/cxfa_attachnodelist.h index 28abe26..5e42ac7 100644 --- a/xfa/fxfa/parser/cxfa_attachnodelist.h +++ b/xfa/fxfa/parser/cxfa_attachnodelist.h
@@ -26,7 +26,7 @@ bool Append(CXFA_Node* pNode) override; bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override; void Remove(CXFA_Node* pNode) override; - CXFA_Node* Item(size_t iIndex) override; + CXFA_Node* Item(size_t index) override; private: CXFA_AttachNodeList(CXFA_Document* document, CXFA_Node* pAttachNode);
diff --git a/xfa/fxfa/parser/cxfa_list.h b/xfa/fxfa/parser/cxfa_list.h index 24629b5..0ea105e 100644 --- a/xfa/fxfa/parser/cxfa_list.h +++ b/xfa/fxfa/parser/cxfa_list.h
@@ -23,7 +23,7 @@ virtual bool Append(CXFA_Node* pNode) = 0; virtual bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0; virtual void Remove(CXFA_Node* pNode) = 0; - virtual CXFA_Node* Item(size_t iIndex) = 0; + virtual CXFA_Node* Item(size_t index) = 0; protected: CXFA_List(CXFA_Document* doc, CJX_Object* js_obj);
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 7345209..7aaa82e 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1972,7 +1972,7 @@ GetElementType() == XFA_Element::Xfa); } -CXFA_Node* CXFA_Node::GetItemIfExists(int32_t iIndex) { +CXFA_Node* CXFA_Node::GetItemIfExists(int32_t index) { int32_t iCount = 0; uint32_t dwNameHash = 0; for (CXFA_Node* pNode = GetNextSibling(); pNode; @@ -1999,7 +1999,7 @@ } iCount++; - if (iCount > iIndex) { + if (iCount > index) { return pNode; } }
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 47f2335..919e9f1 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h
@@ -152,7 +152,7 @@ CXFA_Node* CreateInstanceIfPossible(bool bDataMerge); int32_t GetCount(); - CXFA_Node* GetItemIfExists(int32_t iIndex); + CXFA_Node* GetItemIfExists(int32_t index); void RemoveItem(CXFA_Node* pRemoveInstance, bool bRemoveDataBinding); void InsertItem(CXFA_Node* pNewInstance, int32_t iPos,