| 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  | 
|   11 namespace { |   11 namespace { | 
|   12  |   12  | 
|   13 const CFX_WideStringC gs_lpStrExpFuncName[] = { |   13 const FX_WCHAR* const gs_lpStrExpFuncName[] = { | 
|   14     FX_WSTRC(L"foxit_xfa_formcalc_runtime.assign_value_operator"), |   14     L"foxit_xfa_formcalc_runtime.assign_value_operator", | 
|   15     FX_WSTRC(L"foxit_xfa_formcalc_runtime.logical_or_operator"), |   15     L"foxit_xfa_formcalc_runtime.logical_or_operator", | 
|   16     FX_WSTRC(L"foxit_xfa_formcalc_runtime.logical_and_operator"), |   16     L"foxit_xfa_formcalc_runtime.logical_and_operator", | 
|   17     FX_WSTRC(L"foxit_xfa_formcalc_runtime.equality_operator"), |   17     L"foxit_xfa_formcalc_runtime.equality_operator", | 
|   18     FX_WSTRC(L"foxit_xfa_formcalc_runtime.notequality_operator"), |   18     L"foxit_xfa_formcalc_runtime.notequality_operator", | 
|   19     FX_WSTRC(L"foxit_xfa_formcalc_runtime.less_operator"), |   19     L"foxit_xfa_formcalc_runtime.less_operator", | 
|   20     FX_WSTRC(L"foxit_xfa_formcalc_runtime.lessequal_operator"), |   20     L"foxit_xfa_formcalc_runtime.lessequal_operator", | 
|   21     FX_WSTRC(L"foxit_xfa_formcalc_runtime.greater_operator"), |   21     L"foxit_xfa_formcalc_runtime.greater_operator", | 
|   22     FX_WSTRC(L"foxit_xfa_formcalc_runtime.greaterequal_operator"), |   22     L"foxit_xfa_formcalc_runtime.greaterequal_operator", | 
|   23     FX_WSTRC(L"foxit_xfa_formcalc_runtime.plus_operator"), |   23     L"foxit_xfa_formcalc_runtime.plus_operator", | 
|   24     FX_WSTRC(L"foxit_xfa_formcalc_runtime.minus_operator"), |   24     L"foxit_xfa_formcalc_runtime.minus_operator", | 
|   25     FX_WSTRC(L"foxit_xfa_formcalc_runtime.multiple_operator"), |   25     L"foxit_xfa_formcalc_runtime.multiple_operator", | 
|   26     FX_WSTRC(L"foxit_xfa_formcalc_runtime.divide_operator"), |   26     L"foxit_xfa_formcalc_runtime.divide_operator", | 
|   27     FX_WSTRC(L"foxit_xfa_formcalc_runtime.positive_operator"), |   27     L"foxit_xfa_formcalc_runtime.positive_operator", | 
|   28     FX_WSTRC(L"foxit_xfa_formcalc_runtime.negative_operator"), |   28     L"foxit_xfa_formcalc_runtime.negative_operator", | 
|   29     FX_WSTRC(L"foxit_xfa_formcalc_runtime.logical_not_operator"), |   29     L"foxit_xfa_formcalc_runtime.logical_not_operator", | 
|   30     FX_WSTRC(L"foxit_xfa_formcalc_runtime."), |   30     L"foxit_xfa_formcalc_runtime.", | 
|   31     FX_WSTRC(L"foxit_xfa_formcalc_runtime.dot_accessor"), |   31     L"foxit_xfa_formcalc_runtime.dot_accessor", | 
|   32     FX_WSTRC(L"foxit_xfa_formcalc_runtime.dotdot_accessor"), |   32     L"foxit_xfa_formcalc_runtime.dotdot_accessor", | 
|   33     FX_WSTRC(L"foxit_xfa_formcalc_runtime.concat_fm_object"), |   33     L"foxit_xfa_formcalc_runtime.concat_fm_object", | 
|   34     FX_WSTRC(L"foxit_xfa_formcalc_runtime.is_fm_object"), |   34     L"foxit_xfa_formcalc_runtime.is_fm_object", | 
|   35     FX_WSTRC(L"foxit_xfa_formcalc_runtime.is_fm_array"), |   35     L"foxit_xfa_formcalc_runtime.is_fm_array", | 
|   36     FX_WSTRC(L"foxit_xfa_formcalc_runtime.get_fm_value"), |   36     L"foxit_xfa_formcalc_runtime.get_fm_value", | 
|   37     FX_WSTRC(L"foxit_xfa_formcalc_runtime.get_fm_jsobj"), |   37     L"foxit_xfa_formcalc_runtime.get_fm_jsobj", | 
|   38     FX_WSTRC(L"foxit_xfa_formcalc_runtime.fm_var_filter"), |   38     L"foxit_xfa_formcalc_runtime.fm_var_filter", | 
|   39 }; |   39 }; | 
|   40  |   40  | 
|   41 struct XFA_FMBuildInFunc { |   41 struct XFA_FMBuildInFunc { | 
|   42   uint32_t m_uHash; |   42   uint32_t m_uHash; | 
|   43   const FX_WCHAR* m_buildinfunc; |   43   const FX_WCHAR* m_buildinfunc; | 
|   44 }; |   44 }; | 
 |   45  | 
|   45 const XFA_FMBuildInFunc g_BuildInFuncs[] = { |   46 const XFA_FMBuildInFunc g_BuildInFuncs[] = { | 
|   46     {0x0001f1f5, L"At"},           {0x00020b9c, L"FV"}, |   47     {0x0001f1f5, L"At"},           {0x00020b9c, L"FV"}, | 
|   47     {0x00021aef, L"If"},           {0x00023ee6, L"PV"}, |   48     {0x00021aef, L"If"},           {0x00023ee6, L"PV"}, | 
|   48     {0x04b5c9ee, L"Encode"},       {0x08e96685, L"DateFmt"}, |   49     {0x04b5c9ee, L"Encode"},       {0x08e96685, L"DateFmt"}, | 
|   49     {0x09f99db6, L"Abs"},          {0x09f9e583, L"Apr"}, |   50     {0x09f99db6, L"Abs"},          {0x09f9e583, L"Apr"}, | 
|   50     {0x09fa043e, L"Avg"},          {0x0a9782a0, L"Get"}, |   51     {0x09fa043e, L"Avg"},          {0x0a9782a0, L"Get"}, | 
|   51     {0x0b1b09df, L"Len"},          {0x0b3543a6, L"Max"}, |   52     {0x0b1b09df, L"Len"},          {0x0b3543a6, L"Max"}, | 
|   52     {0x0b356ca4, L"Min"},          {0x0b358b60, L"Mod"}, |   53     {0x0b356ca4, L"Min"},          {0x0b358b60, L"Mod"}, | 
|   53     {0x0b4fded4, L"NPV"},          {0x0b846bf1, L"Pmt"}, |   54     {0x0b4fded4, L"NPV"},          {0x0b846bf1, L"Pmt"}, | 
|   54     {0x0b8494f9, L"Put"},          {0x0bb8df5d, L"Ref"}, |   55     {0x0b8494f9, L"Put"},          {0x0bb8df5d, L"Ref"}, | 
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  736       L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); |  737       L"for(var index = accessor_object.length - 1; index > 1; index--)\n{\n"); | 
|  737   javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); |  738   javascript << FX_WSTRC(L"method_return_value = accessor_object[index]."); | 
|  738   m_pExp2->ToJavaScript(javascript); |  739   m_pExp2->ToJavaScript(javascript); | 
|  739   javascript << FX_WSTRC(L";\n}\n}\n"); |  740   javascript << FX_WSTRC(L";\n}\n}\n"); | 
|  740   javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); |  741   javascript << FX_WSTRC(L"else\n{\nmethod_return_value = accessor_object."); | 
|  741   m_pExp2->ToJavaScript(javascript); |  742   m_pExp2->ToJavaScript(javascript); | 
|  742   javascript << FX_WSTRC(L";\n}\n"); |  743   javascript << FX_WSTRC(L";\n}\n"); | 
|  743   javascript << FX_WSTRC(L"return method_return_value;\n"); |  744   javascript << FX_WSTRC(L"return method_return_value;\n"); | 
|  744   javascript << FX_WSTRC(L"}\n).call(this)"); |  745   javascript << FX_WSTRC(L"}\n).call(this)"); | 
|  745 } |  746 } | 
| OLD | NEW |