summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2018-02-19 18:12:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-19 18:12:43 +0000
commitefb648866f9582845d4788c945e523d565464cb9 (patch)
treef9cbb555ebb045de7e7e10c6ed21aa0ac84d1a80 /xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp
parent6a5b1c96e23bd684d9fec2c59e0d4bc5d883650c (diff)
downloadpdfium-efb648866f9582845d4788c945e523d565464cb9.tar.xz
Inline some formcalc identifiers
This CL inlines the RUNTIMEFUNCTIONRETURNVALUE and EXCLAMATION_IN_IDENTIFIER defines to make the output code easier to read. Change-Id: I4a86da2aefc75ff137d9a7cff0351515b275f1b1 Reviewed-on: https://pdfium-review.googlesource.com/27230 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp
index 4dcd51d2ed..c634a512d1 100644
--- a/xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmsimpleexpression.cpp
@@ -201,8 +201,7 @@ bool CXFA_FMIdentifierExpression::ToJavaScript(CFX_WideTextBuf& javascript,
} else if (tempStr == L"$template") {
tempStr = L"xfa.template";
} else if (tempStr[0] == L'!') {
- tempStr =
- EXCLAMATION_IN_IDENTIFIER + tempStr.Right(tempStr.GetLength() - 1);
+ tempStr = L"pfm__excl__" + tempStr.Right(tempStr.GetLength() - 1);
}
javascript << tempStr;
return !CXFA_IsTooBig(javascript);
@@ -261,10 +260,8 @@ bool CXFA_FMAssignExpression::ToJavaScript(CFX_WideTextBuf& javascript,
javascript << tempExp1;
javascript << L"))\n{\n";
- if (type == ReturnType::kImplied) {
- javascript << RUNTIMEFUNCTIONRETURNVALUE;
- javascript << L" = ";
- }
+ if (type == ReturnType::kImplied)
+ javascript << L"pfm_ret = ";
javascript << gs_lpStrExpFuncName[ASSIGN];
javascript << L"(";
@@ -279,10 +276,8 @@ bool CXFA_FMAssignExpression::ToJavaScript(CFX_WideTextBuf& javascript,
if (m_pExp1->GetOperatorToken() == TOKidentifier &&
tempExp1.AsStringView() != L"this") {
javascript << L"else\n{\n";
- if (type == ReturnType::kImplied) {
- javascript << RUNTIMEFUNCTIONRETURNVALUE;
- javascript << L" = ";
- }
+ if (type == ReturnType::kImplied)
+ javascript << L"pfm_ret = ";
javascript << tempExp1;
javascript << L" = ";