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

Side by Side Diff: fpdfsdk/src/formfiller/FFL_IFormFiller.cpp

Issue 1378193006: Merge to XFA: Do not call into formfiller code with a NULL PageView. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_FormFiller.cpp ('k') | no next file » | 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 "../../include/formfiller/FFL_FormFiller.h" 7 #include "../../include/formfiller/FFL_FormFiller.h"
8 #include "../../include/formfiller/FFL_IFormFiller.h" 8 #include "../../include/formfiller/FFL_IFormFiller.h"
9 #include "../../include/formfiller/FFL_CheckBox.h" 9 #include "../../include/formfiller/FFL_CheckBox.h"
10 #include "../../include/formfiller/FFL_ComboBox.h" 10 #include "../../include/formfiller/FFL_ComboBox.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (pWidget->IsAppModified()) { 456 if (pWidget->IsAppModified()) {
457 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { 457 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
458 pFormFiller->ResetPDFWindow(pPageView, 458 pFormFiller->ResetPDFWindow(pPageView,
459 nValueAge == pWidget->GetValueAge()); 459 nValueAge == pWidget->GetValueAge());
460 } 460 }
461 } 461 }
462 } 462 }
463 } 463 }
464 464
465 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) 465 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
466 return pFormFiller->SetFocusForAnnot(pAnnot, nFlag); 466 pFormFiller->SetFocusForAnnot(pAnnot, nFlag);
467 467
468 return TRUE; 468 return TRUE;
469 } 469 }
470 470
471 FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { 471 FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
472 if (!pAnnot) 472 if (!pAnnot)
473 return FALSE; 473 return FALSE;
474 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); 474 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
475 475
476 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { 476 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
477 if (!pFormFiller->KillFocusForAnnot(pAnnot, nFlag)) 477 pFormFiller->KillFocusForAnnot(pAnnot, nFlag);
478 return FALSE;
479 478
480 if (!m_bNotifying) { 479 if (!m_bNotifying) {
481 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; 480 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
482 if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) { 481 if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) {
483 m_bNotifying = TRUE; 482 m_bNotifying = TRUE;
484 pWidget->ClearAppModified(); 483 pWidget->ClearAppModified();
485 484
486 CPDFSDK_PageView* pPageView = pWidget->GetPageView(); 485 CPDFSDK_PageView* pPageView = pWidget->GetPageView();
487 ASSERT(pPageView != NULL); 486 ASSERT(pPageView != NULL);
488 487
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 FX_BOOL& bExit, 1084 FX_BOOL& bExit,
1086 FX_DWORD nFlag) { 1085 FX_DWORD nFlag) {
1087 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; 1086 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
1088 ASSERT(pData->pWidget); 1087 ASSERT(pData->pWidget);
1089 1088
1090 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); 1089 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
1091 1090
1092 if (!bEditOrList) 1091 if (!bEditOrList)
1093 pFormFiller->OnKeyStroke(bExit, nFlag); 1092 pFormFiller->OnKeyStroke(bExit, nFlag);
1094 } 1093 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_FormFiller.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698