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

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

Issue 1235393002: Tidy up CPDFDOC_Environment. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 FX_DWORD dwPermissions = pDocument->GetUserPermissions() ; 377 FX_DWORD dwPermissions = pDocument->GetUserPermissions() ;
378 return (dwPermissions&FPDFPERM_FILL_FORM) || 378 return (dwPermissions&FPDFPERM_FILL_FORM) ||
379 (dwPermissions&FPDFPERM_ANNOT_FORM) || 379 (dwPermissions&FPDFPERM_ANNOT_FORM) ||
380 (dwPermissions&FPDFPERM_ANNOT_FORM); 380 (dwPermissions&FPDFPERM_ANNOT_FORM);
381 } 381 }
382 } 382 }
383 383
384 return FALSE; 384 return FALSE;
385 } 385 }
386 386
387 CPDFSDK_Annot*» » CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPD FSDK_PageView* pPage) 387 CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Page View* pPage)
388 { 388 {
389 » ASSERT(pPage != NULL); 389 » CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
Lei Zhang 2015/07/16 17:05:06 kill tabs
Tom Sepez 2015/07/16 18:01:28 Untabified file.
390 » pPage->GetPDFDocument(); 390 » CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor m();
391 CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInte rForm(), pAnnot->GetAnnotDict());
392 if (!pCtrl)
393 return nullptr;
391 394
392 » CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc(); 395 » CPDFSDK_Widget* pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
393 » ASSERT(pSDKDoc); 396 pInterForm->AddMap(pCtrl, pWidget);
394 » CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterFor m(); 397 CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
395 » ASSERT(pInterForm != NULL); 398 if (pPDFInterForm && pPDFInterForm->NeedConstructAP())
396 399 pWidget->ResetAppearance(NULL, FALSE);
Lei Zhang 2015/07/16 17:05:06 NULL -> nullptr
Tom Sepez 2015/07/16 18:01:28 Done.
397 » CPDFSDK_Widget* pWidget = NULL;
398 » if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm- >GetInterForm(), pAnnot->GetAnnotDict()))
399 » {
400 » » pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
401 » » pInterForm->AddMap(pCtrl, pWidget);
402 » » CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
403 » » if(pPDFInterForm && pPDFInterForm->NeedConstructAP())
404 » » » pWidget->ResetAppearance(NULL,FALSE);
405 » }
406 400
407 return pWidget; 401 return pWidget;
408 } 402 }
409 403
410 void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) 404 void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot)
411 { 405 {
412 ASSERT(pAnnot != NULL); 406 ASSERT(pAnnot != NULL);
413 407
414 if (m_pFormFiller) 408 if (m_pFormFiller)
415 m_pFormFiller->OnDelete(pAnnot); 409 m_pFormFiller->OnDelete(pAnnot);
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 m_pIteratorAnnotList.RemoveAt(i); 915 m_pIteratorAnnotList.RemoveAt(i);
922 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot); 916 m_pIteratorAnnotList.InsertAt(0, pReaderAnnot);
923 break; 917 break;
924 } 918 }
925 } 919 }
926 } 920 }
927 921
928 return TRUE; 922 return TRUE;
929 } 923 }
930 924
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698