From f40380f454042c9783fe30260a0e3df8b32c5c92 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 12 Oct 2018 18:31:51 +0000 Subject: Rename CPDF_{Array,Dictionary}::GetCount() to size(). Make them compatible with pdfium::CollectionSize(). Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157 Reviewed-on: https://pdfium-review.googlesource.com/c/43937 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- fpdfsdk/cpdfsdk_actionhandler.cpp | 2 +- fpdfsdk/cpdfsdk_baannot.cpp | 4 +-- fpdfsdk/cpdfsdk_helpers.cpp | 6 ++-- fpdfsdk/cpdfsdk_interactiveform.cpp | 6 ++-- fpdfsdk/fpdf_annot.cpp | 8 +++--- fpdfsdk/fpdf_doc.cpp | 4 +-- fpdfsdk/fpdf_edit_embeddertest.cpp | 44 +++++++++++++++--------------- fpdfsdk/fpdf_editimg.cpp | 2 +- fpdfsdk/fpdf_editpage.cpp | 2 +- fpdfsdk/fpdf_flatten.cpp | 2 +- fpdfsdk/fpdf_ppo.cpp | 4 +-- fpdfsdk/fpdf_save.cpp | 6 ++-- fpdfsdk/fpdf_view.cpp | 8 +++--- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 6 ++-- fpdfsdk/pwl/cpwl_icon.cpp | 2 +- 15 files changed, 53 insertions(+), 53 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/cpdfsdk_actionhandler.cpp b/fpdfsdk/cpdfsdk_actionhandler.cpp index 6d7fb9f2f9..c9ef6bcdfb 100644 --- a/fpdfsdk/cpdfsdk_actionhandler.cpp +++ b/fpdfsdk/cpdfsdk_actionhandler.cpp @@ -374,7 +374,7 @@ void CPDFSDK_ActionHandler::DoAction_GoTo( const CPDF_Array* pMyArray = MyDest.GetArray(); std::vector posArray; if (pMyArray) { - for (size_t i = 2; i < pMyArray->GetCount(); i++) + for (size_t i = 2; i < pMyArray->size(); i++) posArray.push_back(pMyArray->GetFloatAt(i)); } pFormFillEnv->DoGoToAction(nPageIndex, nFitType, posArray.data(), diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp index 5fe3411d78..dc4f3f96b2 100644 --- a/fpdfsdk/cpdfsdk_baannot.cpp +++ b/fpdfsdk/cpdfsdk_baannot.cpp @@ -192,9 +192,9 @@ BorderStyle CPDFSDK_BAAnnot::GetBorderStyle() const { CPDF_Array* pBorder = GetAnnotDict()->GetArrayFor("Border"); if (pBorder) { - if (pBorder->GetCount() >= 4) { + if (pBorder->size() >= 4) { CPDF_Array* pDP = pBorder->GetArrayAt(3); - if (pDP && pDP->GetCount() > 0) + if (pDP && pDP->size() > 0) return BorderStyle::DASH; } } diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp index cc16cf431c..b2ef675809 100644 --- a/fpdfsdk/cpdfsdk_helpers.cpp +++ b/fpdfsdk/cpdfsdk_helpers.cpp @@ -218,7 +218,7 @@ void ReportUnsupportedFeatures(CPDF_Document* pDoc) { const CPDF_Array* pArray = pJSDict ? pJSDict->GetArrayFor("Names") : nullptr; if (pArray) { - for (size_t i = 0; i < pArray->GetCount(); i++) { + for (size_t i = 0; i < pArray->size(); i++) { ByteString cbStr = pArray->GetStringAt(i); if (cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0) { RaiseUnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW); @@ -353,7 +353,7 @@ CPDF_Array* AddQuadPointsArrayToDictionary(CPDF_Dictionary* dict) { } bool IsValidQuadPointsIndex(const CPDF_Array* array, size_t index) { - return array && index < array->GetCount() / 8; + return array && index < array->size() / 8; } bool GetQuadPointsAtIndex(const CPDF_Array* array, @@ -383,7 +383,7 @@ bool GetQuadPointsFromDictionary(CPDF_Dictionary* dict, ASSERT(quad_points); const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(dict); - if (!pArray || quad_index >= pArray->GetCount() / 8) + if (!pArray || quad_index >= pArray->size() / 8) return false; quad_index *= 8; diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp index b224b0ec88..31be320acf 100644 --- a/fpdfsdk/cpdfsdk_interactiveform.cpp +++ b/fpdfsdk/cpdfsdk_interactiveform.cpp @@ -94,7 +94,7 @@ bool FDFToURLEncodedData(std::vector* pBuffer) { return false; std::ostringstream fdfEncodedData; - for (uint32_t i = 0; i < pFields->GetCount(); i++) { + for (uint32_t i = 0; i < pFields->size(); i++) { CPDF_Dictionary* pField = pFields->GetDictAt(i); if (!pField) continue; @@ -105,7 +105,7 @@ bool FDFToURLEncodedData(std::vector* pBuffer) { WideString csWValue = PDF_DecodeText(csBValue); ByteString csValue_b = csWValue.ToDefANSI(); fdfEncodedData << name_b << "=" << csValue_b; - if (i != pFields->GetCount() - 1) + if (i != pFields->size() - 1) fdfEncodedData << "&"; } @@ -208,7 +208,7 @@ int CPDFSDK_InteractiveForm::GetPageIndexByAnnotDict( for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) { if (CPDF_Dictionary* pPageDict = pDocument->GetPageDictionary(i)) { if (CPDF_Array* pAnnots = pPageDict->GetArrayFor("Annots")) { - for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) { + for (int j = 0, jsz = pAnnots->size(); j < jsz; j++) { CPDF_Object* pDict = pAnnots->GetDirectObjectAt(j); if (pAnnotDict == pDict) return i; diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index 757bb96b2e..c4623bb726 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp @@ -245,7 +245,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page) { return 0; CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots"); - return pAnnots ? pAnnots->GetCount() : 0; + return pAnnots ? pAnnots->size() : 0; } FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page, @@ -255,7 +255,7 @@ FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page, return nullptr; CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots"); - if (!pAnnots || static_cast(index) >= pAnnots->GetCount()) + if (!pAnnots || static_cast(index) >= pAnnots->size()) return nullptr; CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(index)); @@ -300,7 +300,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page, return false; CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots"); - if (!pAnnots || static_cast(index) >= pAnnots->GetCount()) + if (!pAnnots || static_cast(index) >= pAnnots->size()) return false; pAnnots->RemoveAt(index); @@ -630,7 +630,7 @@ FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot) { CPDF_Dictionary* pAnnotDict = CPDFAnnotContextFromFPDFAnnotation(annot)->GetAnnotDict(); const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(pAnnotDict); - return pArray ? pArray->GetCount() / 8 : 0; + return pArray ? pArray->size() / 8 : 0; } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp index 28c670c5dd..0a2f589ecc 100644 --- a/fpdfsdk/fpdf_doc.cpp +++ b/fpdfsdk/fpdf_doc.cpp @@ -340,7 +340,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots"); if (!pAnnots) return false; - for (size_t i = *start_pos; i < pAnnots->GetCount(); i++) { + for (size_t i = *start_pos; i < pAnnots->size(); i++) { CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i)); if (!pDict) continue; @@ -365,7 +365,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK link_annot, FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot) { const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(CPDFDictionaryFromFPDFLink(link_annot)); - return pArray ? static_cast(pArray->GetCount() / 8) : 0; + return pArray ? static_cast(pArray->size() / 8) : 0; } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 4250091fce..9cd7dbf86b 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp @@ -58,7 +58,7 @@ class FPDFEditEmbeddertest : public EmbedderTest { const CPDF_Array* fontBBox = font_desc->GetArrayFor("FontBBox"); ASSERT_TRUE(fontBBox); - EXPECT_EQ(4u, fontBBox->GetCount()); + EXPECT_EQ(4u, fontBBox->size()); // Check that the coordinates are in the preferred order according to spec // 1.7 Section 3.8.4 EXPECT_TRUE(fontBBox->GetIntegerAt(0) < fontBBox->GetIntegerAt(2)); @@ -97,18 +97,18 @@ class FPDFEditEmbeddertest : public EmbedderTest { // Check that W array is in a format that conforms to PDF spec 1.7 section // "Glyph Metrics in CIDFonts" (these checks are not // implementation-specific). - EXPECT_GT(widths_array->GetCount(), 1u); + EXPECT_GT(widths_array->size(), 1u); int num_cids_checked = 0; int cur_cid = 0; - for (size_t idx = 0; idx < widths_array->GetCount(); idx++) { + for (size_t idx = 0; idx < widths_array->size(); idx++) { int cid = widths_array->GetNumberAt(idx); EXPECT_GE(cid, cur_cid); - ASSERT_FALSE(++idx == widths_array->GetCount()); + ASSERT_FALSE(++idx == widths_array->size()); const CPDF_Object* next = widths_array->GetObjectAt(idx); if (next->IsArray()) { // We are in the c [w1 w2 ...] case const CPDF_Array* arr = next->AsArray(); - int cnt = static_cast(arr->GetCount()); + int cnt = static_cast(arr->size()); size_t inner_idx = 0; for (cur_cid = cid; cur_cid < cid + cnt; cur_cid++) { uint32_t width = arr->GetNumberAt(inner_idx++); @@ -121,7 +121,7 @@ class FPDFEditEmbeddertest : public EmbedderTest { // Otherwise, are in the c_first c_last w case. ASSERT_TRUE(next->IsNumber()); int last_cid = next->AsNumber()->GetInteger(); - ASSERT_FALSE(++idx == widths_array->GetCount()); + ASSERT_FALSE(++idx == widths_array->size()); uint32_t width = widths_array->GetNumberAt(idx); for (cur_cid = cid; cur_cid <= last_cid; cur_cid++) { EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid)) @@ -2053,7 +2053,7 @@ TEST_F(FPDFEditEmbeddertest, GraphicsData) { CPDF_Page* cpage = CPDFPageFromFPDFPage(page.get()); CPDF_Dictionary* graphics_dict = cpage->m_pResources->GetDictFor("ExtGState"); ASSERT_TRUE(graphics_dict); - EXPECT_EQ(2u, graphics_dict->GetCount()); + EXPECT_EQ(2u, graphics_dict->size()); // Add a text object causing no change to the graphics dictionary FPDF_PAGEOBJECT text1 = FPDFPageObj_NewTextObj(document(), "Arial", 12.0f); @@ -2062,7 +2062,7 @@ TEST_F(FPDFEditEmbeddertest, GraphicsData) { EXPECT_TRUE(FPDFText_SetFillColor(text1, 100, 100, 100, 255)); FPDFPage_InsertObject(page.get(), text1); EXPECT_TRUE(FPDFPage_GenerateContent(page.get())); - EXPECT_EQ(2u, graphics_dict->GetCount()); + EXPECT_EQ(2u, graphics_dict->size()); // Add a text object increasing the size of the graphics dictionary FPDF_PAGEOBJECT text2 = @@ -2071,7 +2071,7 @@ TEST_F(FPDFEditEmbeddertest, GraphicsData) { FPDFPageObj_SetBlendMode(text2, "Darken"); EXPECT_TRUE(FPDFText_SetFillColor(text2, 0, 0, 255, 150)); EXPECT_TRUE(FPDFPage_GenerateContent(page.get())); - EXPECT_EQ(3u, graphics_dict->GetCount()); + EXPECT_EQ(3u, graphics_dict->size()); // Add a path that should reuse graphics FPDF_PAGEOBJECT path = FPDFPageObj_CreateNewPath(400, 100); @@ -2079,7 +2079,7 @@ TEST_F(FPDFEditEmbeddertest, GraphicsData) { EXPECT_TRUE(FPDFPath_SetFillColor(path, 200, 200, 100, 150)); FPDFPage_InsertObject(page.get(), path); EXPECT_TRUE(FPDFPage_GenerateContent(page.get())); - EXPECT_EQ(3u, graphics_dict->GetCount()); + EXPECT_EQ(3u, graphics_dict->size()); // Add a rect increasing the size of the graphics dictionary FPDF_PAGEOBJECT rect2 = FPDFPageObj_CreateNewRect(10, 10, 100, 100); @@ -2088,7 +2088,7 @@ TEST_F(FPDFEditEmbeddertest, GraphicsData) { EXPECT_TRUE(FPDFPath_SetStrokeColor(rect2, 0, 0, 0, 200)); FPDFPage_InsertObject(page.get(), rect2); EXPECT_TRUE(FPDFPage_GenerateContent(page.get())); - EXPECT_EQ(4u, graphics_dict->GetCount()); + EXPECT_EQ(4u, graphics_dict->size()); } TEST_F(FPDFEditEmbeddertest, DoubleGenerating) { @@ -2106,7 +2106,7 @@ TEST_F(FPDFEditEmbeddertest, DoubleGenerating) { CPDF_Page* cpage = CPDFPageFromFPDFPage(page); CPDF_Dictionary* graphics_dict = cpage->m_pResources->GetDictFor("ExtGState"); ASSERT_TRUE(graphics_dict); - EXPECT_EQ(2u, graphics_dict->GetCount()); + EXPECT_EQ(2u, graphics_dict->size()); // Check the bitmap { @@ -2118,7 +2118,7 @@ TEST_F(FPDFEditEmbeddertest, DoubleGenerating) { // Never mind, my new favorite color is blue, increase alpha EXPECT_TRUE(FPDFPath_SetFillColor(rect, 0, 0, 255, 180)); EXPECT_TRUE(FPDFPage_GenerateContent(page)); - EXPECT_EQ(3u, graphics_dict->GetCount()); + EXPECT_EQ(3u, graphics_dict->size()); // Check that bitmap displays changed content { @@ -2129,7 +2129,7 @@ TEST_F(FPDFEditEmbeddertest, DoubleGenerating) { // And now generate, without changes EXPECT_TRUE(FPDFPage_GenerateContent(page)); - EXPECT_EQ(3u, graphics_dict->GetCount()); + EXPECT_EQ(3u, graphics_dict->size()); { ScopedFPDFBitmap page_bitmap = RenderPageWithFlags(page, nullptr, 0); CompareBitmap(page_bitmap.get(), 612, 792, @@ -2147,12 +2147,12 @@ TEST_F(FPDFEditEmbeddertest, DoubleGenerating) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); CPDF_Dictionary* font_dict = cpage->m_pResources->GetDictFor("Font"); ASSERT_TRUE(font_dict); - EXPECT_EQ(1u, font_dict->GetCount()); + EXPECT_EQ(1u, font_dict->size()); // Generate yet again, check dicts are reasonably sized EXPECT_TRUE(FPDFPage_GenerateContent(page)); - EXPECT_EQ(3u, graphics_dict->GetCount()); - EXPECT_EQ(1u, font_dict->GetCount()); + EXPECT_EQ(3u, graphics_dict->size()); + EXPECT_EQ(1u, font_dict->size()); FPDF_ClosePage(page); } @@ -2179,7 +2179,7 @@ TEST_F(FPDFEditEmbeddertest, LoadSimpleType1Font) { const CPDF_Array* widths_array = font_dict->GetArrayFor("Widths"); ASSERT_TRUE(widths_array); - ASSERT_EQ(224u, widths_array->GetCount()); + ASSERT_EQ(224u, widths_array->size()); EXPECT_EQ(250, widths_array->GetNumberAt(0)); EXPECT_EQ(569, widths_array->GetNumberAt(11)); EXPECT_EQ(500, widths_array->GetNumberAt(223)); @@ -2207,7 +2207,7 @@ TEST_F(FPDFEditEmbeddertest, LoadSimpleTrueTypeFont) { const CPDF_Array* widths_array = font_dict->GetArrayFor("Widths"); ASSERT_TRUE(widths_array); - ASSERT_EQ(224u, widths_array->GetCount()); + ASSERT_EQ(224u, widths_array->size()); EXPECT_EQ(600, widths_array->GetNumberAt(33)); EXPECT_EQ(600, widths_array->GetNumberAt(74)); EXPECT_EQ(600, widths_array->GetNumberAt(223)); @@ -2234,7 +2234,7 @@ TEST_F(FPDFEditEmbeddertest, LoadCIDType0Font) { const CPDF_Array* descendant_array = font_dict->GetArrayFor("DescendantFonts"); ASSERT_TRUE(descendant_array); - EXPECT_EQ(1u, descendant_array->GetCount()); + EXPECT_EQ(1u, descendant_array->size()); // Check the CIDFontDict const CPDF_Dictionary* cidfont_dict = descendant_array->GetDictAt(0); @@ -2252,7 +2252,7 @@ TEST_F(FPDFEditEmbeddertest, LoadCIDType0Font) { // Check widths const CPDF_Array* widths_array = cidfont_dict->GetArrayFor("W"); ASSERT_TRUE(widths_array); - EXPECT_GT(widths_array->GetCount(), 1u); + EXPECT_GT(widths_array->size(), 1u); CheckCompositeFontWidths(widths_array, typed_font); } @@ -2276,7 +2276,7 @@ TEST_F(FPDFEditEmbeddertest, LoadCIDType2Font) { const CPDF_Array* descendant_array = font_dict->GetArrayFor("DescendantFonts"); ASSERT_TRUE(descendant_array); - EXPECT_EQ(1u, descendant_array->GetCount()); + EXPECT_EQ(1u, descendant_array->size()); // Check the CIDFontDict const CPDF_Dictionary* cidfont_dict = descendant_array->GetDictAt(0); diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp index aaa1c46c76..be7e571afe 100644 --- a/fpdfsdk/fpdf_editimg.cpp +++ b/fpdfsdk/fpdf_editimg.cpp @@ -250,7 +250,7 @@ FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object) { return 0; if (pFilter->IsArray()) - return pFilter->AsArray()->GetCount(); + return pFilter->AsArray()->size(); if (pFilter->IsName()) return 1; diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index 77d03051b2..8c9a33d816 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -373,7 +373,7 @@ FPDFPageObjMark_CountParams(FPDF_PAGEOBJECTMARK mark) { CPDFContentMarkItemFromFPDFPageObjectMark(mark); const CPDF_Dictionary* pParams = pMarkItem->GetParam(); - return pParams ? pParams->GetCount() : 0; + return pParams ? pParams->size() : 0; } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index 29d81c2c66..93490ad859 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -341,7 +341,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { if (!sAnnotState.IsEmpty()) { pAPStream = pAPDic->GetStreamFor(sAnnotState); } else { - if (pAPDic->GetCount() > 0) { + if (pAPDic->size() > 0) { CPDF_Object* pFirstObj = pAPDic->begin()->second.get(); if (pFirstObj) { if (pFirstObj->IsReference()) diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp index 1d093a1f3d..b3d4ff53cb 100644 --- a/fpdfsdk/fpdf_ppo.cpp +++ b/fpdfsdk/fpdf_ppo.cpp @@ -383,7 +383,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, } case CPDF_Object::ARRAY: { CPDF_Array* pArray = pObj->AsArray(); - for (size_t i = 0; i < pArray->GetCount(); ++i) { + for (size_t i = 0; i < pArray->size(); ++i) { CPDF_Object* pNextObj = pArray->GetObjectAt(i); if (!pNextObj) return false; @@ -708,7 +708,7 @@ uint32_t CPDF_NPageToOneExporter::MakeXObject( if (const CPDF_Array* pSrcContentArray = ToArray(pSrcContentObj)) { ByteString bsSrcContentStream; - for (size_t i = 0; i < pSrcContentArray->GetCount(); ++i) { + for (size_t i = 0; i < pSrcContentArray->size(); ++i) { const CPDF_Stream* pStream = pSrcContentArray->GetStreamAt(i); auto pAcc = pdfium::MakeRetain(pStream); pAcc->LoadAllDataFiltered(); diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp index 16d7da2101..237c262c79 100644 --- a/fpdfsdk/fpdf_save.cpp +++ b/fpdfsdk/fpdf_save.cpp @@ -78,7 +78,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext, if (!pArray) return false; - int size = pArray->GetCount(); + int size = pArray->size(); int iFormIndex = -1; int iDataSetsIndex = -1; int iLast = size - 2; @@ -139,7 +139,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext, } else { CPDF_Stream* pData = pPDFDocument->NewIndirect(); pData->InitStreamFromFile(pDsfileWrite, std::move(pDataDict)); - iLast = pArray->GetCount() - 2; + iLast = pArray->size() - 2; pArray->InsertNewAt(iLast, "datasets", false); pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument)); } @@ -164,7 +164,7 @@ bool SaveXFADocumentData(CPDFXFA_Context* pContext, } else { CPDF_Stream* pData = pPDFDocument->NewIndirect(); pData->InitStreamFromFile(pfileWrite, std::move(pDataDict)); - iLast = pArray->GetCount() - 2; + iLast = pArray->size() - 2; pArray->InsertNewAt(iLast, "form", false); pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument)); } diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp index 247a90240b..83d7e4a6cb 100644 --- a/fpdfsdk/fpdf_view.cpp +++ b/fpdfsdk/fpdf_view.cpp @@ -985,14 +985,14 @@ FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document) { FPDF_EXPORT size_t FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRangeCount(FPDF_PAGERANGE pagerange) { const CPDF_Array* pArray = CPDFArrayFromFPDFPageRange(pagerange); - return pArray ? pArray->GetCount() : 0; + return pArray ? pArray->size() : 0; } FPDF_EXPORT int FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRangeElement(FPDF_PAGERANGE pagerange, size_t index) { const CPDF_Array* pArray = CPDFArrayFromFPDFPageRange(pagerange); - if (!pArray || index >= pArray->GetCount()) + if (!pArray || index >= pArray->size()) return -1; return pArray->GetIntegerAt(index); } @@ -1047,7 +1047,7 @@ FPDF_CountNamedDests(FPDF_DOCUMENT document) { pdfium::base::CheckedNumeric count = nameTree.GetCount(); const CPDF_Dictionary* pDest = pRoot->GetDictFor("Dests"); if (pDest) - count += pDest->GetCount(); + count += pDest->size(); if (!count.IsValid()) return 0; @@ -1145,7 +1145,7 @@ FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document, return nullptr; pdfium::base::CheckedNumeric checked_count = count; - checked_count += pDest->GetCount(); + checked_count += pDest->size(); if (!checked_count.IsValid() || index >= checked_count.ValueOrDie()) return nullptr; diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 6cf4bff833..e9cd2f6f99 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -467,7 +467,7 @@ void CPDFXFA_DocEnvironment::ExportData(CXFA_FFDoc* hDoc, if (!pArray) return; - for (size_t i = 1; i < pArray->GetCount(); i += 2) { + for (size_t i = 1; i < pArray->size(); i += 2) { const CPDF_Object* pPDFObj = pArray->GetObjectAt(i); const CPDF_Object* pPrePDFObj = pArray->GetObjectAt(i - 1); if (!pPrePDFObj->IsString()) @@ -492,7 +492,7 @@ void CPDFXFA_DocEnvironment::ExportData(CXFA_FFDoc* hDoc, fileWrite); continue; } - if (i == pArray->GetCount() - 1) { + if (i == pArray->size() - 1) { WideString wPath = WideString::FromUTF16LE( reinterpret_cast(bs.c_str()), bs.GetLength() / sizeof(unsigned short)); @@ -763,7 +763,7 @@ bool CPDFXFA_DocEnvironment::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler, return false; } - for (size_t i = 1; i < pArray->GetCount(); i += 2) { + for (size_t i = 1; i < pArray->size(); i += 2) { const CPDF_Object* pPDFObj = pArray->GetObjectAt(i); const CPDF_Object* pPrePDFObj = pArray->GetObjectAt(i - 1); if (!pPrePDFObj->IsString()) diff --git a/fpdfsdk/pwl/cpwl_icon.cpp b/fpdfsdk/pwl/cpwl_icon.cpp index f0232c4ae4..407e866766 100644 --- a/fpdfsdk/pwl/cpwl_icon.cpp +++ b/fpdfsdk/pwl/cpwl_icon.cpp @@ -55,7 +55,7 @@ std::pair CPWL_Icon::GetIconPosition() { if (!pA) return {0.0f, 0.0f}; - size_t dwCount = pA->GetCount(); + size_t dwCount = pA->size(); return {dwCount > 0 ? pA->GetNumberAt(0) : 0.0f, dwCount > 1 ? pA->GetNumberAt(1) : 0.0f}; } -- cgit v1.2.3