Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: fpdfsdk/fsdk_baseannot.cpp

Issue 1867183002: Use std::vector as internal storage for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/fsdk_baseannot.cpp
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index b3363bfbc797628b92452f5e5effc850902a14a0..268a7bef335ce39cd10487a256a1246cb1681a37 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;

Powered by Google App Engine
This is Rietveld 408576698