summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_interform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/cpdfsdk_interform.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 4f11babbbe..b37562ccf2 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -291,10 +291,9 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) {
bool bRC = true;
pContext->OnField_Calculate(pFormField, pField, sValue, bRC);
- WideString sInfo;
- bool bRet = pContext->RunScript(csJS, &sInfo);
+ Optional<IJS_Runtime::JS_Error> err = pContext->RunScript(csJS);
pRuntime->ReleaseEventContext(pContext);
- if (bRet && bRC && sValue.Compare(sOldValue) != 0)
+ if (!err && bRC && sValue.Compare(sOldValue) != 0)
pField->SetValue(sValue, true);
}
m_bBusy = false;
@@ -328,10 +327,10 @@ WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField,
IJS_EventContext* pContext = pRuntime->NewEventContext();
pContext->OnField_Format(pFormField, Value, true);
- WideString sInfo;
- bool bRet = pContext->RunScript(script, &sInfo);
+
+ Optional<IJS_Runtime::JS_Error> err = pContext->RunScript(script);
pRuntime->ReleaseEventContext(pContext);
- if (bRet) {
+ if (!err) {
sValue = Value;
bFormatted = true;
}