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

Unified Diff: fpdfsdk/src/formfiller/FFL_FormFiller.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/formfiller/FFL_FormFiller.h ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_FormFiller.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 42177f59329654003ee12d6f109555009f10079d..642e5e896487c95d35549c9226077e6447aa1251 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -242,8 +242,7 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
return FALSE;
}
-FX_BOOL CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot,
- FX_UINT nFlag) {
+void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDFXFA_Page* pPage = pWidget->GetPDFXFAPage();
CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument();
@@ -254,31 +253,31 @@ FX_BOOL CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot,
m_bValid = TRUE;
FX_RECT rcRect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
- return TRUE;
}
-FX_BOOL CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot,
- FX_UINT nFlag) {
+void CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
if (!IsValid())
- return TRUE;
+ return;
CPDFSDK_PageView* pPageView = GetCurPageView();
+ if (!pPageView)
+ return;
+
CommitData(pPageView, nFlag);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
pWnd->KillFocus();
+ FX_BOOL bDestroyPDFWindow;
switch (m_pWidget->GetFieldType()) {
case FIELDTYPE_PUSHBUTTON:
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
- EscapeFiller(pPageView, TRUE);
- break;
+ bDestroyPDFWindow = TRUE;
default:
- EscapeFiller(pPageView, FALSE);
- break;
+ bDestroyPDFWindow = FALSE;
}
- return TRUE;
+ EscapeFiller(pPageView, bDestroyPDFWindow);
}
FX_BOOL CFFL_FormFiller::IsValid() const {
« no previous file with comments | « fpdfsdk/include/formfiller/FFL_FormFiller.h ('k') | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698