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

Side by Side Diff: fpdfsdk/cpdfsdk_annotiterator.cpp

Issue 2384503003: Move fpdfsdk/include to fpdfsdk (Closed)
Patch Set: Rebase to master 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 | « fpdfsdk/cpdfsdk_annotiterator.h ('k') | fpdfsdk/cpdfsdk_baannot.h » ('j') | no next file with comments »
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 #include "fpdfsdk/include/cpdfsdk_annotiterator.h" 7 #include "fpdfsdk/cpdfsdk_annotiterator.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "fpdfsdk/include/cpdfsdk_annot.h" 11 #include "fpdfsdk/cpdfsdk_annot.h"
12 #include "fpdfsdk/include/cpdfsdk_pageview.h" 12 #include "fpdfsdk/cpdfsdk_pageview.h"
13 13
14 CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView, 14 CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView,
15 bool bReverse) 15 bool bReverse)
16 : m_bReverse(bReverse), m_pos(0) { 16 : m_bReverse(bReverse), m_pos(0) {
17 const std::vector<CPDFSDK_Annot*>& annots = pPageView->GetAnnotList(); 17 const std::vector<CPDFSDK_Annot*>& annots = pPageView->GetAnnotList();
18 m_iteratorAnnotList.insert(m_iteratorAnnotList.begin(), annots.rbegin(), 18 m_iteratorAnnotList.insert(m_iteratorAnnotList.begin(), annots.rbegin(),
19 annots.rend()); 19 annots.rend());
20 std::stable_sort(m_iteratorAnnotList.begin(), m_iteratorAnnotList.end(), 20 std::stable_sort(m_iteratorAnnotList.begin(), m_iteratorAnnotList.end(),
21 [](CPDFSDK_Annot* p1, CPDFSDK_Annot* p2) { 21 [](CPDFSDK_Annot* p1, CPDFSDK_Annot* p2) {
22 return p1->GetLayoutOrder() < p2->GetLayoutOrder(); 22 return p1->GetLayoutOrder() < p2->GetLayoutOrder();
(...skipping 22 matching lines...) Expand all
45 45
46 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { 46 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() {
47 if (m_pos < m_iteratorAnnotList.size()) 47 if (m_pos < m_iteratorAnnotList.size())
48 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; 48 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos];
49 return nullptr; 49 return nullptr;
50 } 50 }
51 51
52 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { 52 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() {
53 return m_bReverse ? PrevAnnot() : NextAnnot(); 53 return m_bReverse ? PrevAnnot() : NextAnnot();
54 } 54 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_annotiterator.h ('k') | fpdfsdk/cpdfsdk_baannot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698