From e1aebd43b0c75133f94f8b141b33d12e2e715524 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Mon, 11 Apr 2016 10:02:09 -0700 Subject: Use std::vector as internal storage for CPDF_Array Replace the usage of CFX_ArrayTemplate inside CPDF_Array, which has non-standard APIs such as GetSize() returns int. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1867183002 . --- xfa/fxfa/app/xfa_ffdoc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 37bafca77a..04fe075d2c 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -242,8 +242,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { CFX_ArrayTemplate xfaStreams; if (pElementXFA->IsArray()) { CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA; - uint32_t count = pXFAArray->GetCount() / 2; - for (uint32_t i = 0; i < count; i++) { + for (size_t i = 0; i < pXFAArray->GetCount() / 2; i++) { if (CPDF_Stream* pStream = pXFAArray->GetStreamAt(i * 2 + 1)) xfaStreams.Add(pStream); } @@ -351,8 +350,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(const CFX_WideStringC& wsName, CFX_ByteString bsName = PDF_EncodeText(wsName.c_str(), wsName.GetLength()); CPDF_Object* pObject = nametree.LookupValue(bsName); if (!pObject) { - int32_t iCount = nametree.GetCount(); - for (int32_t i = 0; i < iCount; i++) { + for (size_t i = 0; i < nametree.GetCount(); i++) { CFX_ByteString bsTemp; CPDF_Object* pTempObject = nametree.LookupValue(i, bsTemp); if (bsTemp == bsName) { -- cgit v1.2.3