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/fxfa/fm2js/xfa_simpleexpression.h" | 7 #include "xfa/fxfa/fm2js/xfa_simpleexpression.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 | 10 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } break; | 168 } break; |
169 default: { javascript.AppendChar(oneChar); } break; | 169 default: { javascript.AppendChar(oneChar); } break; |
170 } | 170 } |
171 } | 171 } |
172 javascript.AppendChar(L'\"'); | 172 javascript.AppendChar(L'\"'); |
173 } else { | 173 } else { |
174 javascript << tempStr; | 174 javascript << tempStr; |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 CXFA_FMIdentifierExpressionn::CXFA_FMIdentifierExpressionn( | 178 CXFA_FMIdentifierExpression::CXFA_FMIdentifierExpression( |
179 uint32_t line, | 179 uint32_t line, |
180 CFX_WideStringC wsIdentifier) | 180 CFX_WideStringC wsIdentifier) |
181 : CXFA_FMSimpleExpression(line, TOKidentifier), | 181 : CXFA_FMSimpleExpression(line, TOKidentifier), |
182 m_wsIdentifier(wsIdentifier) {} | 182 m_wsIdentifier(wsIdentifier) {} |
183 | 183 |
184 CXFA_FMIdentifierExpressionn::~CXFA_FMIdentifierExpressionn() {} | 184 CXFA_FMIdentifierExpression::~CXFA_FMIdentifierExpression() {} |
185 | 185 |
186 void CXFA_FMIdentifierExpressionn::ToJavaScript(CFX_WideTextBuf& javascript) { | 186 void CXFA_FMIdentifierExpression::ToJavaScript(CFX_WideTextBuf& javascript) { |
187 CFX_WideString tempStr(m_wsIdentifier); | 187 CFX_WideString tempStr(m_wsIdentifier); |
188 if (tempStr == FX_WSTRC(L"$")) { | 188 if (tempStr == FX_WSTRC(L"$")) { |
189 tempStr = FX_WSTRC(L"this"); | 189 tempStr = FX_WSTRC(L"this"); |
190 } else if (tempStr == FX_WSTRC(L"!")) { | 190 } else if (tempStr == FX_WSTRC(L"!")) { |
191 tempStr = FX_WSTRC(L"xfa.datasets"); | 191 tempStr = FX_WSTRC(L"xfa.datasets"); |
192 } else if (tempStr == FX_WSTRC(L"$data")) { | 192 } else if (tempStr == FX_WSTRC(L"$data")) { |
193 tempStr = FX_WSTRC(L"xfa.datasets.data"); | 193 tempStr = FX_WSTRC(L"xfa.datasets.data"); |
194 } else if (tempStr == FX_WSTRC(L"$event")) { | 194 } else if (tempStr == FX_WSTRC(L"$event")) { |
195 tempStr = FX_WSTRC(L"xfa.event"); | 195 tempStr = FX_WSTRC(L"xfa.event"); |
196 } else if (tempStr == FX_WSTRC(L"$form")) { | 196 } else if (tempStr == FX_WSTRC(L"$form")) { |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); | 746 L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); |
747 javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); | 747 javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); |
748 m_pExp2->ToJavaScript(javascript); | 748 m_pExp2->ToJavaScript(javascript); |
749 javascript << FX_WSTRC(L";\n}\n}\n"); | 749 javascript << FX_WSTRC(L";\n}\n}\n"); |
750 javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); | 750 javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); |
751 m_pExp2->ToJavaScript(javascript); | 751 m_pExp2->ToJavaScript(javascript); |
752 javascript << FX_WSTRC(L";\n}\n"); | 752 javascript << FX_WSTRC(L";\n}\n"); |
753 javascript << FX_WSTRC(L"return method_return_value;\n"); | 753 javascript << FX_WSTRC(L"return method_return_value;\n"); |
754 javascript << FX_WSTRC(L"}\n).call(this)"); | 754 javascript << FX_WSTRC(L"}\n).call(this)"); |
755 } | 755 } |
OLD | NEW |