summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fsdk_actionhandler.cpp9
-rw-r--r--fpdfsdk/fsdk_actionhandler.h6
2 files changed, 8 insertions, 7 deletions
diff --git a/fpdfsdk/fsdk_actionhandler.cpp b/fpdfsdk/fsdk_actionhandler.cpp
index c0e413f158..305d905c85 100644
--- a/fpdfsdk/fsdk_actionhandler.cpp
+++ b/fpdfsdk/fsdk_actionhandler.cpp
@@ -525,7 +525,7 @@ void CPDFSDK_ActionHandler::DoAction_ResetForm(
void CPDFSDK_ActionHandler::RunScriptForAction(
const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv,
- std::function<void(IJS_EventContext* context)> cb) {
+ const RunScriptCallback& cb) {
if (!pFormFillEnv->IsJSPlatformPresent())
return;
@@ -536,10 +536,9 @@ void CPDFSDK_ActionHandler::RunScriptForAction(
RunScript(pFormFillEnv, swJS, cb);
}
-void CPDFSDK_ActionHandler::RunScript(
- CPDFSDK_FormFillEnvironment* pFormFillEnv,
- const WideString& script,
- std::function<void(IJS_EventContext* context)> cb) {
+void CPDFSDK_ActionHandler::RunScript(CPDFSDK_FormFillEnvironment* pFormFillEnv,
+ const WideString& script,
+ const RunScriptCallback& cb) {
IJS_Runtime* pRuntime = pFormFillEnv->GetIJSRuntime();
IJS_EventContext* pContext = pRuntime->NewEventContext();
diff --git a/fpdfsdk/fsdk_actionhandler.h b/fpdfsdk/fsdk_actionhandler.h
index 1aaf2f903d..0e5af1a41a 100644
--- a/fpdfsdk/fsdk_actionhandler.h
+++ b/fpdfsdk/fsdk_actionhandler.h
@@ -57,12 +57,14 @@ class CPDFSDK_ActionHandler {
PDFSDK_FieldAction* data);
private:
+ using RunScriptCallback = std::function<void(IJS_EventContext* context)>;
+
void RunScriptForAction(const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv,
- std::function<void(IJS_EventContext* context)> cb);
+ const RunScriptCallback& cb);
void RunScript(CPDFSDK_FormFillEnvironment* pFormFillEnv,
const WideString& script,
- std::function<void(IJS_EventContext* context)> cb);
+ const RunScriptCallback& cb);
bool ExecuteDocumentOpenAction(const CPDF_Action& action,
CPDFSDK_FormFillEnvironment* pFormFillEnv,