OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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/fsdk_annothandler.h" | 7 #include "fpdfsdk/include/fsdk_annothandler.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 | 1084 |
1085 auto it = std::find(m_iteratorAnnotList.begin(), m_iteratorAnnotList.end(), | 1085 auto it = std::find(m_iteratorAnnotList.begin(), m_iteratorAnnotList.end(), |
1086 pTopMostAnnot); | 1086 pTopMostAnnot); |
1087 if (it != m_iteratorAnnotList.end()) { | 1087 if (it != m_iteratorAnnotList.end()) { |
1088 CPDFSDK_Annot* pReaderAnnot = *it; | 1088 CPDFSDK_Annot* pReaderAnnot = *it; |
1089 m_iteratorAnnotList.erase(it); | 1089 m_iteratorAnnotList.erase(it); |
1090 m_iteratorAnnotList.insert(m_iteratorAnnotList.begin(), pReaderAnnot); | 1090 m_iteratorAnnotList.insert(m_iteratorAnnotList.begin(), pReaderAnnot); |
1091 } | 1091 } |
1092 } | 1092 } |
1093 | 1093 |
1094 CPDFSDK_AnnotIterator::~CPDFSDK_AnnotIterator() { | 1094 CPDFSDK_AnnotIterator::~CPDFSDK_AnnotIterator() {} |
1095 } | |
1096 | 1095 |
1097 CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot() { | 1096 CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot() { |
1098 if (m_pos < m_iteratorAnnotList.size()) | 1097 if (m_pos < m_iteratorAnnotList.size()) |
1099 return m_iteratorAnnotList[m_pos++]; | 1098 return m_iteratorAnnotList[m_pos++]; |
1100 return nullptr; | 1099 return nullptr; |
1101 } | 1100 } |
1102 | 1101 |
1103 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { | 1102 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { |
1104 if (m_pos < m_iteratorAnnotList.size()) | 1103 if (m_pos < m_iteratorAnnotList.size()) |
1105 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; | 1104 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; |
1106 return nullptr; | 1105 return nullptr; |
1107 } | 1106 } |
1108 | 1107 |
1109 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { | 1108 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { |
1110 return m_bReverse ? PrevAnnot() : NextAnnot(); | 1109 return m_bReverse ? PrevAnnot() : NextAnnot(); |
1111 } | 1110 } |
OLD | NEW |