Rename CPDF_Array::GetStringAt() to GetByteStringAt()

Similar to https://pdfium-review.googlesource.com/c/pdfium/+/97970 but
for CPDF_Arrays.

Change-Id: Ic9f884a841d7ad5d4391ca4d5e7b920ec84e7caf
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/97971
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_allstates.cpp b/core/fpdfapi/page/cpdf_allstates.cpp
index 37a015b..bba6333 100644
--- a/core/fpdfapi/page/cpdf_allstates.cpp
+++ b/core/fpdfapi/page/cpdf_allstates.cpp
@@ -88,7 +88,7 @@
           break;
 
         m_TextState.SetFontSize(pFont->GetFloatAt(1));
-        m_TextState.SetFont(pParser->FindFont(pFont->GetStringAt(0)));
+        m_TextState.SetFont(pParser->FindFont(pFont->GetByteStringAt(0)));
         break;
       }
       case FXBSTR_ID('T', 'R', 0, 0):
@@ -101,7 +101,7 @@
         break;
       case FXBSTR_ID('B', 'M', 0, 0): {
         const CPDF_Array* pArray = pObject->AsArray();
-        m_GeneralState.SetBlendMode(pArray ? pArray->GetStringAt(0)
+        m_GeneralState.SetBlendMode(pArray ? pArray->GetByteStringAt(0)
                                            : pObject->GetString());
         if (m_GeneralState.GetBlendType() > BlendMode::kMultiply)
           pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(true);
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 48b87d8..c31c8ef 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -1111,7 +1111,7 @@
 uint32_t CPDF_SeparationCS::v_Load(CPDF_Document* pDoc,
                                    const CPDF_Array* pArray,
                                    std::set<const CPDF_Object*>* pVisited) {
-  m_IsNoneType = pArray->GetStringAt(1) == "None";
+  m_IsNoneType = pArray->GetByteStringAt(1) == "None";
   if (m_IsNoneType)
     return 1;
 
diff --git a/core/fpdfapi/page/cpdf_occontext.cpp b/core/fpdfapi/page/cpdf_occontext.cpp
index b077456..442bb2d 100644
--- a/core/fpdfapi/page/cpdf_occontext.cpp
+++ b/core/fpdfapi/page/cpdf_occontext.cpp
@@ -24,7 +24,7 @@
   ByteString bsIntent;
   if (const CPDF_Array* pArray = pIntent->AsArray()) {
     for (size_t i = 0; i < pArray->size(); i++) {
-      bsIntent = pArray->GetStringAt(i);
+      bsIntent = pArray->GetByteStringAt(i);
       if (bsIntent == "All" || bsIntent == csElement)
         return true;
     }
@@ -187,7 +187,7 @@
   if (nLevel > 32 || !pExpression)
     return false;
 
-  ByteString csOperator = pExpression->GetStringAt(0);
+  ByteString csOperator = pExpression->GetByteStringAt(0);
   if (csOperator == "Not") {
     RetainPtr<const CPDF_Object> pOCGObj = pExpression->GetDirectObjectAt(1);
     if (!pOCGObj)
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index 04e0625..da58c04 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -144,7 +144,7 @@
   if (pFilter) {
     const CPDF_Array* pArray = pFilter->AsArray();
     if (pArray) {
-      decoder = pArray->GetStringAt(0);
+      decoder = pArray->GetByteStringAt(0);
       const CPDF_Array* pParams =
           pDict->GetArrayFor(pdfium::stream::kDecodeParms);
       if (pParams)
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index d8c292a..97dadec 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -118,7 +118,7 @@
   return pObj ? pObj->GetMutableDirect() : nullptr;
 }
 
-ByteString CPDF_Array::GetStringAt(size_t index) const {
+ByteString CPDF_Array::GetByteStringAt(size_t index) const {
   if (index >= m_Objects.size())
     return ByteString();
   return m_Objects[index]->GetString();
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index 7c52dd0..bca9203 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -55,7 +55,7 @@
   // The Get*At() methods tolerate out-of-bounds indices and return nullptr
   // in those cases. Furthermore, these safely coerce to the sub-class,
   // returning nullptr if the object at the location is of a different type.
-  ByteString GetStringAt(size_t index) const;
+  ByteString GetByteStringAt(size_t index) const;
   WideString GetUnicodeTextAt(size_t index) const;
   bool GetBooleanAt(size_t index, bool bDefault) const;
   int GetIntegerAt(size_t index) const;
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index 7784581..898fcf4 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -38,7 +38,7 @@
                         CPDF_Array* arr_val,
                         CPDF_Dictionary* dict_val,
                         CPDF_Stream* stream_val) {
-  EXPECT_STREQ(str_val, arr->GetStringAt(index).c_str());
+  EXPECT_STREQ(str_val, arr->GetByteStringAt(index).c_str());
   EXPECT_EQ(int_val, arr->GetIntegerAt(index));
   EXPECT_EQ(float_val, arr->GetFloatAt(index));
   EXPECT_EQ(arr_val, arr->GetArrayAt(index));
@@ -714,7 +714,7 @@
     const float expected_float[] = {0, 0, 0, -1234, 2345, 0.05f, 0,
                                     0, 0, 0, 0,     0,    0,     0};
     for (size_t i = 0; i < arr->size(); ++i) {
-      EXPECT_STREQ(expected_str[i], arr->GetStringAt(i).c_str());
+      EXPECT_STREQ(expected_str[i], arr->GetByteStringAt(i).c_str());
       EXPECT_EQ(expected_int[i], arr->GetIntegerAt(i));
       EXPECT_EQ(expected_float[i], arr->GetFloatAt(i));
       if (i == 11)
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp
index d3a42e8..ce934b9 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_security_handler.cpp
@@ -192,7 +192,7 @@
                                   const CPDF_Array* pIdArray,
                                   const ByteString& password) {
   if (pIdArray)
-    m_FileId = pIdArray->GetStringAt(0);
+    m_FileId = pIdArray->GetByteStringAt(0);
   else
     m_FileId.clear();
   if (!LoadDict(pEncryptDict))
@@ -592,7 +592,7 @@
 
   ByteString file_id;
   if (pIdArray)
-    file_id = pIdArray->GetStringAt(0);
+    file_id = pIdArray->GetByteStringAt(0);
 
   CalcEncryptKey(m_pEncryptDict.Get(), user_password, m_EncryptKey, key_len,
                  false, file_id);
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index d25df9d..b3edcf0 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -106,7 +106,7 @@
       "FlateDecode",    "Fl",  "LZWDecode",       "LZW", "ASCII85Decode", "A85",
       "ASCIIHexDecode", "AHx", "RunLengthDecode", "RL"};
   for (size_t i = 0; i < count - 1; ++i) {
-    if (!pdfium::Contains(kValidDecoders, pDecoders->GetStringAt(i)))
+    if (!pdfium::Contains(kValidDecoders, pDecoders->GetByteStringAt(i)))
       return false;
   }
   return true;
@@ -384,7 +384,7 @@
     for (size_t i = 0; i < pDecoders->size(); ++i) {
       // TODO(tsepez): push retained arguments.
       decoder_array.push_back(
-          {pDecoders->GetStringAt(i),
+          {pDecoders->GetByteStringAt(i),
            pParamsArray ? pParamsArray->GetDictAt(i).Get() : nullptr});
     }
   } else {
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 5741807..ab90199 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -90,7 +90,7 @@
   const CPDF_Array* pArray =
       ToArray(CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "Opt"));
   if (pArray)
-    csOn = pArray->GetStringAt(m_pField->GetControlIndex(this));
+    csOn = pArray->GetByteStringAt(m_pField->GetControlIndex(this));
   if (csOn.IsEmpty())
     csOn = "Yes";
   return PDF_DecodeText(csOn.raw_span());
diff --git a/core/fpdfdoc/cpdf_nametree_unittest.cpp b/core/fpdfdoc/cpdf_nametree_unittest.cpp
index 601e9b5..b6c5790 100644
--- a/core/fpdfdoc/cpdf_nametree_unittest.cpp
+++ b/core/fpdfdoc/cpdf_nametree_unittest.cpp
@@ -22,7 +22,7 @@
                        const char* key,
                        int value) {
   ASSERT_TRUE(names);
-  EXPECT_STREQ(key, names->GetStringAt(pair_index * 2).c_str());
+  EXPECT_STREQ(key, names->GetByteStringAt(pair_index * 2).c_str());
   EXPECT_EQ(value, names->GetIntegerAt(pair_index * 2 + 1));
 }
 
diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp
index a4b49da..fef517b 100644
--- a/fpdfsdk/cpdfsdk_helpers.cpp
+++ b/fpdfsdk/cpdfsdk_helpers.cpp
@@ -367,7 +367,7 @@
       const CPDF_Array* pArray = pJSDict->GetArrayFor("Names");
       if (pArray) {
         for (size_t i = 0; i < pArray->size(); i++) {
-          ByteString cbStr = pArray->GetStringAt(i);
+          ByteString cbStr = pArray->GetByteStringAt(i);
           if (cbStr == "com.adobe.acrobat.SharedReview.Register") {
             RaiseUnsupportedError(FPDF_UNSP_DOC_SHAREDREVIEW);
             break;
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp
index 0b63e5e..4b4469f 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -341,7 +341,7 @@
   RetainPtr<const CPDF_Object> pFilter = pDict->GetDirectObjectFor("Filter");
   ByteString bsFilter = pFilter->IsName()
                             ? pFilter->AsName()->GetString()
-                            : pFilter->AsArray()->GetStringAt(index);
+                            : pFilter->AsArray()->GetByteStringAt(index);
 
   return NulTerminateMaybeCopyAndReturnLength(bsFilter, buffer, buflen);
 }