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

Unified Diff: fpdfsdk/src/fsdk_baseform.cpp

Issue 1411203007: Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix bounds check Created 5 years, 2 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/src/fsdk_baseform.cpp
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index b4aa822bb69e84683f1854b4628501f7fec66cf4..9164904b23acf1ebfa1299ab1feb230124c9caa2 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -2463,7 +2463,7 @@ void CBA_AnnotIterator::GenerateResults() {
switch (m_nTabs) {
case BAI_STRUCTURE: {
- for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) {
+ for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
ASSERT(pAnnot != NULL);
@@ -2475,7 +2475,7 @@ void CBA_AnnotIterator::GenerateResults() {
CPDFSDK_SortAnnots sa;
{
- for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) {
+ for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
ASSERT(pAnnot != NULL);
@@ -2554,7 +2554,7 @@ void CBA_AnnotIterator::GenerateResults() {
CPDFSDK_SortAnnots sa;
{
- for (int i = 0, sz = m_pPageView->CountAnnots(); i < sz; i++) {
+ for (size_t i = 0; i < m_pPageView->CountAnnots(); ++i) {
CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
ASSERT(pAnnot != NULL);

Powered by Google App Engine
This is Rietveld 408576698