summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-16 11:49:55 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-16 20:23:48 +0000
commitd6ae2afa821c87e84790d5c04bbc172a7b12f08f (patch)
tree10beb72deaffca61ccc54a3fb49ea0d9636579bb /fpdfsdk/cpdfsdk_interform.cpp
parent49f7deb494064351c72ef4d31577e04f634e63f3 (diff)
downloadpdfium-d6ae2afa821c87e84790d5c04bbc172a7b12f08f.tar.xz
Rename IJS_Context to IJS_EventContext.
Prevents confusion with v8::Context, which is wrapped by a different IJS_ class. Change-Id: Iff75809e65015c0f810294de1f0d8ecf963150a3 Reviewed-on: https://pdfium-review.googlesource.com/2751 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index b22ccb1684..4229fcdac5 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -30,7 +30,7 @@
#include "fpdfsdk/fsdk_define.h"
#include "fpdfsdk/fxedit/fxet_edit.h"
#include "fpdfsdk/ipdfsdk_annothandler.h"
-#include "fpdfsdk/javascript/ijs_context.h"
+#include "fpdfsdk/javascript/ijs_event_context.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
#include "fpdfsdk/pdfwindow/PWL_Utils.h"
#include "third_party/base/stl_util.h"
@@ -253,7 +253,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) {
if (csJS.IsEmpty())
continue;
- IJS_Context* pContext = pRuntime->NewContext();
+ IJS_EventContext* pContext = pRuntime->NewEventContext();
CFX_WideString sOldValue = pField->GetValue();
CFX_WideString sValue = sOldValue;
bool bRC = true;
@@ -261,12 +261,10 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) {
CFX_WideString sInfo;
bool bRet = pContext->RunScript(csJS, &sInfo);
- pRuntime->ReleaseContext(pContext);
-
+ pRuntime->ReleaseEventContext(pContext);
if (bRet && bRC && sValue.Compare(sOldValue) != 0)
pField->SetValue(sValue, true);
}
-
m_bBusy = false;
}
@@ -296,12 +294,11 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField,
if (!script.IsEmpty()) {
CFX_WideString Value = sValue;
- IJS_Context* pContext = pRuntime->NewContext();
+ IJS_EventContext* pContext = pRuntime->NewEventContext();
pContext->OnField_Format(pFormField, Value, true);
CFX_WideString sInfo;
bool bRet = pContext->RunScript(script, &sInfo);
- pRuntime->ReleaseContext(pContext);
-
+ pRuntime->ReleaseEventContext(pContext);
if (bRet) {
sValue = Value;
bFormatted = true;
@@ -309,7 +306,6 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField,
}
}
}
-
return sValue;
}