summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-05-16 12:17:50 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-16 16:29:23 +0000
commitc0d358ad234843a524a1bcc2a439f08ad0c64aa1 (patch)
treedfb046a476f5dece9f76764415e6f297591f1829 /xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
parent2eef64cba5c8e08a9e625f4aba5a7fbdc8e62bad (diff)
downloadpdfium-c0d358ad234843a524a1bcc2a439f08ad0c64aa1.tar.xz
Update formcalc return types
Update return types to be bools instead of ints. Make some methods private. Change-Id: I5d55c48a861f90e9bd116ef835c11cdb515002a6 Reviewed-on: https://pdfium-review.googlesource.com/5553 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fm2jscontext.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 716e378ed7..d0a111fa0d 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -2778,7 +2778,7 @@ void CXFA_FM2JSContext::Eval(CFXJSE_Value* pThis,
}
CFX_WideTextBuf wsJavaScriptBuf;
- if (CXFA_FM2JSContext::Translate(
+ if (!CXFA_FM2JSContext::Translate(
CFX_WideString::FromUTF8(utf8ScriptString.AsStringC()).AsStringC(),
&wsJavaScriptBuf)) {
pContext->ThrowCompilerErrorException();
@@ -5433,8 +5433,8 @@ void CXFA_FM2JSContext::eval_translation(CFXJSE_Value* pThis,
CFX_WideString scriptString = CFX_WideString::FromUTF8(argString.AsStringC());
CFX_WideTextBuf wsJavaScriptBuf;
- if (CXFA_FM2JSContext::Translate(scriptString.AsStringC(),
- &wsJavaScriptBuf)) {
+ if (!CXFA_FM2JSContext::Translate(scriptString.AsStringC(),
+ &wsJavaScriptBuf)) {
pContext->ThrowCompilerErrorException();
return;
}
@@ -6112,18 +6112,15 @@ CFX_ByteString CXFA_FM2JSContext::ValueToUTF8String(CFXJSE_Value* arg) {
}
// static.
-int32_t CXFA_FM2JSContext::Translate(const CFX_WideStringC& wsFormcalc,
- CFX_WideTextBuf* wsJavascript) {
+bool CXFA_FM2JSContext::Translate(const CFX_WideStringC& wsFormcalc,
+ CFX_WideTextBuf* wsJavascript) {
if (wsFormcalc.IsEmpty()) {
wsJavascript->Clear();
- return 0;
+ return true;
}
- CXFA_FMProgram program(wsFormcalc);
- int32_t status = program.ParseProgram();
- if (status)
- return status;
- return program.TranslateProgram(*wsJavascript);
+ CXFA_FMProgram program(wsFormcalc);
+ return program.ParseProgram() && program.TranslateProgram(*wsJavascript);
}
CXFA_FM2JSContext::CXFA_FM2JSContext(v8::Isolate* pScriptIsolate,