diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 2 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.h | 4 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 2 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_interform.h | 5 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_link.cpp | 8 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_link.h | 12 |
6 files changed, 22 insertions, 11 deletions
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index 97ea052436..cd47f269bc 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -899,7 +899,7 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify) { } void CPDF_FormField::LoadDA() { - CPDF_Dictionary* pFormDict = m_pForm->m_pFormDict; + CPDF_Dictionary* pFormDict = m_pForm->m_pFormDict.Get(); if (!pFormDict) return; diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index f2038e41bd..f5c4c6964b 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -134,7 +134,7 @@ class CPDF_FormField { #endif // PDF_ENABLE_XFA float GetFontSize() const { return m_FontSize; } - CPDF_Font* GetFont() const { return m_pFont; } + CPDF_Font* GetFont() const { return m_pFont.Get(); } const CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } const CPDF_InterForm* GetForm() const { return m_pForm.Get(); } @@ -176,7 +176,7 @@ class CPDF_FormField { // Owned by InterForm parent. std::vector<CFX_UnownedPtr<CPDF_FormControl>> m_ControlList; float m_FontSize; - CPDF_Font* m_pFont; + CFX_UnownedPtr<CPDF_Font> m_pFont; }; #endif // CORE_FPDFDOC_CPDF_FORMFIELD_H_ diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index de99a5de0f..9c3730ad70 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -961,7 +961,7 @@ int CPDF_InterForm::FindFieldInCalculationOrder(const CPDF_FormField* pField) { } CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csNameTag) const { - return GetFont(m_pFormDict, m_pDocument.Get(), csNameTag); + return GetFont(m_pFormDict.Get(), m_pDocument.Get(), csNameTag); } CPDF_DefaultAppearance CPDF_InterForm::GetDefaultAppearance() const { diff --git a/core/fpdfdoc/cpdf_interform.h b/core/fpdfdoc/cpdf_interform.h index 0a9b3e0e4a..9dc0532939 100644 --- a/core/fpdfdoc/cpdf_interform.h +++ b/core/fpdfdoc/cpdf_interform.h @@ -13,6 +13,7 @@ #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fpdfdoc/cpdf_defaultappearance.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -109,12 +110,12 @@ class CPDF_InterForm { static bool s_bUpdateAP; CFX_UnownedPtr<CPDF_Document> const m_pDocument; - CPDF_Dictionary* m_pFormDict; + CFX_UnownedPtr<CPDF_Dictionary> m_pFormDict; std::map<const CPDF_Dictionary*, std::unique_ptr<CPDF_FormControl>> m_ControlMap; std::unique_ptr<CFieldTree> m_pFieldTree; CFX_ByteString m_bsEncoding; - IPDF_FormNotify* m_pFormNotify; + CFX_UnownedPtr<IPDF_FormNotify> m_pFormNotify; }; #endif // CORE_FPDFDOC_CPDF_INTERFORM_H_ diff --git a/core/fpdfdoc/cpdf_link.cpp b/core/fpdfdoc/cpdf_link.cpp index 20ec486df2..b622094a73 100644 --- a/core/fpdfdoc/cpdf_link.cpp +++ b/core/fpdfdoc/cpdf_link.cpp @@ -9,6 +9,14 @@ #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfdoc/cpdf_nametree.h" +CPDF_Link::CPDF_Link() {} + +CPDF_Link::CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} + +CPDF_Link::CPDF_Link(const CPDF_Link& that) = default; + +CPDF_Link::~CPDF_Link() {} + CFX_FloatRect CPDF_Link::GetRect() { return m_pDict->GetRectFor("Rect"); } diff --git a/core/fpdfdoc/cpdf_link.h b/core/fpdfdoc/cpdf_link.h index 162630d6ac..82f50fe004 100644 --- a/core/fpdfdoc/cpdf_link.h +++ b/core/fpdfdoc/cpdf_link.h @@ -9,23 +9,25 @@ #include "core/fpdfdoc/cpdf_action.h" #include "core/fpdfdoc/cpdf_dest.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" class CPDF_Dictionary; class CPDF_Link { public: - CPDF_Link() : m_pDict(nullptr) {} - explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} - - CPDF_Dictionary* GetDict() const { return m_pDict; } + CPDF_Link(); + explicit CPDF_Link(CPDF_Dictionary* pDict); + CPDF_Link(const CPDF_Link& that); + ~CPDF_Link(); + CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } CFX_FloatRect GetRect(); CPDF_Dest GetDest(CPDF_Document* pDoc); CPDF_Action GetAction(); private: - CPDF_Dictionary* m_pDict; + CFX_UnownedPtr<CPDF_Dictionary> m_pDict; }; #endif // CORE_FPDFDOC_CPDF_LINK_H_ |