diff options
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_FormFiller.cpp | 21 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp | 5 |
2 files changed, 12 insertions, 14 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index 42177f5932..642e5e8964 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 { diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index aaed794db8..c1450f6c84 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -463,7 +463,7 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) - return pFormFiller->SetFocusForAnnot(pAnnot, nFlag); + pFormFiller->SetFocusForAnnot(pAnnot, nFlag); return TRUE; } @@ -474,8 +474,7 @@ FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { - if (!pFormFiller->KillFocusForAnnot(pAnnot, nFlag)) - return FALSE; + pFormFiller->KillFocusForAnnot(pAnnot, nFlag); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |