summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp18
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp26
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp42
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp13
4 files changed, 25 insertions, 74 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index b49726d5ab..29352216ab 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -300,24 +300,6 @@ void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd) {
ASSERT(m_pApp != NULL);
}
-FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument) {
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
-FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument) {
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
-FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument) {
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit) {
ASSERT(pEdit != NULL);
}
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 4fb7542091..80e1b0e887 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -242,7 +242,8 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
return FALSE;
}
-FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
+FX_BOOL CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot,
+ FX_UINT nFlag) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument();
@@ -256,7 +257,8 @@ FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
return TRUE;
}
-FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
+FX_BOOL CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot,
+ FX_UINT nFlag) {
if (!IsValid())
return TRUE;
@@ -597,7 +599,7 @@ IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const {
return m_pApp->GetSysHandler();
}
-void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown) {}
+void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) {}
void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView,
FX_BOOL bDestroyPDFWindow) {
@@ -610,24 +612,6 @@ void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView,
DestroyPDFWindow(pPageView);
}
-FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
-void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument) {}
-
-void CFFL_FormFiller::DoCut(CPDFSDK_Document* pDocument) {}
-
-void CFFL_FormFiller::DoPaste(CPDFSDK_Document* pDocument) {}
-
void CFFL_FormFiller::InvalidateRect(double left,
double top,
double right,
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index ad573470bd..f8f8c6a943 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -459,7 +459,7 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
}
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
- return pFormFiller->OnSetFocus(pAnnot, nFlag);
+ return pFormFiller->SetFocusForAnnot(pAnnot, nFlag);
return TRUE;
}
@@ -470,28 +470,28 @@ 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->OnKillFocus(pAnnot, nFlag)) {
- if (!m_bNotifying) {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) {
- m_bNotifying = TRUE;
- pWidget->ClearAppModified();
+ if (!pFormFiller->KillFocusForAnnot(pAnnot, nFlag))
+ return FALSE;
- CPDFSDK_PageView* pPageView = pWidget->GetPageView();
- ASSERT(pPageView != NULL);
+ if (!m_bNotifying) {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) {
+ m_bNotifying = TRUE;
+ pWidget->ClearAppModified();
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+ CPDFSDK_PageView* pPageView = pWidget->GetPageView();
+ ASSERT(pPageView != NULL);
- pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
- m_bNotifying = FALSE;
- }
+ pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
+
+ pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
+ m_bNotifying = FALSE;
}
- } else
- return FALSE;
+ }
}
return TRUE;
@@ -898,13 +898,11 @@ void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList,
void* pPrivateData,
FX_BOOL& bExit,
FX_DWORD nFlag) {
- ASSERT(pPrivateData != NULL);
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- ASSERT(pData->pWidget != NULL);
+ ASSERT(pData->pWidget);
CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
if (!bEditOrList)
- pFormFiller->OnKeyStroke(bExit);
+ pFormFiller->OnKeyStroke(bExit, nFlag);
}
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index 2acf6b8fda..b95ac9356f 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -287,22 +287,9 @@ void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) {
nCharacters, TRUE);
pEdit->SetEditNotify(this);
- // pUndo->BeginEdit(pDocument);
}
}
void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) {}
-FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
-FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
-FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument) {
- return FALSE;
-}
-
void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) {}