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

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

Issue 1157773012: Cleanup: Make CPDF_Annot::m_pAnnotDict private. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 6 months 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
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 "../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
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); 94 ASSERT(pPDFAnnot != NULL);
Tom Sepez 2015/06/05 21:15:30 nit: these two asserts are pointless as we'll segv
Lei Zhang 2015/06/05 22:25:47 Ok, removed a whole bunch of them.
95 » ASSERT(pPDFAnnot->m_pAnnotDict != NULL); 95 » ASSERT(pPDFAnnot->GetAnnotDict() != NULL);
96 96
97 CPDFSDK_DateTime curTime; 97 CPDFSDK_DateTime curTime;
98 » pPDFAnnot->m_pAnnotDict->SetAtString("M", curTime.ToPDFDateTimeString()) ; 98 » pPDFAnnot->GetAnnotDict()->SetAtString("M", curTime.ToPDFDateTimeString( ));
99 » pPDFAnnot->m_pAnnotDict->SetAtNumber("F", (int)0);» 99 » pPDFAnnot->GetAnnotDict()->SetAtNumber("F", 0);
100 100
101 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) 101 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
102 { 102 {
103 pAnnotHandler->OnCreate(pAnnot); 103 pAnnotHandler->OnCreate(pAnnot);
104 } 104 }
105 } 105 }
106 106
107 void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot) 107 void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot)
108 { 108 {
109 ASSERT(pAnnot != NULL); 109 ASSERT(pAnnot != NULL);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 { 395 {
396 ASSERT(pPage != NULL); 396 ASSERT(pPage != NULL);
397 pPage->GetPDFDocument(); 397 pPage->GetPDFDocument();
398 398
399 CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc(); 399 CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc();
400 ASSERT(pSDKDoc); 400 ASSERT(pSDKDoc);
401 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor m(); 401 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor m();
402 ASSERT(pInterForm != NULL); 402 ASSERT(pInterForm != NULL);
403 403
404 CPDFSDK_Widget* pWidget = NULL; 404 CPDFSDK_Widget* pWidget = NULL;
405 » if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm- >GetInterForm(), pAnnot->m_pAnnotDict)) 405 » if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm- >GetInterForm(), pAnnot->GetAnnotDict()))
406 { 406 {
407 pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm); 407 pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
408 pInterForm->AddMap(pCtrl, pWidget); 408 pInterForm->AddMap(pCtrl, pWidget);
409 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm(); 409 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
410 if(pPDFInterForm && pPDFInterForm->NeedConstructAP()) 410 if(pPDFInterForm && pPDFInterForm->NeedConstructAP())
411 pWidget->ResetAppearance(NULL,FALSE); 411 pWidget->ResetAppearance(NULL,FALSE);
412 } 412 }
413 413
414 return pWidget; 414 return pWidget;
415 } 415 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 m_pIteratorAnnotList.RemoveAt(i); 931 m_pIteratorAnnotList.RemoveAt(i);
932 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); 932 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot);
933 break; 933 break;
934 } 934 }
935 } 935 }
936 } 936 }
937 937
938 return TRUE; 938 return TRUE;
939 } 939 }
940 940
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698