| 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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../../include/javascript/JavaScript.h" | 8 #include "../../include/javascript/JavaScript.h" |
| 9 #include "../../include/javascript/IJavaScript.h" | 9 #include "../../include/javascript/IJavaScript.h" |
| 10 #include "../../include/javascript/JS_Define.h" | 10 #include "../../include/javascript/JS_Define.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 pValue = JS_GetObjectElement(isolate, pObj, L"nIcon"); | 291 pValue = JS_GetObjectElement(isolate, pObj, L"nIcon"); |
| 292 iIcon = CJS_Value(isolate, pValue, VT_unknown).ToInt(); | 292 iIcon = CJS_Value(isolate, pValue, VT_unknown).ToInt(); |
| 293 | 293 |
| 294 pValue = JS_GetObjectElement(isolate, pObj, L"nType"); | 294 pValue = JS_GetObjectElement(isolate, pObj, L"nType"); |
| 295 iType = CJS_Value(isolate, pValue, VT_unknown).ToInt(); | 295 iType = CJS_Value(isolate, pValue, VT_unknown).ToInt(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (swMsg == L"") { | 298 if (swMsg == L"") { |
| 299 CJS_Array carray(isolate); | 299 CJS_Array carray(isolate); |
| 300 if (params[0].ConvertToArray(carray)) { | 300 if (params[0].ConvertToArray(carray)) { |
| 301 int iLenth = carray.GetLength(); | 301 int iLength = carray.GetLength(); |
| 302 CJS_Value* pValue = new CJS_Value(isolate); | 302 CJS_Value* pValue = new CJS_Value(isolate); |
| 303 //» » » » » if (iLenth == 1) | 303 for (int i = 0; i < iLength; ++i) { |
| 304 //» » » » » » pValue = new | |
| 305 // CJS_Value(isolate); | |
| 306 //» » » » » else if (iLenth > 1) | |
| 307 //» » » » » » pValue = new | |
| 308 // CJS_Value[iLenth]; | |
| 309 | |
| 310 for (int i = 0; i < iLenth; i++) { | |
| 311 carray.GetElement(i, *pValue); | 304 carray.GetElement(i, *pValue); |
| 312 swMsg += (*pValue).ToCFXWideString(); | 305 swMsg += (*pValue).ToCFXWideString(); |
| 313 if (i < iLenth - 1) | 306 if (i < iLength - 1) |
| 314 swMsg += L", "; | 307 swMsg += L", "; |
| 315 } | 308 } |
| 316 | 309 |
| 317 delete pValue; | 310 delete pValue; |
| 318 } | 311 } |
| 319 } | 312 } |
| 320 | 313 |
| 321 if (swTitle == L"") | 314 if (swTitle == L"") |
| 322 swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT); | 315 swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT); |
| 323 } else if (params[0].GetType() == VT_boolean) { | 316 } else if (params[0].GetType() == VT_boolean) { |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 CFX_WideString& sError) { | 856 CFX_WideString& sError) { |
| 864 return FALSE; | 857 return FALSE; |
| 865 } | 858 } |
| 866 | 859 |
| 867 FX_BOOL app::execDialog(IFXJS_Context* cc, | 860 FX_BOOL app::execDialog(IFXJS_Context* cc, |
| 868 const CJS_Parameters& params, | 861 const CJS_Parameters& params, |
| 869 CJS_Value& vRet, | 862 CJS_Value& vRet, |
| 870 CFX_WideString& sError) { | 863 CFX_WideString& sError) { |
| 871 return TRUE; | 864 return TRUE; |
| 872 } | 865 } |
| OLD | NEW |