summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-20 22:05:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-20 22:05:59 +0000
commite76345ec2780ec13cc99b910ff78e0e3a1f87aec (patch)
tree485ed41f615a54491944f02a3ecfc55f2894bbfd /xfa/fxfa/fm2js/cxfa_fmexpression.cpp
parentceab166b7dafc2bb514755e4a017bf178d0c8e8b (diff)
downloadpdfium-e76345ec2780ec13cc99b910ff78e0e3a1f87aec.tar.xz
[formcalc] Treat elseif and else the same during output
This CL combines the elseif and else output code for formcalc. This causes an extra set of {}'s to be output in the else case but should be syntactically the same. Change-Id: Ie30a51efadae2034d117f4bf280b9f7abc950a23 Reviewed-on: https://pdfium-review.googlesource.com/27431 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmexpression.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmexpression.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
index 638922cfd5..481b76c868 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
@@ -263,17 +263,10 @@ bool CXFA_FMIfExpression::ToJavaScript(CFX_WideTextBuf& js, ReturnType type) {
}
if (m_pElseExpression) {
- if (m_pElseExpression->GetExpType() == XFA_FM_EXPTYPE_IF) {
- js << L"else\n{\n";
- if (!m_pElseExpression->ToJavaScript(js, type))
- return false;
-
- js << L"}\n";
- } else {
- js << L"else\n";
- if (!m_pElseExpression->ToJavaScript(js, type))
- return false;
- }
+ js << L"else\n{\n";
+ if (!m_pElseExpression->ToJavaScript(js, type))
+ return false;
+ js << L"}\n";
}
return !CXFA_IsTooBig(js);
}