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

Unified Diff: core/fpdfdoc/doc_action.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_action.cpp
diff --git a/core/fpdfdoc/doc_action.cpp b/core/fpdfdoc/doc_action.cpp
index c3ab55260618240f095ee385ce395e55bbf25161..c2c7896ec60e2ff3b0b209e8d9412bcb847c14d8 100644
--- a/core/fpdfdoc/doc_action.cpp
+++ b/core/fpdfdoc/doc_action.cpp
@@ -100,7 +100,7 @@ CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const {
}
return csURI;
}
-uint32_t CPDF_ActionFields::GetFieldsCount() const {
+size_t CPDF_ActionFields::GetFieldsCount() const {
if (!m_pAction) {
return 0;
}
@@ -147,8 +147,7 @@ std::vector<CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
if (pFields->IsDictionary() || pFields->IsString()) {
fields.push_back(pFields);
} else if (CPDF_Array* pArray = pFields->AsArray()) {
- uint32_t iCount = pArray->GetCount();
- for (uint32_t i = 0; i < iCount; ++i) {
+ for (size_t i = 0; i < pArray->GetCount(); ++i) {
CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
if (pObj) {
fields.push_back(pObj);
@@ -158,7 +157,7 @@ std::vector<CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
return fields;
}
-CPDF_Object* CPDF_ActionFields::GetField(uint32_t iIndex) const {
+CPDF_Object* CPDF_ActionFields::GetField(size_t iIndex) const {
if (!m_pAction) {
return NULL;
}
@@ -232,7 +231,7 @@ int32_t CPDF_Action::GetOperationType() const {
}
return 0;
}
-uint32_t CPDF_Action::GetSubActionsCount() const {
+size_t CPDF_Action::GetSubActionsCount() const {
if (!m_pDict || !m_pDict->KeyExist("Next"))
return 0;
@@ -245,7 +244,7 @@ uint32_t CPDF_Action::GetSubActionsCount() const {
return pArray->GetCount();
return 0;
}
-CPDF_Action CPDF_Action::GetSubAction(uint32_t iIndex) const {
+CPDF_Action CPDF_Action::GetSubAction(size_t iIndex) const {
if (!m_pDict || !m_pDict->KeyExist("Next")) {
return CPDF_Action();
}

Powered by Google App Engine
This is Rietveld 408576698