Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: fpdfsdk/include/fsdk_annothandler.h

Issue 1411203007: Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/fsdk_annothandler.h
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 369a080a9b2f2134a349c6f50af04158bf9cc085..89705459f2e917f10abc244913ac3003debe92e7 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_
« no previous file with comments | « no previous file | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698