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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
8 #include "../include/fsdk_mgr.h" | 8 #include "../include/fsdk_mgr.h" |
9 #include "../include/formfiller/FFL_FormFiller.h" | 9 #include "../include/formfiller/FFL_FormFiller.h" |
10 #include "../include/fsdk_annothandler.h" | 10 #include "../include/fsdk_annothandler.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 { | 84 { |
85 delete (CPDFSDK_Annot*)pAnnot; | 85 delete (CPDFSDK_Annot*)pAnnot; |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) | 89 void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot) |
90 { | 90 { |
91 ASSERT(pAnnot != NULL); | 91 ASSERT(pAnnot != NULL); |
92 | 92 |
93 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 93 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
94 ASSERT(pPDFAnnot != NULL); | |
95 ASSERT(pPDFAnnot->m_pAnnotDict != NULL); | |
96 | 94 |
97 CPDFSDK_DateTime curTime; | 95 CPDFSDK_DateTime curTime; |
98 » pPDFAnnot->m_pAnnotDict->SetAtString("M", curTime.ToPDFDateTimeString())
; | 96 » pPDFAnnot->GetAnnotDict()->SetAtString("M", curTime.ToPDFDateTimeString(
)); |
99 » pPDFAnnot->m_pAnnotDict->SetAtNumber("F", (int)0);» | 97 » pPDFAnnot->GetAnnotDict()->SetAtNumber("F", 0); |
100 | 98 |
101 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) | 99 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) |
102 { | 100 { |
103 pAnnotHandler->OnCreate(pAnnot); | 101 pAnnotHandler->OnCreate(pAnnot); |
104 } | 102 } |
105 } | 103 } |
106 | 104 |
107 void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) | 105 void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) |
108 { | 106 { |
109 ASSERT(pAnnot != NULL); | 107 ASSERT(pAnnot != NULL); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 { | 393 { |
396 ASSERT(pPage != NULL); | 394 ASSERT(pPage != NULL); |
397 pPage->GetPDFDocument(); | 395 pPage->GetPDFDocument(); |
398 | 396 |
399 CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc(); | 397 CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc(); |
400 ASSERT(pSDKDoc); | 398 ASSERT(pSDKDoc); |
401 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor
m(); | 399 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor
m(); |
402 ASSERT(pInterForm != NULL); | 400 ASSERT(pInterForm != NULL); |
403 | 401 |
404 CPDFSDK_Widget* pWidget = NULL; | 402 CPDFSDK_Widget* pWidget = NULL; |
405 » if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm-
>GetInterForm(), pAnnot->m_pAnnotDict)) | 403 » if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm-
>GetInterForm(), pAnnot->GetAnnotDict())) |
406 { | 404 { |
407 pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); | 405 pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); |
408 pInterForm->AddMap(pCtrl, pWidget); | 406 pInterForm->AddMap(pCtrl, pWidget); |
409 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); | 407 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); |
410 if(pPDFInterForm && pPDFInterForm->NeedConstructAP()) | 408 if(pPDFInterForm && pPDFInterForm->NeedConstructAP()) |
411 pWidget->ResetAppearance(NULL,FALSE); | 409 pWidget->ResetAppearance(NULL,FALSE); |
412 } | 410 } |
413 | 411 |
414 return pWidget; | 412 return pWidget; |
415 } | 413 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 m_pIteratorAnnotList.RemoveAt(i); | 929 m_pIteratorAnnotList.RemoveAt(i); |
932 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); | 930 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); |
933 break; | 931 break; |
934 } | 932 } |
935 } | 933 } |
936 } | 934 } |
937 | 935 |
938 return TRUE; | 936 return TRUE; |
939 } | 937 } |
940 | 938 |
OLD | NEW |