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 . --- fpdfsdk/fsdk_baseannot.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/fsdk_baseannot.cpp') diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp index 68d99e8ae5..51f87d8c4e 100644 --- a/fpdfsdk/fsdk_baseannot.cpp +++ b/fpdfsdk/fsdk_baseannot.cpp @@ -739,9 +739,8 @@ void CPDFSDK_BAAnnot::SetBorderDash(const CFX_IntArray& array) { } CPDF_Array* pArray = new CPDF_Array; - for (int i = 0, sz = array.GetSize(); i < sz; i++) { + for (size_t i = 0, sz = array.GetSize(); i < sz; i++) pArray->AddInteger(array[i]); - } pBSDict->SetAt("D", pArray); } @@ -760,9 +759,8 @@ void CPDFSDK_BAAnnot::GetBorderDash(CFX_IntArray& array) const { } if (pDash) { - for (int i = 0, sz = pDash->GetCount(); i < sz; i++) { + for (size_t i = 0, sz = pDash->GetCount(); i < sz; i++) array.Add(pDash->GetIntegerAt(i)); - } } } @@ -780,7 +778,7 @@ void CPDFSDK_BAAnnot::RemoveColor() { FX_BOOL CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const { if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArrayBy("C")) { - int nCount = pEntry->GetCount(); + size_t nCount = pEntry->GetCount(); if (nCount == 1) { FX_FLOAT g = pEntry->GetNumberAt(0) * 255; -- cgit v1.2.3