OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa_fm2js.h" | 7 #include "xfa_fm2js.h" |
8 static CFX_WideStringC gs_lpStrExpFuncName[] = { | 8 static CFX_WideStringC gs_lpStrExpFuncName[] = { |
9 FX_WSTRC(L"foxit_xfa_formcalc_runtime.assign_value_operator"), | 9 FX_WSTRC(L"foxit_xfa_formcalc_runtime.assign_value_operator"), |
10 FX_WSTRC(L"foxit_xfa_formcalc_runtime.logical_or_operator"), | 10 FX_WSTRC(L"foxit_xfa_formcalc_runtime.logical_or_operator"), |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } else if (tempStr.Equal(FX_WSTRC(L"$host"))) { | 160 } else if (tempStr.Equal(FX_WSTRC(L"$host"))) { |
161 tempStr = FX_WSTRC(L"xfa.host"); | 161 tempStr = FX_WSTRC(L"xfa.host"); |
162 } else if (tempStr.Equal(FX_WSTRC(L"$layout"))) { | 162 } else if (tempStr.Equal(FX_WSTRC(L"$layout"))) { |
163 tempStr = FX_WSTRC(L"xfa.layout"); | 163 tempStr = FX_WSTRC(L"xfa.layout"); |
164 } else if (tempStr.Equal(FX_WSTRC(L"$template"))) { | 164 } else if (tempStr.Equal(FX_WSTRC(L"$template"))) { |
165 tempStr = FX_WSTRC(L"xfa.template"); | 165 tempStr = FX_WSTRC(L"xfa.template"); |
166 } else if (tempStr[0] == L'!') { | 166 } else if (tempStr[0] == L'!') { |
167 tempStr = EXCLAMATION_IN_IDENTIFIER + tempStr.Mid(1); | 167 tempStr = EXCLAMATION_IN_IDENTIFIER + tempStr.Mid(1); |
168 } | 168 } |
169 javascript << tempStr; | 169 javascript << tempStr; |
170 return; | |
171 } | 170 } |
| 171 |
172 CXFA_FMUnaryExpression::CXFA_FMUnaryExpression(FX_DWORD line, | 172 CXFA_FMUnaryExpression::CXFA_FMUnaryExpression(FX_DWORD line, |
173 XFA_FM_TOKEN op, | 173 XFA_FM_TOKEN op, |
174 CXFA_FMSimpleExpression* pExp) | 174 CXFA_FMSimpleExpression* pExp) |
175 : CXFA_FMSimpleExpression(line, op), m_pExp(pExp) {} | 175 : CXFA_FMSimpleExpression(line, op), m_pExp(pExp) {} |
176 CXFA_FMUnaryExpression::~CXFA_FMUnaryExpression() { | 176 CXFA_FMUnaryExpression::~CXFA_FMUnaryExpression() { |
177 if (m_pExp != 0) { | 177 if (m_pExp != 0) { |
178 delete m_pExp; | 178 delete m_pExp; |
179 m_pExp = 0; | 179 m_pExp = 0; |
180 } | 180 } |
181 } | 181 } |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); | 702 L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); |
703 javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); | 703 javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); |
704 m_pExp2->ToJavaScript(javascript); | 704 m_pExp2->ToJavaScript(javascript); |
705 javascript << FX_WSTRC(L";\n}\n}\n"); | 705 javascript << FX_WSTRC(L";\n}\n}\n"); |
706 javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); | 706 javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); |
707 m_pExp2->ToJavaScript(javascript); | 707 m_pExp2->ToJavaScript(javascript); |
708 javascript << FX_WSTRC(L";\n}\n"); | 708 javascript << FX_WSTRC(L";\n}\n"); |
709 javascript << FX_WSTRC(L"return method_return_value;\n"); | 709 javascript << FX_WSTRC(L"return method_return_value;\n"); |
710 javascript << FX_WSTRC(L"}\n).call(this)"); | 710 javascript << FX_WSTRC(L"}\n).call(this)"); |
711 } | 711 } |
OLD | NEW |