| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( | 117 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( |
| 118 CPDFSDK_Annot* pAnnot) const { | 118 CPDFSDK_Annot* pAnnot) const { |
| 119 ASSERT(pAnnot != NULL); | 119 ASSERT(pAnnot != NULL); |
| 120 | 120 |
| 121 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 121 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
| 122 if (pPDFAnnot) | 122 if (pPDFAnnot) |
| 123 return GetAnnotHandler(pPDFAnnot->GetSubType()); | 123 return GetAnnotHandler(pPDFAnnot->GetSubType()); |
| 124 else if (pAnnot->GetXFAWidget()) | 124 if (pAnnot->GetXFAWidget()) |
| 125 return GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME); | 125 return GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME); |
| 126 return NULL; | 126 return nullptr; |
| 127 } | 127 } |
| 128 | 128 |
| 129 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( | 129 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( |
| 130 const CFX_ByteString& sType) const { | 130 const CFX_ByteString& sType) const { |
| 131 auto it = m_mapType2Handler.find(sType); | 131 auto it = m_mapType2Handler.find(sType); |
| 132 return it != m_mapType2Handler.end() ? it->second : nullptr; | 132 return it != m_mapType2Handler.end() ? it->second : nullptr; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, | 135 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, |
| 136 CPDFSDK_Annot* pAnnot, | 136 CPDFSDK_Annot* pAnnot, |
| (...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 | 1188 |
| 1189 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { | 1189 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { |
| 1190 if (m_pos < m_iteratorAnnotList.size()) | 1190 if (m_pos < m_iteratorAnnotList.size()) |
| 1191 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; | 1191 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; |
| 1192 return nullptr; | 1192 return nullptr; |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { | 1195 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { |
| 1196 return m_bReverse ? PrevAnnot() : NextAnnot(); | 1196 return m_bReverse ? PrevAnnot() : NextAnnot(); |
| 1197 } | 1197 } |
| OLD | NEW |