summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/fsdk_annothandler.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-23 18:06:17 -0700
committerLei Zhang <thestig@chromium.org>2015-10-23 18:06:17 -0700
commit9b2741829b8a8c511ef0f2f313ff53d77ac96307 (patch)
tree44e4351192f0af909671df95a1aac16a1609f750 /fpdfsdk/include/fsdk_annothandler.h
parentbef190fcacb7dde4fedc1360e3019ab9968db16a (diff)
downloadpdfium-9b2741829b8a8c511ef0f2f313ff53d77ac96307.tar.xz
Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView.chromium/2547chromium/2546
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1411203007 .
Diffstat (limited to 'fpdfsdk/include/fsdk_annothandler.h')
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h45
1 files changed, 14 insertions, 31 deletions
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 369a080a9b..89705459f2 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"
@@ -122,7 +123,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 {}
@@ -303,38 +304,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_