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

Side by Side Diff: fpdfsdk/src/fsdk_annothandler.cpp

Issue 1415933007: Merge to XFA: Cleanup after syncing CPDFSDK_BAAnnot (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month 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/include/fsdk_baseannot.h ('k') | fpdfsdk/src/fsdk_baseannot.cpp » ('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 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
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()) {
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
151 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( 152 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(
152 CPDFSDK_PageView* pPageView, 153 CPDFSDK_PageView* pPageView,
153 CPDFSDK_Annot* pAnnot, 154 CPDFSDK_Annot* pAnnot,
154 FX_DWORD nFlags, 155 FX_DWORD nFlags,
155 const CPDF_Point& point) { 156 const CPDF_Point& point) {
156 ASSERT(pAnnot != NULL); 157 ASSERT(pAnnot != NULL);
157 158
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 pInterForm->RemoveMap(pCtrol); 443 pInterForm->RemoveMap(pCtrol);
443 444
444 delete pWidget; 445 delete pWidget;
445 } 446 }
446 447
447 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, 448 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
448 CPDFSDK_Annot* pAnnot, 449 CPDFSDK_Annot* pAnnot,
449 CFX_RenderDevice* pDevice, 450 CFX_RenderDevice* pDevice,
450 CPDF_Matrix* pUser2Device, 451 CPDF_Matrix* pUser2Device,
451 FX_DWORD dwFlags) { 452 FX_DWORD dwFlags) {
452 ASSERT(pAnnot != NULL);
453 CFX_ByteString sSubType = pAnnot->GetSubType(); 453 CFX_ByteString sSubType = pAnnot->GetSubType();
454 454
455 if (sSubType == BFFT_SIGNATURE) { 455 if (sSubType == BFFT_SIGNATURE) {
456 ((CPDFSDK_BAAnnot*)pAnnot) 456 static_cast<CPDFSDK_BAAnnot*>(pAnnot)
457 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); 457 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
458 } else { 458 } else {
459 if (m_pFormFiller) { 459 if (m_pFormFiller) {
460 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); 460 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
461 } 461 }
462 } 462 }
463 } 463 }
464 464
465 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, 465 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
466 CPDFSDK_Annot* pAnnot, 466 CPDFSDK_Annot* pAnnot,
467 FX_DWORD nFlag) { 467 FX_DWORD nFlag) {
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/fsdk_baseannot.h ('k') | fpdfsdk/src/fsdk_baseannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698