diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-05-23 17:10:46 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-24 00:49:21 +0000 |
commit | 655c783b8077f18e17418a3aab9b5a07c8055049 (patch) | |
tree | e121b850ead5af67156b126c2e8d2fdcfa4be6a9 /core/fpdfdoc/cpdf_formfield.h | |
parent | 6f3593c5cdf62915fc086448312671ce1fce5291 (diff) | |
download | pdfium-655c783b8077f18e17418a3aab9b5a07c8055049.tar.xz |
Convert to CFX_UnownedPtr, part 3.
Remove an explicit clear to re-order the member
destruction order.
Change-Id: I33da3f3de4b8e8e0cfbdceaf5140e98f5d6f904a
Reviewed-on: https://pdfium-review.googlesource.com/5791
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_formfield.h')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index 6ec7a5b414..f2038e41bd 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -13,6 +13,7 @@ #include "core/fpdfdoc/cpdf_aaction.h" #include "core/fpdfdoc/cpdf_formfield.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_basic.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -65,7 +66,7 @@ class CPDF_FormField { Type GetType() const { return m_Type; } uint32_t GetFlags() const { return m_Flags; } - CPDF_Dictionary* GetFieldDict() const { return m_pDict; } + CPDF_Dictionary* GetFieldDict() const { return m_pDict.Get(); } void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } bool ResetField(bool bNotify = false); @@ -74,7 +75,9 @@ class CPDF_FormField { return pdfium::CollectionSize<int>(m_ControlList); } - CPDF_FormControl* GetControl(int index) const { return m_ControlList[index]; } + CPDF_FormControl* GetControl(int index) const { + return m_ControlList[index].Get(); + } int GetControlIndex(const CPDF_FormControl* pControl) const; int GetFieldType() const; @@ -133,13 +136,13 @@ class CPDF_FormField { float GetFontSize() const { return m_FontSize; } CPDF_Font* GetFont() const { return m_pFont; } - const CPDF_Dictionary* GetDict() const { return m_pDict; } - const CPDF_InterForm* GetForm() const { return m_pForm; } + const CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } + const CPDF_InterForm* GetForm() const { return m_pForm.Get(); } CFX_WideString GetCheckValue(bool bDefault) const; void AddFormControl(CPDF_FormControl* pFormControl) { - m_ControlList.push_back(pFormControl); + m_ControlList.emplace_back(pFormControl); } void SetOpt(std::unique_ptr<CPDF_Object> pOpt) { @@ -168,9 +171,10 @@ class CPDF_FormField { CPDF_FormField::Type m_Type; uint32_t m_Flags; - CPDF_InterForm* const m_pForm; - CPDF_Dictionary* m_pDict; - std::vector<CPDF_FormControl*> m_ControlList; // Owned by InterForm parent. + CFX_UnownedPtr<CPDF_InterForm> const m_pForm; + CFX_UnownedPtr<CPDF_Dictionary> m_pDict; + // Owned by InterForm parent. + std::vector<CFX_UnownedPtr<CPDF_FormControl>> m_ControlList; float m_FontSize; CPDF_Font* m_pFont; }; |