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

Unified Diff: core/fpdfdoc/doc_annot.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: core/fpdfdoc/doc_annot.cpp
diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp
index d1942eccd0e3dce92332838fe7cc468947cbce4d..38dba45fda07895714229e9c1904035c42cd8fe3 100644
--- a/core/fpdfdoc/doc_annot.cpp
+++ b/core/fpdfdoc/doc_annot.cpp
@@ -29,7 +29,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
FX_BOOL bRegenerateAP =
pAcroForm && pAcroForm->GetBooleanBy("NeedAppearances");
- for (uint32_t i = 0; i < pAnnots->GetCount(); ++i) {
+ for (size_t i = 0; i < pAnnots->GetCount(); ++i) {
CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
if (!pDict)
continue;
@@ -286,8 +286,8 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
if (!pDashArray) {
return;
}
- int nLen = pDashArray->GetCount();
- int i = 0;
+ size_t nLen = pDashArray->GetCount();
+ size_t i = 0;
for (; i < nLen; ++i) {
CPDF_Object* pObj = pDashArray->GetDirectObjectAt(i);
if (pObj && pObj->GetInteger()) {
@@ -323,13 +323,13 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
graph_state.m_LineWidth = width;
if (style_char == 'D') {
if (pDashArray) {
- uint32_t dash_count = pDashArray->GetCount();
+ size_t dash_count = pDashArray->GetCount();
if (dash_count % 2) {
dash_count++;
}
graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
graph_state.m_DashCount = dash_count;
- uint32_t i;
+ size_t i;
for (i = 0; i < pDashArray->GetCount(); ++i) {
graph_state.m_DashArray[i] = pDashArray->GetNumberAt(i);
}

Powered by Google App Engine
This is Rietveld 408576698