| 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 "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
| 10 #include "fpdfsdk/include/fsdk_annothandler.h" | 10 #include "fpdfsdk/include/fsdk_annothandler.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( | 137 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( |
| 138 const CFX_ByteString& sType) const { | 138 const CFX_ByteString& sType) const { |
| 139 auto it = m_mapType2Handler.find(sType); | 139 auto it = m_mapType2Handler.find(sType); |
| 140 return it != m_mapType2Handler.end() ? it->second : nullptr; | 140 return it != m_mapType2Handler.end() ? it->second : nullptr; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, | 143 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, |
| 144 CPDFSDK_Annot* pAnnot, | 144 CPDFSDK_Annot* pAnnot, |
| 145 CFX_RenderDevice* pDevice, | 145 CFX_RenderDevice* pDevice, |
| 146 CPDF_Matrix* pUser2Device, | 146 CFX_Matrix* pUser2Device, |
| 147 FX_DWORD dwFlags) { | 147 FX_DWORD dwFlags) { |
| 148 ASSERT(pAnnot); | 148 ASSERT(pAnnot); |
| 149 | 149 |
| 150 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { | 150 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { |
| 151 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 151 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 152 } else { | 152 } else { |
| 153 #ifdef PDF_ENABLE_XFA | 153 #ifdef PDF_ENABLE_XFA |
| 154 if (pAnnot->IsXFAField()) | 154 if (pAnnot->IsXFAField()) |
| 155 return; | 155 return; |
| 156 #endif // PDF_ENABLE_XFA | 156 #endif // PDF_ENABLE_XFA |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 CPDF_FormControl* pCtrol = pWidget->GetFormControl(); | 461 CPDF_FormControl* pCtrol = pWidget->GetFormControl(); |
| 462 pInterForm->RemoveMap(pCtrol); | 462 pInterForm->RemoveMap(pCtrol); |
| 463 | 463 |
| 464 delete pWidget; | 464 delete pWidget; |
| 465 } | 465 } |
| 466 | 466 |
| 467 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 467 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
| 468 CPDFSDK_Annot* pAnnot, | 468 CPDFSDK_Annot* pAnnot, |
| 469 CFX_RenderDevice* pDevice, | 469 CFX_RenderDevice* pDevice, |
| 470 CPDF_Matrix* pUser2Device, | 470 CFX_Matrix* pUser2Device, |
| 471 FX_DWORD dwFlags) { | 471 FX_DWORD dwFlags) { |
| 472 CFX_ByteString sSubType = pAnnot->GetSubType(); | 472 CFX_ByteString sSubType = pAnnot->GetSubType(); |
| 473 | 473 |
| 474 if (sSubType == BFFT_SIGNATURE) { | 474 if (sSubType == BFFT_SIGNATURE) { |
| 475 static_cast<CPDFSDK_BAAnnot*>(pAnnot) | 475 static_cast<CPDFSDK_BAAnnot*>(pAnnot) |
| 476 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 476 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
| 477 } else { | 477 } else { |
| 478 if (m_pFormFiller) { | 478 if (m_pFormFiller) { |
| 479 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 479 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 480 } | 480 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 return pWidget; | 767 return pWidget; |
| 768 } | 768 } |
| 769 | 769 |
| 770 FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { | 770 FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { |
| 771 return pAnnot->GetXFAWidget() != NULL; | 771 return pAnnot->GetXFAWidget() != NULL; |
| 772 } | 772 } |
| 773 | 773 |
| 774 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 774 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
| 775 CPDFSDK_Annot* pAnnot, | 775 CPDFSDK_Annot* pAnnot, |
| 776 CFX_RenderDevice* pDevice, | 776 CFX_RenderDevice* pDevice, |
| 777 CPDF_Matrix* pUser2Device, | 777 CFX_Matrix* pUser2Device, |
| 778 FX_DWORD dwFlags) { | 778 FX_DWORD dwFlags) { |
| 779 ASSERT(pPageView != NULL); | 779 ASSERT(pPageView != NULL); |
| 780 ASSERT(pAnnot != NULL); | 780 ASSERT(pAnnot != NULL); |
| 781 | 781 |
| 782 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); | 782 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); |
| 783 ASSERT(pSDKDoc != NULL); | 783 ASSERT(pSDKDoc != NULL); |
| 784 | 784 |
| 785 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); | 785 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); |
| 786 ASSERT(pWidgetHandler != NULL); | 786 ASSERT(pWidgetHandler != NULL); |
| 787 | 787 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1195 |
| 1196 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { | 1196 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { |
| 1197 if (m_pos < m_iteratorAnnotList.size()) | 1197 if (m_pos < m_iteratorAnnotList.size()) |
| 1198 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; | 1198 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; |
| 1199 return nullptr; | 1199 return nullptr; |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { | 1202 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { |
| 1203 return m_bReverse ? PrevAnnot() : NextAnnot(); | 1203 return m_bReverse ? PrevAnnot() : NextAnnot(); |
| 1204 } | 1204 } |
| OLD | NEW |