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 <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_actionhandler.cpp b/fpdfsdk/cpdfsdk_actionhandler.cpp
index 6d7fb9f..c9ef6bc 100644
--- a/fpdfsdk/cpdfsdk_actionhandler.cpp
+++ b/fpdfsdk/cpdfsdk_actionhandler.cpp
@@ -374,7 +374,7 @@
   const CPDF_Array* pMyArray = MyDest.GetArray();
   std::vector<float> 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 5fe3411..dc4f3f9 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -192,9 +192,9 @@
 
   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 cc16cf4..b2ef675 100644
--- a/fpdfsdk/cpdfsdk_helpers.cpp
+++ b/fpdfsdk/cpdfsdk_helpers.cpp
@@ -218,7 +218,7 @@
         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 @@
 }
 
 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 @@
   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 b224b0e..31be320 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -94,7 +94,7 @@
     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 @@
     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 @@
   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 757bb96..c4623bb 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -245,7 +245,7 @@
     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 @@
     return nullptr;
 
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
-  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
+  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->size())
     return nullptr;
 
   CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(index));
@@ -300,7 +300,7 @@
     return false;
 
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
-  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
+  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->size())
     return false;
 
   pAnnots->RemoveAt(index);
@@ -630,7 +630,7 @@
   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 28c670c..0a2f589 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -340,7 +340,7 @@
   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 int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot) {
   const CPDF_Array* pArray =
       GetQuadPointsArrayFromDictionary(CPDFDictionaryFromFPDFLink(link_annot));
-  return pArray ? static_cast<int>(pArray->GetCount() / 8) : 0;
+  return pArray ? static_cast<int>(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 4250091..9cd7dbf 100644
--- a/fpdfsdk/fpdf_edit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -58,7 +58,7 @@
 
     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 @@
     // 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<int>(arr->GetCount());
+        int cnt = static_cast<int>(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 @@
       // 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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   // 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 @@
 
   // 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 @@
   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 @@
 
   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 @@
 
   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 @@
   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 @@
   // 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 @@
   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 aaa1c46..be7e571 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -250,7 +250,7 @@
     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 77d0305..8c9a33d 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -373,7 +373,7 @@
       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 29d81c2..93490ad 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -341,7 +341,7 @@
       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 1d093a1..b3d4ff5 100644
--- a/fpdfsdk/fpdf_ppo.cpp
+++ b/fpdfsdk/fpdf_ppo.cpp
@@ -383,7 +383,7 @@
     }
     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 @@
 
   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<CPDF_StreamAcc>(pStream);
       pAcc->LoadAllDataFiltered();
diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp
index 16d7da2..237c262 100644
--- a/fpdfsdk/fpdf_save.cpp
+++ b/fpdfsdk/fpdf_save.cpp
@@ -78,7 +78,7 @@
   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 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pDsfileWrite, std::move(pDataDict));
-        iLast = pArray->GetCount() - 2;
+        iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "datasets", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
@@ -164,7 +164,7 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pfileWrite, std::move(pDataDict));
-        iLast = pArray->GetCount() - 2;
+        iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "form", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 247a902..83d7e4a 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -985,14 +985,14 @@
 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 @@
   pdfium::base::CheckedNumeric<FPDF_DWORD> 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 @@
       return nullptr;
 
     pdfium::base::CheckedNumeric<int> 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 6cf4bff..e9cd2f6 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -467,7 +467,7 @@
     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 @@
             fileWrite);
         continue;
       }
-      if (i == pArray->GetCount() - 1) {
+      if (i == pArray->size() - 1) {
         WideString wPath = WideString::FromUTF16LE(
             reinterpret_cast<const unsigned short*>(bs.c_str()),
             bs.GetLength() / sizeof(unsigned short));
@@ -763,7 +763,7 @@
     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 f0232c4..407e866 100644
--- a/fpdfsdk/pwl/cpwl_icon.cpp
+++ b/fpdfsdk/pwl/cpwl_icon.cpp
@@ -55,7 +55,7 @@
   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};
 }