summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/fpdf_edit')
-rw-r--r--core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp9
-rw-r--r--core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp4
-rw-r--r--core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp3
3 files changed, 7 insertions, 9 deletions
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
index a484edd6b9..28cbdfc02e 100644
--- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
@@ -129,11 +129,10 @@ void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) {
CFX_ByteTextBuf buf;
if (CPDF_Array* pArray = pContent->AsArray()) {
- int iCount = pArray->GetCount();
+ size_t iCount = pArray->GetCount();
CPDF_StreamAcc** pContentArray = FX_Alloc(CPDF_StreamAcc*, iCount);
- int size = 0;
- int i = 0;
- for (i = 0; i < iCount; ++i) {
+ size_t size = 0;
+ for (size_t i = 0; i < iCount; ++i) {
pContent = pArray->GetObjectAt(i);
CPDF_Stream* pStream = ToStream(pContent);
if (!pStream)
@@ -146,7 +145,7 @@ void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) {
}
int pos = 0;
uint8_t* pBuf = FX_Alloc(uint8_t, size);
- for (i = 0; i < iCount; ++i) {
+ for (size_t i = 0; i < iCount; ++i) {
FXSYS_memcpy(pBuf + pos, pContentArray[i]->GetData(),
pContentArray[i]->GetSize());
pos += pContentArray[i]->GetSize() + 1;
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index a337cf59ff..c2e556c3a7 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -96,7 +96,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj,
}
offset += 1;
const CPDF_Array* p = pObj->AsArray();
- for (uint32_t i = 0; i < p->GetCount(); i++) {
+ for (size_t i = 0; i < p->GetCount(); i++) {
CPDF_Object* pElement = p->GetObjectAt(i);
if (pElement->GetObjNum()) {
if (pFile->AppendString(" ") < 0) {
@@ -1199,7 +1199,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum,
}
m_Offset += 1;
const CPDF_Array* p = pObj->AsArray();
- for (uint32_t i = 0; i < p->GetCount(); i++) {
+ for (size_t i = 0; i < p->GetCount(); i++) {
CPDF_Object* pElement = p->GetObjectAt(i);
if (pElement->GetObjNum()) {
if (m_File.AppendString(" ") < 0) {
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index 04ab9ea863..379e75938e 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -1033,8 +1033,7 @@ static int InsertDeletePDFPage(CPDF_Document* pDoc,
if (!pKidList) {
return -1;
}
- int nKids = pKidList->GetCount();
- for (int i = 0; i < nKids; i++) {
+ for (size_t i = 0; i < pKidList->GetCount(); i++) {
CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
if (pKid->GetStringBy("Type") == "Page") {
if (nPagesToGo == 0) {