summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_formfield.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-15 18:51:11 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-15 18:51:11 +0000
commite4f2f4a3f4fd3e9f372912f4151d7c7843f9556f (patch)
treed88a221b657d7e09bd0fd7460644fd5c048515fb /core/fpdfdoc/cpdf_formfield.h
parent98ac76ec09ce72526134ad75f1921a1691804dd1 (diff)
downloadpdfium-e4f2f4a3f4fd3e9f372912f4151d7c7843f9556f.tar.xz
Use more UnownedPtr in CPDF_FormControl.
To make this work, remove an UnownedPtr vector in CPDF_FormField and make CPDF_InteractiveForm manage it instead. Also simplify some code within CPDF_FormControl and CPDF_InteractiveForm. Change-Id: Ifc3a979dcdb992376a48db7a40840d2e76078500 Reviewed-on: https://pdfium-review.googlesource.com/c/43938 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r--core/fpdfdoc/cpdf_formfield.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h
index ce12169a71..2c525cbdea 100644
--- a/core/fpdfdoc/cpdf_formfield.h
+++ b/core/fpdfdoc/cpdf_formfield.h
@@ -111,9 +111,7 @@ class CPDF_FormField {
int CountControls() const;
- CPDF_FormControl* GetControl(int index) const {
- return m_ControlList[index].Get();
- }
+ CPDF_FormControl* GetControl(int index) const;
int GetControlIndex(const CPDF_FormControl* pControl) const;
FormFieldType GetFieldType() const;
@@ -172,10 +170,6 @@ class CPDF_FormField {
WideString GetCheckValue(bool bDefault) const;
- void AddFormControl(CPDF_FormControl* pFormControl) {
- m_ControlList.emplace_back(pFormControl);
- }
-
void SetOpt(std::unique_ptr<CPDF_Object> pOpt);
private:
@@ -197,6 +191,8 @@ class CPDF_FormField {
bool NotifyListOrComboBoxBeforeChange(const WideString& value);
void NotifyListOrComboBoxAfterChange();
+ const std::vector<UnownedPtr<CPDF_FormControl>>& GetControls() const;
+
CPDF_FormField::Type m_Type = kUnknown;
uint32_t m_Flags = 0;
bool m_bReadOnly = false;
@@ -205,8 +201,6 @@ class CPDF_FormField {
UnownedPtr<CPDF_InteractiveForm> const m_pForm;
UnownedPtr<CPDF_Dictionary> const m_pDict;
- // Owned by InteractiveForm parent.
- std::vector<UnownedPtr<CPDF_FormControl>> m_ControlList;
float m_FontSize = 0;
UnownedPtr<CPDF_Font> m_pFont;
};