diff options
author | tsepez <tsepez@chromium.org> | 2017-01-10 10:19:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2017-01-10 10:19:04 -0800 |
commit | d18b8674378b104a9b5bb1f015e3f92fc174673e (patch) | |
tree | 6216931229e3b311e6c64008846a33e5135366b7 /core/fpdfdoc/cpdf_formfield.h | |
parent | 3128d1c45d8bc313abb8aae151f86bbe62c52e56 (diff) | |
download | pdfium-d18b8674378b104a9b5bb1f015e3f92fc174673e.tar.xz |
Remove some CFX_ArrayTemplate in fpdfapi and fpdfdoc
Also use unique_ptr in one spot while we're at it.
Review-Url: https://codereview.chromium.org/2625483002
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index 37f17c3a8a..9a1ddc4599 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -7,11 +7,14 @@ #ifndef CORE_FPDFDOC_CPDF_FORMFIELD_H_ #define CORE_FPDFDOC_CPDF_FORMFIELD_H_ +#include <vector> + #include "core/fpdfdoc/cpdf_aaction.h" #include "core/fpdfdoc/cpdf_formfield.h" #include "core/fxcrt/fx_basic.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" +#include "third_party/base/stl_util.h" #define FIELDTYPE_UNKNOWN 0 #define FIELDTYPE_PUSHBUTTON 1 @@ -58,12 +61,12 @@ class CPDF_FormField { bool ResetField(bool bNotify = false); - int CountControls() const { return m_ControlList.GetSize(); } - - CPDF_FormControl* GetControl(int index) const { - return m_ControlList.GetAt(index); + int CountControls() const { + return pdfium::CollectionSize<int>(m_ControlList); } + CPDF_FormControl* GetControl(int index) const { return m_ControlList[index]; } + int GetControlIndex(const CPDF_FormControl* pControl) const; int GetFieldType() const; @@ -150,9 +153,9 @@ class CPDF_FormField { CPDF_FormField::Type m_Type; uint32_t m_Flags; - CPDF_InterForm* m_pForm; + CPDF_InterForm* const m_pForm; CPDF_Dictionary* m_pDict; - CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; + std::vector<CPDF_FormControl*> m_ControlList; // Owned by InterForm parent. FX_FLOAT m_FontSize; CPDF_Font* m_pFont; }; |