From 06f3042167126d60184dc3c401e71924cf3b46af Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 5 Oct 2018 20:43:46 +0000 Subject: 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 Commit-Queue: Ryan Harrison --- fpdfsdk/cpdfsdk_formfillenvironment.cpp | 7 ------- fpdfsdk/cpdfsdk_formfillenvironment.h | 4 ---- fpdfsdk/fpdf_formfill.cpp | 10 ---------- fpdfsdk/fpdf_view_c_api_test.c | 1 - fxjs/cjs_app.cpp | 6 ------ public/fpdf_formfill.h | 20 -------------------- 6 files changed, 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 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>& 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 -- cgit v1.2.3