From d0409afc6a994a3e24043b8a96c83c022bcaa189 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 25 May 2017 15:53:57 -0700 Subject: Mass conversion of remaining class members (non-xfa) Change-Id: I8365ba80e3395d59a3cf35dbd9d9162e86e712e3 Reviewed-on: https://pdfium-review.googlesource.com/5970 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- fpdfsdk/fxedit/fxet_edit.cpp | 2 +- fpdfsdk/fxedit/fxet_edit.h | 21 +++++++++++---------- fpdfsdk/fxedit/fxet_list.cpp | 2 +- fpdfsdk/fxedit/fxet_list.h | 5 +++-- 4 files changed, 16 insertions(+), 14 deletions(-) (limited to 'fpdfsdk/fxedit') diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index cf4fdc3d91..0e86562044 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -145,7 +145,7 @@ CFX_Edit_Provider::CFX_Edit_Provider(IPVT_FontMap* pFontMap) CFX_Edit_Provider::~CFX_Edit_Provider() {} -IPVT_FontMap* CFX_Edit_Provider::GetFontMap() { +IPVT_FontMap* CFX_Edit_Provider::GetFontMap() const { return m_pFontMap; } diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h index ebc326f5a9..01759aaba9 100644 --- a/fpdfsdk/fxedit/fxet_edit.h +++ b/fpdfsdk/fxedit/fxet_edit.h @@ -13,6 +13,7 @@ #include "core/fpdfdoc/cpvt_secprops.h" #include "core/fpdfdoc/cpvt_wordprops.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "fpdfsdk/fxedit/fx_edit.h" class CFFL_FormFiller; @@ -158,7 +159,7 @@ class CFXEU_InsertWord : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; @@ -181,7 +182,7 @@ class CFXEU_InsertReturn : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; @@ -205,7 +206,7 @@ class CFXEU_Backspace : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; @@ -232,7 +233,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; @@ -255,7 +256,7 @@ class CFXEU_Clear : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordRange m_wrSel; CFX_WideString m_swText; @@ -275,7 +276,7 @@ class CFXEU_InsertText : public CFX_Edit_UndoItem { void Undo() override; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPVT_WordPlace m_wpOld; CPVT_WordPlace m_wpNew; @@ -449,8 +450,8 @@ class CFX_Edit { private: std::unique_ptr m_pVT; - CPWL_EditCtrl* m_pNotify; - CPWL_Edit* m_pOprNotify; + CFX_UnownedPtr m_pNotify; + CFX_UnownedPtr m_pOprNotify; std::unique_ptr m_pVTProvider; CPVT_WordPlace m_wpCaret; CPVT_WordPlace m_wpOldCaret; @@ -485,7 +486,7 @@ class CFX_Edit_Iterator { const CPVT_WordPlace& GetAt() const; private: - CFX_Edit* m_pEdit; + CFX_UnownedPtr m_pEdit; CPDF_VariableText::Iterator* m_pVTIterator; }; @@ -494,7 +495,7 @@ class CFX_Edit_Provider : public CPDF_VariableText::Provider { explicit CFX_Edit_Provider(IPVT_FontMap* pFontMap); ~CFX_Edit_Provider() override; - IPVT_FontMap* GetFontMap(); + IPVT_FontMap* GetFontMap() const; // CPDF_VariableText::Provider: int32_t GetCharWidth(int32_t nFontIndex, uint16_t word) override; diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index c8fef948af..a3badf32fb 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -590,7 +590,7 @@ void CFX_ListCtrl::SetFontSize(float fFontSize) { void CFX_ListCtrl::AddItem(const CFX_WideString& str) { auto pListItem = pdfium::MakeUnique(); - pListItem->SetFontMap(m_pFontMap); + pListItem->SetFontMap(m_pFontMap.Get()); pListItem->SetFontSize(m_fFontSize); pListItem->SetText(str); m_ListItems.push_back(std::move(pListItem)); diff --git a/fpdfsdk/fxedit/fxet_list.h b/fpdfsdk/fxedit/fxet_list.h index cd6e2ddeff..b4b0a56c1e 100644 --- a/fpdfsdk/fxedit/fxet_list.h +++ b/fpdfsdk/fxedit/fxet_list.h @@ -11,6 +11,7 @@ #include #include +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "fpdfsdk/fxedit/fx_edit.h" @@ -263,7 +264,7 @@ class CFX_ListCtrl : protected CFX_ListContainer { void SetItemSelect(int32_t nItemIndex, bool bSelected); int32_t GetLastSelected() const; - CPWL_List_Notify* m_pNotify; + CFX_UnownedPtr m_pNotify; bool m_bNotifyFlag; CFX_PointF m_ptScrollPos; CPLST_Select m_aSelItems; // for multiple @@ -273,7 +274,7 @@ class CFX_ListCtrl : protected CFX_ListContainer { int32_t m_nCaretIndex; // for multiple std::vector> m_ListItems; float m_fFontSize; - IPVT_FontMap* m_pFontMap; + CFX_UnownedPtr m_pFontMap; bool m_bMultiple; }; -- cgit v1.2.3