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/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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, |
137 CFX_RenderDevice* pDevice, | 137 CFX_RenderDevice* pDevice, |
138 CPDF_Matrix* pUser2Device, | 138 CPDF_Matrix* pUser2Device, |
139 FX_DWORD dwFlags) { | 139 FX_DWORD dwFlags) { |
140 ASSERT(pAnnot != NULL); | 140 ASSERT(pAnnot); |
141 | 141 |
142 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { | 142 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
143 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 143 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
144 } else { | 144 } else { |
145 if (!pAnnot->IsXFAField()) | 145 if (!pAnnot->IsXFAField()) |
dsinclair
2015/11/04 18:57:20
Merge conflict as XFA has the extra if.
Lei Zhang
2015/11/04 19:01:54
Can you add some braces here?
dsinclair
2015/11/04 19:04:09
Done.
| |
146 ((CPDFSDK_BAAnnot*)pAnnot) | 146 static_cast<CPDFSDK_BAAnnot*>(pAnnot) |
147 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); | 147 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( | 151 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( |
152 CPDFSDK_PageView* pPageView, | 152 CPDFSDK_PageView* pPageView, |
153 CPDFSDK_Annot* pAnnot, | 153 CPDFSDK_Annot* pAnnot, |
154 FX_DWORD nFlags, | 154 FX_DWORD nFlags, |
155 const CPDF_Point& point) { | 155 const CPDF_Point& point) { |
156 ASSERT(pAnnot != NULL); | 156 ASSERT(pAnnot != NULL); |
157 | 157 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 pInterForm->RemoveMap(pCtrol); | 442 pInterForm->RemoveMap(pCtrol); |
443 | 443 |
444 delete pWidget; | 444 delete pWidget; |
445 } | 445 } |
446 | 446 |
447 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 447 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
448 CPDFSDK_Annot* pAnnot, | 448 CPDFSDK_Annot* pAnnot, |
449 CFX_RenderDevice* pDevice, | 449 CFX_RenderDevice* pDevice, |
450 CPDF_Matrix* pUser2Device, | 450 CPDF_Matrix* pUser2Device, |
451 FX_DWORD dwFlags) { | 451 FX_DWORD dwFlags) { |
452 ASSERT(pAnnot != NULL); | |
453 CFX_ByteString sSubType = pAnnot->GetSubType(); | 452 CFX_ByteString sSubType = pAnnot->GetSubType(); |
454 | 453 |
455 if (sSubType == BFFT_SIGNATURE) { | 454 if (sSubType == BFFT_SIGNATURE) { |
456 ((CPDFSDK_BAAnnot*)pAnnot) | 455 static_cast<CPDFSDK_BAAnnot*>(pAnnot) |
457 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); | 456 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
458 } else { | 457 } else { |
459 if (m_pFormFiller) { | 458 if (m_pFormFiller) { |
460 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 459 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
461 } | 460 } |
462 } | 461 } |
463 } | 462 } |
464 | 463 |
465 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, | 464 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
466 CPDFSDK_Annot* pAnnot, | 465 CPDFSDK_Annot* pAnnot, |
467 FX_DWORD nFlag) { | 466 FX_DWORD nFlag) { |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1188 | 1187 |
1189 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { | 1188 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { |
1190 if (m_pos < m_iteratorAnnotList.size()) | 1189 if (m_pos < m_iteratorAnnotList.size()) |
1191 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; | 1190 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; |
1192 return nullptr; | 1191 return nullptr; |
1193 } | 1192 } |
1194 | 1193 |
1195 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { | 1194 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { |
1196 return m_bReverse ? PrevAnnot() : NextAnnot(); | 1195 return m_bReverse ? PrevAnnot() : NextAnnot(); |
1197 } | 1196 } |
OLD | NEW |