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

Side by Side Diff: fpdfsdk/cba_annotiterator.h

Issue 2384323005: Cleanup some CPDFSDK_PageView annotation code. (Closed)
Patch Set: Review feedback Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | fpdfsdk/cba_annotiterator.cpp » ('j') | fpdfsdk/cba_annotiterator.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef FPDFSDK_CBA_ANNOTITERATOR_H_ 7 #ifndef FPDFSDK_CBA_ANNOTITERATOR_H_
8 #define FPDFSDK_CBA_ANNOTITERATOR_H_ 8 #define FPDFSDK_CBA_ANNOTITERATOR_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, 23 CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
24 CPDF_Annot::Subtype nAnnotSubtype); 24 CPDF_Annot::Subtype nAnnotSubtype);
25 ~CBA_AnnotIterator(); 25 ~CBA_AnnotIterator();
26 26
27 CPDFSDK_Annot* GetFirstAnnot(); 27 CPDFSDK_Annot* GetFirstAnnot();
28 CPDFSDK_Annot* GetLastAnnot(); 28 CPDFSDK_Annot* GetLastAnnot();
29 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); 29 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
30 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); 30 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
31 31
32 private: 32 private:
33 static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot);
Tom Sepez 2016/10/05 17:59:52 nit: I'd just put this in namespace { } in the .cp
dsinclair 2016/10/05 18:26:56 Done.
34
33 void GenerateResults(); 35 void GenerateResults();
34 static CFX_FloatRect GetAnnotRect(const CPDFSDK_Annot* pAnnot); 36 void CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray);
37 CFX_FloatRect AddToAnnotsList(std::vector<CPDFSDK_Annot*>& sa, size_t idx);
Tom Sepez 2016/10/05 17:59:52 nit: can we pass |sa| as pointer rather than addin
dsinclair 2016/10/05 18:26:56 Done.
38 void AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>& sa,
39 std::vector<size_t>& aSelect);
Tom Sepez 2016/10/05 17:59:52 nit: ditto with aselect
dsinclair 2016/10/05 18:26:56 Done.
35 40
36 // Function signature compatible with std::sort(). 41 // Function signature compatible with std::sort().
37 static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, 42 static bool CompareByLeftAscending(const CPDFSDK_Annot* p1,
38 const CPDFSDK_Annot* p2); 43 const CPDFSDK_Annot* p2);
39 static bool CompareByTopDescending(const CPDFSDK_Annot* p1, 44 static bool CompareByTopDescending(const CPDFSDK_Annot* p1,
40 const CPDFSDK_Annot* p2); 45 const CPDFSDK_Annot* p2);
41 46
42 TabOrder m_eTabOrder; 47 TabOrder m_eTabOrder;
43 CPDFSDK_PageView* m_pPageView; 48 CPDFSDK_PageView* m_pPageView;
44 CPDF_Annot::Subtype m_nAnnotSubtype; 49 CPDF_Annot::Subtype m_nAnnotSubtype;
45 std::vector<CPDFSDK_Annot*> m_Annots; 50 std::vector<CPDFSDK_Annot*> m_Annots;
46 }; 51 };
47 52
48 #endif // FPDFSDK_CBA_ANNOTITERATOR_H_ 53 #endif // FPDFSDK_CBA_ANNOTITERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/cba_annotiterator.cpp » ('j') | fpdfsdk/cba_annotiterator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698