diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-12-09 16:26:21 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-12-09 16:26:21 -0800 |
commit | 035359cd8ddb555fa33b6133db4fd405e4660712 (patch) | |
tree | 89accecac7da250468166168cd502ed7b92c7ce7 /core/include | |
parent | 0c92bed7ade20fe193dce0a481dad48e1be41622 (diff) | |
download | pdfium-035359cd8ddb555fa33b6133db4fd405e4660712.tar.xz |
Get rid of most uses of CFX_PtrArray.
I didn't go whole hog and replace these with std::vector,
but in the mean time, it is silly to cast a typedef for
a template instantiated against void* when we can just
instantiate the template against the actual type.
The ones that remain are actual heterogeneous arrays with
wacky casting.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1518593002 .
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfapi/fpdf_objects.h | 2 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_page.h | 2 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 2 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_render.h | 2 | ||||
-rw-r--r-- | core/include/fpdfdoc/fpdf_doc.h | 26 | ||||
-rw-r--r-- | core/include/fpdfdoc/fpdf_tagged.h | 2 |
6 files changed, 12 insertions, 24 deletions
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index f910cc188e..532ede2a08 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -350,7 +350,7 @@ class CPDF_Array : public CPDF_Object { protected: ~CPDF_Array(); - CFX_PtrArray m_Objects; + CFX_ArrayTemplate<CPDF_Object*> m_Objects; friend class CPDF_Object; }; inline CPDF_Array* ToArray(CPDF_Object* obj) { diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h index 27e40f4486..6823dc1f96 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -196,7 +196,7 @@ class CPDF_PageContentGenerate { private: CPDF_Page* m_pPage; CPDF_Document* m_pDocument; - CFX_PtrArray m_pageObjects; + CFX_ArrayTemplate<CPDF_PageObject*> m_pageObjects; }; #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index efb955be21..ec005de812 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -959,7 +959,7 @@ class CPDF_PageNode { ~CPDF_PageNode(); PDF_PAGENODE_TYPE m_type; FX_DWORD m_dwPageNo; - CFX_PtrArray m_childNode; + CFX_ArrayTemplate<CPDF_PageNode*> m_childNode; }; enum PDF_DATAAVAIL_STATUS { PDF_DATAAVAIL_HEADER = 0, diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h index cdd7e38d65..8d87b588c1 100644 --- a/core/include/fpdfapi/fpdf_render.h +++ b/core/include/fpdfapi/fpdf_render.h @@ -233,7 +233,6 @@ class CPDF_PageRenderCache { m_nCacheSize = 0; m_pCurImageCache = NULL; m_bCurFindCache = FALSE; - m_pCurImageCaches = NULL; } ~CPDF_PageRenderCache() { ClearAll(); } void ClearAll(); @@ -272,7 +271,6 @@ class CPDF_PageRenderCache { FX_BOOL Continue(IFX_Pause* pPause); CPDF_ImageCache* m_pCurImageCache; - CFX_PtrArray* m_pCurImageCaches; protected: friend class CPDF_Page; diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index 9b86e0ecb1..3dea48d3ed 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -753,9 +753,7 @@ class CPDF_FormField { int CountControls() { return m_ControlList.GetSize(); } - CPDF_FormControl* GetControl(int index) { - return (CPDF_FormControl*)m_ControlList.GetAt(index); - } + CPDF_FormControl* GetControl(int index) { return m_ControlList.GetAt(index); } int GetControlIndex(const CPDF_FormControl* pControl); @@ -831,21 +829,8 @@ class CPDF_FormField { protected: CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict); - ~CPDF_FormField(); - CPDF_FormField::Type m_Type; - - FX_DWORD m_Flags; - - CPDF_InterForm* m_pForm; - - CPDF_Dictionary* m_pDict; - - CFX_PtrArray m_ControlList; - friend class CPDF_InterForm; - friend class CPDF_FormControl; - CFX_WideString GetValue(FX_BOOL bDefault); FX_BOOL SetValue(const CFX_WideString& value, @@ -868,9 +853,16 @@ class CPDF_FormField { FX_BOOL bDefault, FX_BOOL bNotify); + CPDF_FormField::Type m_Type; + FX_DWORD m_Flags; + CPDF_InterForm* m_pForm; + CPDF_Dictionary* m_pDict; + CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList; FX_FLOAT m_FontSize; - CPDF_Font* m_pFont; + + friend class CPDF_InterForm; + friend class CPDF_FormControl; }; CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h index 3de6041dc1..45277fb434 100644 --- a/core/include/fpdfdoc/fpdf_tagged.h +++ b/core/include/fpdfdoc/fpdf_tagged.h @@ -71,8 +71,6 @@ class CPDF_StructElement { virtual const CPDF_StructKid& GetKid(int index) const = 0; - virtual CFX_PtrArray* GetObjectArray() = 0; - virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, |