summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-10-05 20:43:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-05 20:43:46 +0000
commit06f3042167126d60184dc3c401e71924cf3b46af (patch)
tree87c5478a50178cf32a9ca761362b83db254a3ebf
parent66095ebfb9fe0b522e56753b7d1b997e65b8b219 (diff)
downloadpdfium-06f3042167126d60184dc3c401e71924cf3b46af.tar.xz
Remove SetSaveCalled API
This was meant to be part of a mechanism to alert users that entered data into a PDF form was not going to actually be saved how they would expect. The UI for this is blocked on a bug in V8, and is now being superseded by work to correctly implement saving. BUG=pdfium:953 Change-Id: Id9c85c109a3f6a6b4ee69d35f366006be4dc9c32 Reviewed-on: https://pdfium-review.googlesource.com/c/43552 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp7
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.h4
-rw-r--r--fpdfsdk/fpdf_formfill.cpp10
-rw-r--r--fpdfsdk/fpdf_view_c_api_test.c1
-rw-r--r--fxjs/cjs_app.cpp6
-rw-r--r--public/fpdf_formfill.h20
6 files changed, 0 insertions, 48 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index c5f9aeb133..c9bb7c94fd 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -628,13 +628,6 @@ CPDFSDK_InterForm* CPDFSDK_FormFillEnvironment::GetInterForm() {
return m_pInterForm.get();
}
-void CPDFSDK_FormFillEnvironment::SaveCalled() {
- if (!m_pInfo || !m_SaveCalled)
- return;
-
- m_SaveCalled(m_pInfo);
-}
-
void CPDFSDK_FormFillEnvironment::UpdateAllViews(CPDFSDK_PageView* pSender,
CPDFSDK_Annot* pAnnot) {
for (const auto& it : m_PageMap) {
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index 7cdf32e15d..46986c8ae0 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -208,9 +208,6 @@ class CPDFSDK_FormFillEnvironment final
CPDFSDK_ActionHandler* GetActionHandler(); // Creates if not present.
CPDFSDK_InterForm* GetInterForm(); // Creates if not present.
- void SetSaveCalled(FORM_SAVECALLED callback) { m_SaveCalled = callback; }
- void SaveCalled();
-
private:
IPDF_Page* GetPage(int nIndex);
@@ -226,7 +223,6 @@ class CPDFSDK_FormFillEnvironment final
std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
bool m_bChangeMask = false;
bool m_bBeingDestroyed = false;
- FORM_SAVECALLED m_SaveCalled = nullptr;
};
#endif // FPDFSDK_CPDFSDK_FORMFILLENVIRONMENT_H_
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index 3a74bc3908..644f332db4 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -358,16 +358,6 @@ FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) {
delete pFormFillEnv;
}
-FPDF_EXPORT void FPDF_CALLCONV FORM_SetSaveCallback(FPDF_FORMHANDLE hHandle,
- FORM_SAVECALLED callback) {
- CPDFSDK_FormFillEnvironment* pFormFillEnv =
- CPDFSDKFormFillEnvironmentFromFPDFFormHandle(hHandle);
- if (!pFormFillEnv)
- return;
-
- pFormFillEnv->SetSaveCalled(callback);
-}
-
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,
FPDF_PAGE page,
int modifier,
diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c
index 2c8665156e..0fc28c31f4 100644
--- a/fpdfsdk/fpdf_view_c_api_test.c
+++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -249,7 +249,6 @@ int CheckPDFiumCApi() {
#endif
CHK(FORM_Redo);
CHK(FORM_ReplaceSelection);
- CHK(FORM_SetSaveCallback);
CHK(FORM_Undo);
CHK(FPDFDOC_ExitFormFillEnvironment);
CHK(FPDFDOC_InitFormFillEnvironment);
diff --git a/fxjs/cjs_app.cpp b/fxjs/cjs_app.cpp
index 12bb8ddc84..08d4e4e1c8 100644
--- a/fxjs/cjs_app.cpp
+++ b/fxjs/cjs_app.cpp
@@ -405,12 +405,6 @@ void CJS_App::ClearTimerCommon(CJS_Runtime* pRuntime,
CJS_Result CJS_App::execMenuItem(
CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params) {
- if (params.size() > 0 && IsTypeKnown(params[0])) {
- WideString item = pRuntime->ToWideString(params[0]);
- if (item == L"SaveAs" && pRuntime->GetFormFillEnv())
- pRuntime->GetFormFillEnv()->SaveCalled();
- }
-
return CJS_Result::Failure(JSMessage::kNotSupportedError);
}
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 3381eed5e4..bd8ab3c91a 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -1111,26 +1111,6 @@ FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document,
FPDF_EXPORT void FPDF_CALLCONV
FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
-typedef void (*FORM_SAVECALLED)(FPDF_FORMFILLINFO*);
-/**
- * Experimental API
- * Function: FORM_SetSaveCallback
- * This method is used to set a callback handler for when Save is
- * attempted by a PDF. Should be invoked after user successfully
- * loaded a PDF page, and method FPDFDOC_InitFormFillEnvironment had
- * been invoked.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by
- * FPDFDOC_InitFormFillEnvironment.
- * callback - Function pointer to the callback to be called when a
- * Save is attempted. If NULL then no function will be
- * invoked.
- * Return Value:
- * NONE.
- **/
-FPDF_EXPORT void FPDF_CALLCONV FORM_SetSaveCallback(FPDF_FORMHANDLE hHandle,
- FORM_SAVECALLED callback);
-
/**
* Function: FORM_OnAfterLoadPage
* This method is required for implementing all the form related