diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-26 12:14:35 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-26 12:14:35 -0700 |
commit | bf60b29fc07c668022fc06517782aeda25e8246c (patch) | |
tree | e96c1f8ffbe2ce381c3b45ed3da8ac8cf682dc03 /fpdfsdk/include/fsdk_annothandler.h | |
parent | 56a547dd81202c49d01232c358a28db886fd46ed (diff) | |
download | pdfium-bf60b29fc07c668022fc06517782aeda25e8246c.tar.xz |
Merge to XFA: Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1411203007 .
(cherry picked from commit 9b2741829b8a8c511ef0f2f313ff53d77ac96307)
Review URL: https://codereview.chromium.org/1408263005 .
Diffstat (limited to 'fpdfsdk/include/fsdk_annothandler.h')
-rw-r--r-- | fpdfsdk/include/fsdk_annothandler.h | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h index c15681de96..6ce9e1229a 100644 --- a/fpdfsdk/include/fsdk_annothandler.h +++ b/fpdfsdk/include/fsdk_annothandler.h @@ -8,6 +8,7 @@ #define FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ #include <map> +#include <vector> #include "../../core/include/fxcrt/fx_basic.h" @@ -129,7 +130,7 @@ class IPDFSDK_AnnotHandler { class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { public: - CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) + explicit CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) : m_pApp(pApp), m_pFormFiller(NULL) {} ~CPDFSDK_BFAnnotHandler() override {} @@ -227,7 +228,7 @@ class CPDFSDK_BFAnnotHandler : public IPDFSDK_AnnotHandler { class CPDFSDK_XFAAnnotHandler : public IPDFSDK_AnnotHandler { public: - CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp); + explicit CPDFSDK_XFAAnnotHandler(CPDFDoc_Environment* pApp); ~CPDFSDK_XFAAnnotHandler() {} public: @@ -433,38 +434,20 @@ class CPDFSDK_AnnotHandlerMgr { CPDFDoc_Environment* m_pApp; }; -typedef int (*AI_COMPARE)(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); - class CPDFSDK_AnnotIterator { public: - CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView, - FX_BOOL bReverse, - FX_BOOL bIgnoreTopmost = FALSE, - FX_BOOL bCircle = FALSE, - CFX_PtrArray* pList = NULL); - virtual ~CPDFSDK_AnnotIterator() {} - - virtual CPDFSDK_Annot* Next(const CPDFSDK_Annot* pCurrent); - virtual CPDFSDK_Annot* Prev(const CPDFSDK_Annot* pCurrent); - virtual CPDFSDK_Annot* Next(int& index); - virtual CPDFSDK_Annot* Prev(int& index); - virtual int Count() { return m_pIteratorAnnotList.GetSize(); } - - virtual FX_BOOL InitIteratorAnnotList(CPDFSDK_PageView* pPageView, - CFX_PtrArray* pList = NULL); - - void InsertSort(CFX_PtrArray& arrayList, AI_COMPARE pCompare); - - protected: - CPDFSDK_Annot* NextAnnot(const CPDFSDK_Annot* pCurrent); - CPDFSDK_Annot* PrevAnnot(const CPDFSDK_Annot* pCurrent); - CPDFSDK_Annot* NextAnnot(int& index); - CPDFSDK_Annot* PrevAnnot(int& index); - - CFX_PtrArray m_pIteratorAnnotList; - FX_BOOL m_bReverse; - FX_BOOL m_bIgnoreTopmost; - FX_BOOL m_bCircle; + CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView, bool bReverse); + ~CPDFSDK_AnnotIterator(); + + CPDFSDK_Annot* Next(); + + private: + CPDFSDK_Annot* NextAnnot(); + CPDFSDK_Annot* PrevAnnot(); + + std::vector<CPDFSDK_Annot*> m_iteratorAnnotList; + const bool m_bReverse; + size_t m_pos; }; #endif // FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ |