Rename FPDF functions in cpdf_formfield.h.

Make them static methods in CPDF_FormField instead, without the FPDF
prefix.

Change-Id: I6b8f71e6a5f5953364f0ecb5b2841d4d07f0225e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/65415
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cba_fontmap.cpp b/core/fpdfdoc/cba_fontmap.cpp
index f457b6a..52e4b53 100644
--- a/core/fpdfdoc/cba_fontmap.cpp
+++ b/core/fpdfdoc/cba_fontmap.cpp
@@ -264,13 +264,14 @@
   }
 
   ByteString sDA;
-  const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pAnnotDict.Get(), "DA");
+  const CPDF_Object* pObj =
+      CPDF_FormField::GetFieldAttr(m_pAnnotDict.Get(), "DA");
   if (pObj)
     sDA = pObj->GetString();
 
   if (bWidget) {
     if (sDA.IsEmpty()) {
-      pObj = FPDF_GetFieldAttr(pAcroFormDict, "DA");
+      pObj = CPDF_FormField::GetFieldAttr(pAcroFormDict, "DA");
       sDA = pObj ? pObj->GetString() : ByteString();
     }
   }
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index b1ceb57..37208e3 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -129,7 +129,7 @@
   }
 
   CPDF_Object* pFieldTypeObj =
-      FPDF_GetFieldAttr(pAnnotDict, pdfium::form_fields::kFT);
+      CPDF_FormField::GetFieldAttr(pAnnotDict, pdfium::form_fields::kFT);
   if (!pFieldTypeObj)
     return;
 
@@ -141,7 +141,7 @@
   }
 
   CPDF_Object* pFieldFlagsObj =
-      FPDF_GetFieldAttr(pAnnotDict, pdfium::form_fields::kFf);
+      CPDF_FormField::GetFieldAttr(pAnnotDict, pdfium::form_fields::kFf);
   uint32_t flags = pFieldFlagsObj ? pFieldFlagsObj->GetInteger() : 0;
   if (field_type == pdfium::form_fields::kCh) {
     auto type = (flags & pdfium::form_flags::kChoiceCombo)
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 3b7b9b3..b98afba 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -63,7 +63,7 @@
   ASSERT(GetType() == CPDF_FormField::kCheckBox ||
          GetType() == CPDF_FormField::kRadioButton);
   ByteString csOn = GetOnStateName();
-  if (ToArray(FPDF_GetFieldAttr(m_pField->GetDict(), "Opt")))
+  if (ToArray(CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "Opt")))
     csOn = ByteString::Format("%d", m_pField->GetControlIndex(this));
   if (csOn.IsEmpty())
     csOn = "Yes";
@@ -74,7 +74,8 @@
   ASSERT(GetType() == CPDF_FormField::kCheckBox ||
          GetType() == CPDF_FormField::kRadioButton);
   ByteString csOn = GetOnStateName();
-  CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pField->GetDict(), "Opt"));
+  CPDF_Array* pArray =
+      ToArray(CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "Opt"));
   if (pArray)
     csOn = pArray->GetStringAt(m_pField->GetControlIndex(this));
   if (csOn.IsEmpty())
@@ -93,7 +94,7 @@
 bool CPDF_FormControl::IsDefaultChecked() const {
   ASSERT(GetType() == CPDF_FormField::kCheckBox ||
          GetType() == CPDF_FormField::kRadioButton);
-  CPDF_Object* pDV = FPDF_GetFieldAttr(m_pField->GetDict(), "DV");
+  CPDF_Object* pDV = CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "DV");
   if (!pDV)
     return false;
 
@@ -177,7 +178,7 @@
   if (m_pWidgetDict->KeyExist("A"))
     return CPDF_Action(m_pWidgetDict->GetDictFor("A"));
 
-  CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->GetDict(), "A");
+  CPDF_Object* pObj = CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "A");
   return CPDF_Action(pObj ? pObj->GetDict() : nullptr);
 }
 
@@ -197,7 +198,7 @@
   if (m_pWidgetDict->KeyExist("DA"))
     return CPDF_DefaultAppearance(m_pWidgetDict->GetStringFor("DA"));
 
-  CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->GetDict(), "DA");
+  CPDF_Object* pObj = CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "DA");
   if (!pObj)
     return m_pForm->GetDefaultAppearance();
   return CPDF_DefaultAppearance(pObj->GetString());
@@ -218,7 +219,7 @@
   if (!csFontNameTag || csFontNameTag->IsEmpty())
     return nullptr;
 
-  CPDF_Object* pObj = FPDF_GetFieldAttr(m_pWidgetDict.Get(), "DR");
+  CPDF_Object* pObj = CPDF_FormField::GetFieldAttr(m_pWidgetDict.Get(), "DR");
   if (CPDF_Dictionary* pDict = ToDictionary(pObj)) {
     CPDF_Dictionary* pFonts = pDict->GetDictFor("Font");
     if (ValidateFontResourceDict(pFonts)) {
@@ -237,7 +238,7 @@
 
   CPDF_Dictionary* pPageDict = m_pWidgetDict->GetDictFor("P");
   CPDF_Dictionary* pDict =
-      ToDictionary(FPDF_GetFieldAttr(pPageDict, "Resources"));
+      ToDictionary(CPDF_FormField::GetFieldAttr(pPageDict, "Resources"));
   if (!pDict)
     return nullptr;
 
@@ -259,7 +260,7 @@
   if (m_pWidgetDict->KeyExist("Q"))
     return m_pWidgetDict->GetIntegerFor("Q", 0);
 
-  CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->GetDict(), "Q");
+  CPDF_Object* pObj = CPDF_FormField::GetFieldAttr(m_pField->GetDict(), "Q");
   if (pObj)
     return pObj->GetInteger();
   return m_pForm->GetFormAlignment();
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index e779c40..3c73a77 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -32,9 +32,9 @@
 
 namespace {
 
-const CPDF_Object* FPDF_GetFieldAttrRecursive(const CPDF_Dictionary* pFieldDict,
-                                              const char* name,
-                                              int nLevel) {
+const CPDF_Object* GetFieldAttrRecursive(const CPDF_Dictionary* pFieldDict,
+                                         const char* name,
+                                         int nLevel) {
   static constexpr int kGetFieldMaxRecursion = 32;
   if (!pFieldDict || nLevel > kGetFieldMaxRecursion)
     return nullptr;
@@ -43,13 +43,14 @@
   if (pAttr)
     return pAttr;
 
-  return FPDF_GetFieldAttrRecursive(
+  return GetFieldAttrRecursive(
       pFieldDict->GetDictFor(pdfium::form_fields::kParent), name, nLevel + 1);
 }
 
 }  // namespace
 
-Optional<FormFieldType> IntToFormFieldType(int value) {
+// static
+Optional<FormFieldType> CPDF_FormField::IntToFormFieldType(int value) {
   if (value >= static_cast<int>(FormFieldType::kUnknown) &&
       value < static_cast<int>(kFormFieldTypeCount)) {
     return {static_cast<FormFieldType>(value)};
@@ -57,17 +58,22 @@
   return {};
 }
 
-const CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
-                                     const char* name) {
-  return FPDF_GetFieldAttrRecursive(pFieldDict, name, 0);
+// static
+const CPDF_Object* CPDF_FormField::GetFieldAttr(
+    const CPDF_Dictionary* pFieldDict,
+    const char* name) {
+  return GetFieldAttrRecursive(pFieldDict, name, 0);
 }
 
-CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const char* name) {
-  return const_cast<CPDF_Object*>(FPDF_GetFieldAttrRecursive(
+// static
+CPDF_Object* CPDF_FormField::GetFieldAttr(CPDF_Dictionary* pFieldDict,
+                                          const char* name) {
+  return const_cast<CPDF_Object*>(GetFieldAttrRecursive(
       static_cast<const CPDF_Dictionary*>(pFieldDict), name, 0));
 }
 
-WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict) {
+// static
+WideString CPDF_FormField::GetFullNameForDict(CPDF_Dictionary* pFieldDict) {
   WideString full_name;
   std::set<CPDF_Dictionary*> visited;
   CPDF_Dictionary* pLevel = pFieldDict;
@@ -97,7 +103,7 @@
 
 void CPDF_FormField::InitFieldFlags() {
   const CPDF_Object* ft_attr =
-      FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kFT);
+      GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kFT);
   ByteString type_name = ft_attr ? ft_attr->GetString() : ByteString();
   uint32_t flags = GetFieldFlags();
   m_bRequired = flags & pdfium::form_flags::kRequired;
@@ -135,7 +141,7 @@
 }
 
 WideString CPDF_FormField::GetFullName() const {
-  return FPDF_GetFullName(m_pDict.Get());
+  return GetFullNameForDict(m_pDict.Get());
 }
 
 bool CPDF_FormField::ResetField(NotificationOption notify) {
@@ -186,7 +192,7 @@
           csValue = pV->GetUnicodeText();
       }
 
-      bool bHasRV = !!FPDF_GetFieldAttr(m_pDict.Get(), "RV");
+      bool bHasRV = !!GetFieldAttr(m_pDict.Get(), "RV");
       if (!bHasRV && (csDValue == csValue))
         return false;
 
@@ -256,31 +262,30 @@
 }
 
 CPDF_AAction CPDF_FormField::GetAdditionalAction() const {
-  CPDF_Object* pObj =
-      FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kAA);
+  CPDF_Object* pObj = GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kAA);
   return CPDF_AAction(pObj ? pObj->GetDict() : nullptr);
 }
 
 WideString CPDF_FormField::GetAlternateName() const {
   const CPDF_Object* pObj =
-      FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kTU);
+      GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kTU);
   return pObj ? pObj->GetUnicodeText() : WideString();
 }
 
 WideString CPDF_FormField::GetMappingName() const {
   const CPDF_Object* pObj =
-      FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kTM);
+      GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kTM);
   return pObj ? pObj->GetUnicodeText() : WideString();
 }
 
 uint32_t CPDF_FormField::GetFieldFlags() const {
   const CPDF_Object* pObj =
-      FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kFf);
+      GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kFf);
   return pObj ? pObj->GetInteger() : 0;
 }
 
 ByteString CPDF_FormField::GetDefaultStyle() const {
-  const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict.Get(), "DS");
+  const CPDF_Object* pObj = GetFieldAttr(m_pDict.Get(), "DS");
   return pObj ? pObj->GetString() : ByteString();
 }
 
@@ -393,7 +398,7 @@
 }
 
 int CPDF_FormField::GetMaxLen() const {
-  if (const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict.Get(), "MaxLen"))
+  if (const CPDF_Object* pObj = GetFieldAttr(m_pDict.Get(), "MaxLen"))
     return pObj->GetInteger();
 
   for (auto& pControl : GetControls()) {
@@ -604,12 +609,12 @@
 }
 
 int CPDF_FormField::CountOptions() const {
-  const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt"));
+  const CPDF_Array* pArray = ToArray(GetFieldAttr(m_pDict.Get(), "Opt"));
   return pArray ? pArray->size() : 0;
 }
 
 WideString CPDF_FormField::GetOptionText(int index, int sub_index) const {
-  const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt"));
+  const CPDF_Array* pArray = ToArray(GetFieldAttr(m_pDict.Get(), "Opt"));
   if (!pArray)
     return WideString();
 
@@ -671,7 +676,7 @@
     }
   }
 
-  const CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pDict.Get(), "Opt");
+  const CPDF_Object* pOpt = GetFieldAttr(m_pDict.Get(), "Opt");
   if (!ToArray(pOpt)) {
     ByteString csBExport = PDF_EncodeText(csWExport);
     if (bChecked) {
@@ -731,7 +736,7 @@
 }
 
 int CPDF_FormField::GetTopVisibleIndex() const {
-  const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict.Get(), "TI");
+  const CPDF_Object* pObj = GetFieldAttr(m_pDict.Get(), "TI");
   return pObj ? pObj->GetInteger() : 0;
 }
 
@@ -824,7 +829,7 @@
     return;
 
   ByteString DA;
-  if (const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict.Get(), "DA"))
+  if (const CPDF_Object* pObj = GetFieldAttr(m_pDict.Get(), "DA"))
     DA = pObj->GetString();
 
   if (DA.IsEmpty())
@@ -901,16 +906,16 @@
 }
 
 const CPDF_Object* CPDF_FormField::GetDefaultValueObject() const {
-  return FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kDV);
+  return GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kDV);
 }
 
 const CPDF_Object* CPDF_FormField::GetValueObject() const {
-  return FPDF_GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kV);
+  return GetFieldAttr(m_pDict.Get(), pdfium::form_fields::kV);
 }
 
 const CPDF_Object* CPDF_FormField::GetSelectedIndicesObject() const {
   ASSERT(GetType() == kComboBox || GetType() == kListBox);
-  return FPDF_GetFieldAttr(m_pDict.Get(), "I");
+  return GetFieldAttr(m_pDict.Get(), "I");
 }
 
 const CPDF_Object* CPDF_FormField::GetValueOrSelectedIndicesObject() const {
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h
index a269af8..73cc04b 100644
--- a/core/fpdfdoc/cpdf_formfield.h
+++ b/core/fpdfdoc/cpdf_formfield.h
@@ -47,8 +47,6 @@
 #endif  // PDF_ENABLE_XFA
 };
 
-Optional<FormFieldType> IntToFormFieldType(int value);
-
 // If values are added to FormFieldType, these will need to be updated.
 #ifdef PDF_ENABLE_XFA
 constexpr size_t kFormFieldTypeCount = 16;
@@ -56,12 +54,6 @@
 constexpr size_t kFormFieldTypeCount = 8;
 #endif  // PDF_ENABLE_XFA
 
-const CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
-                                     const char* name);
-CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const char* name);
-
-WideString FPDF_GetFullName(CPDF_Dictionary* pFieldDict);
-
 class CPDF_FormField {
  public:
   enum Type {
@@ -80,19 +72,25 @@
   CPDF_FormField(CPDF_InteractiveForm* pForm, CPDF_Dictionary* pDict);
   ~CPDF_FormField();
 
-  WideString GetFullName() const;
+  static Optional<FormFieldType> IntToFormFieldType(int value);
 
+  static const CPDF_Object* GetFieldAttr(const CPDF_Dictionary* pFieldDict,
+                                         const char* name);
+  static CPDF_Object* GetFieldAttr(CPDF_Dictionary* pFieldDict,
+                                   const char* name);
+
+  static WideString GetFullNameForDict(CPDF_Dictionary* pFieldDict);
+
+  WideString GetFullName() const;
   Type GetType() const { return m_Type; }
 
   CPDF_Dictionary* GetFieldDict() const { return m_pDict.Get(); }
-
   bool ResetField(NotificationOption notify);
 
   int CountControls() const;
-
   CPDF_FormControl* GetControl(int index) const;
-
   int GetControlIndex(const CPDF_FormControl* pControl) const;
+
   FormFieldType GetFieldType() const;
 
   CPDF_AAction GetAdditionalAction() const;
@@ -121,7 +119,6 @@
 
   int GetDefaultSelectedItem() const;
   int CountOptions() const;
-
   WideString GetOptionLabel(int index) const;
   WideString GetOptionValue(int index) const;
   int FindOption(const WideString& csOptValue) const;
@@ -132,7 +129,6 @@
 
   int GetTopVisibleIndex() const;
   int CountSelectedOptions() const;
-
   int GetSelectedOptionIndex(int index) const;
   bool IsOptionSelected(int iOptIndex) const;
   bool SelectOption(int iOptIndex, bool bSelected, NotificationOption notify);
diff --git a/core/fpdfdoc/cpdf_formfield_unittest.cpp b/core/fpdfdoc/cpdf_formfield_unittest.cpp
index 24c92c1..ca75891 100644
--- a/core/fpdfdoc/cpdf_formfield_unittest.cpp
+++ b/core/fpdfdoc/cpdf_formfield_unittest.cpp
@@ -10,40 +10,40 @@
 #include "core/fpdfapi/parser/cpdf_reference.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-TEST(cpdf_formfield, FPDF_GetFullName) {
-  WideString name = FPDF_GetFullName(nullptr);
+TEST(cpdf_formfield, GetFullNameForDict) {
+  WideString name = CPDF_FormField::GetFullNameForDict(nullptr);
   EXPECT_TRUE(name.IsEmpty());
 
   CPDF_IndirectObjectHolder obj_holder;
   CPDF_Dictionary* root = obj_holder.NewIndirect<CPDF_Dictionary>();
   root->SetNewFor<CPDF_Name>("T", "foo");
-  name = FPDF_GetFullName(root);
+  name = CPDF_FormField::GetFullNameForDict(root);
   EXPECT_STREQ("foo", name.ToUTF8().c_str());
 
   CPDF_Dictionary* dict1 = obj_holder.NewIndirect<CPDF_Dictionary>();
   root->SetNewFor<CPDF_Reference>("Parent", &obj_holder, dict1->GetObjNum());
   dict1->SetNewFor<CPDF_Name>("T", "bar");
-  name = FPDF_GetFullName(root);
+  name = CPDF_FormField::GetFullNameForDict(root);
   EXPECT_STREQ("bar.foo", name.ToUTF8().c_str());
 
   CPDF_Dictionary* dict2 = dict1->SetNewFor<CPDF_Dictionary>("Parent");
-  name = FPDF_GetFullName(root);
+  name = CPDF_FormField::GetFullNameForDict(root);
   EXPECT_STREQ("bar.foo", name.ToUTF8().c_str());
 
   CPDF_Dictionary* dict3 = obj_holder.NewIndirect<CPDF_Dictionary>();
   dict2->SetNewFor<CPDF_Reference>("Parent", &obj_holder, dict3->GetObjNum());
 
   dict3->SetNewFor<CPDF_Name>("T", "qux");
-  name = FPDF_GetFullName(root);
+  name = CPDF_FormField::GetFullNameForDict(root);
   EXPECT_STREQ("qux.bar.foo", name.ToUTF8().c_str());
 
   dict3->SetNewFor<CPDF_Reference>("Parent", &obj_holder, root->GetObjNum());
-  name = FPDF_GetFullName(root);
+  name = CPDF_FormField::GetFullNameForDict(root);
   EXPECT_STREQ("qux.bar.foo", name.ToUTF8().c_str());
-  name = FPDF_GetFullName(dict1);
+  name = CPDF_FormField::GetFullNameForDict(dict1);
   EXPECT_STREQ("foo.qux.bar", name.ToUTF8().c_str());
-  name = FPDF_GetFullName(dict2);
+  name = CPDF_FormField::GetFullNameForDict(dict2);
   EXPECT_STREQ("bar.foo.qux", name.ToUTF8().c_str());
-  name = FPDF_GetFullName(dict3);
+  name = CPDF_FormField::GetFullNameForDict(dict3);
   EXPECT_STREQ("bar.foo.qux", name.ToUTF8().c_str());
 }
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 15a5e26..4186405 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -713,7 +713,7 @@
   if (!pFieldDict)
     return nullptr;
 
-  WideString csWName = FPDF_GetFullName(pFieldDict);
+  WideString csWName = CPDF_FormField::GetFullNameForDict(pFieldDict);
   return m_pFieldTree->GetField(csWName);
 }
 
@@ -900,7 +900,7 @@
   }
 
   CPDF_Dictionary* pDict = pFieldDict;
-  WideString csWName = FPDF_GetFullName(pFieldDict);
+  WideString csWName = CPDF_FormField::GetFullNameForDict(pFieldDict);
   if (csWName.IsEmpty())
     return;
 
@@ -1063,14 +1063,16 @@
       continue;
     }
 
-    WideString fullname = FPDF_GetFullName(pField->GetFieldDict());
+    WideString fullname =
+        CPDF_FormField::GetFullNameForDict(pField->GetFieldDict());
     auto pFieldDict = pDoc->New<CPDF_Dictionary>();
     pFieldDict->SetNewFor<CPDF_String>(pdfium::form_fields::kT, fullname);
     if (pField->GetType() == CPDF_FormField::kCheckBox ||
         pField->GetType() == CPDF_FormField::kRadioButton) {
       WideString csExport = pField->GetCheckValue(false);
       ByteString csBExport = PDF_EncodeText(csExport);
-      CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->GetDict(), "Opt");
+      CPDF_Object* pOpt =
+          CPDF_FormField::GetFieldAttr(pField->GetDict(), "Opt");
       if (pOpt) {
         pFieldDict->SetNewFor<CPDF_String>(pdfium::form_fields::kV, csBExport,
                                            false);
@@ -1078,8 +1080,8 @@
         pFieldDict->SetNewFor<CPDF_Name>(pdfium::form_fields::kV, csBExport);
       }
     } else {
-      CPDF_Object* pV =
-          FPDF_GetFieldAttr(pField->GetDict(), pdfium::form_fields::kV);
+      CPDF_Object* pV = CPDF_FormField::GetFieldAttr(pField->GetDict(),
+                                                     pdfium::form_fields::kV);
       if (pV)
         pFieldDict->SetFor(pdfium::form_fields::kV, pV->CloneDirectObject());
     }
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 5468743..2b90365 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -926,7 +926,7 @@
     return;
 
   ByteString DA;
-  if (CPDF_Object* pDAObj = FPDF_GetFieldAttr(pAnnotDict, "DA"))
+  if (CPDF_Object* pDAObj = CPDF_FormField::GetFieldAttr(pAnnotDict, "DA"))
     DA = pDAObj->GetString();
   if (DA.IsEmpty())
     DA = pFormDict->GetStringFor("DA");
@@ -1093,14 +1093,15 @@
   switch (type) {
     case CPVT_GenerateAP::kTextField: {
       const CPDF_Object* pV =
-          FPDF_GetFieldAttr(pAnnotDict, pdfium::form_fields::kV);
+          CPDF_FormField::GetFieldAttr(pAnnotDict, pdfium::form_fields::kV);
       WideString swValue = pV ? pV->GetUnicodeText() : WideString();
-      const CPDF_Object* pQ = FPDF_GetFieldAttr(pAnnotDict, "Q");
+      const CPDF_Object* pQ = CPDF_FormField::GetFieldAttr(pAnnotDict, "Q");
       int32_t nAlign = pQ ? pQ->GetInteger() : 0;
       const CPDF_Object* pFf =
-          FPDF_GetFieldAttr(pAnnotDict, pdfium::form_fields::kFf);
+          CPDF_FormField::GetFieldAttr(pAnnotDict, pdfium::form_fields::kFf);
       uint32_t dwFlags = pFf ? pFf->GetInteger() : 0;
-      const CPDF_Object* pMaxLen = FPDF_GetFieldAttr(pAnnotDict, "MaxLen");
+      const CPDF_Object* pMaxLen =
+          CPDF_FormField::GetFieldAttr(pAnnotDict, "MaxLen");
       uint32_t dwMaxLen = pMaxLen ? pMaxLen->GetInteger() : 0;
       CPVT_FontMap map(
           pDoc, pStreamDict ? pStreamDict->GetDictFor("Resources") : nullptr,
@@ -1160,7 +1161,7 @@
     }
     case CPVT_GenerateAP::kComboBox: {
       const CPDF_Object* pV =
-          FPDF_GetFieldAttr(pAnnotDict, pdfium::form_fields::kV);
+          CPDF_FormField::GetFieldAttr(pAnnotDict, pdfium::form_fields::kV);
       WideString swValue = pV ? pV->GetUnicodeText() : WideString();
       CPVT_FontMap map(
           pDoc, pStreamDict ? pStreamDict->GetDictFor("Resources") : nullptr,
@@ -1234,9 +1235,11 @@
           pDoc, pStreamDict ? pStreamDict->GetDictFor("Resources") : nullptr,
           pDefFont, font_name);
       CPDF_VariableText::Provider prd(&map);
-      CPDF_Array* pOpts = ToArray(FPDF_GetFieldAttr(pAnnotDict, "Opt"));
-      CPDF_Array* pSels = ToArray(FPDF_GetFieldAttr(pAnnotDict, "I"));
-      CPDF_Object* pTi = FPDF_GetFieldAttr(pAnnotDict, "TI");
+      CPDF_Array* pOpts =
+          ToArray(CPDF_FormField::GetFieldAttr(pAnnotDict, "Opt"));
+      CPDF_Array* pSels =
+          ToArray(CPDF_FormField::GetFieldAttr(pAnnotDict, "I"));
+      CPDF_Object* pTi = CPDF_FormField::GetFieldAttr(pAnnotDict, "TI");
       int32_t nTop = pTi ? pTi->GetInteger() : 0;
       std::ostringstream sBody;
       if (pOpts) {
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index cc3d5d5..873ea01 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -592,7 +592,8 @@
   if (!pForm)
     return;
 
-  Optional<FormFieldType> cast_input = IntToFormFieldType(fieldType);
+  Optional<FormFieldType> cast_input =
+      CPDF_FormField::IntToFormFieldType(fieldType);
   if (!cast_input)
     return;