Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: fpdfsdk/src/javascript/app.cpp

Issue 1292653002: Merge to XFA: Remove if checks after new. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@xfa
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fxedit/fxet_list.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Wnd.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 pValue = JS_GetObjectElement(isolate, pObj, L"nIcon"); 297 pValue = JS_GetObjectElement(isolate, pObj, L"nIcon");
298 iIcon = CJS_Value(isolate, pValue, VT_unknown).ToInt(); 298 iIcon = CJS_Value(isolate, pValue, VT_unknown).ToInt();
299 299
300 pValue = JS_GetObjectElement(isolate, pObj, L"nType"); 300 pValue = JS_GetObjectElement(isolate, pObj, L"nType");
301 iType = CJS_Value(isolate, pValue, VT_unknown).ToInt(); 301 iType = CJS_Value(isolate, pValue, VT_unknown).ToInt();
302 } 302 }
303 303
304 if (swMsg == L"") { 304 if (swMsg == L"") {
305 CJS_Array carray(isolate); 305 CJS_Array carray(isolate);
306 if (params[0].ConvertToArray(carray)) { 306 if (params[0].ConvertToArray(carray)) {
307 int iLenth = carray.GetLength(); 307 int iLength = carray.GetLength();
308 CJS_Value* pValue = new CJS_Value(isolate); 308 CJS_Value* pValue = new CJS_Value(isolate);
309 //» » » » » if (iLenth == 1) 309 for (int i = 0; i < iLength; ++i) {
310 //» » » » » » pValue = new
311 // CJS_Value(isolate);
312 //» » » » » else if (iLenth > 1)
313 //» » » » » » pValue = new
314 // CJS_Value[iLenth];
315
316 for (int i = 0; i < iLenth; i++) {
317 carray.GetElement(i, *pValue); 310 carray.GetElement(i, *pValue);
318 swMsg += (*pValue).ToCFXWideString(); 311 swMsg += (*pValue).ToCFXWideString();
319 if (i < iLenth - 1) 312 if (i < iLength - 1)
320 swMsg += L", "; 313 swMsg += L", ";
321 } 314 }
322 315
323 delete pValue; 316 delete pValue;
324 } 317 }
325 } 318 }
326 319
327 if (swTitle == L"") 320 if (swTitle == L"")
328 swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT); 321 swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
329 } else if (params[0].GetType() == VT_boolean) { 322 } else if (params[0].GetType() == VT_boolean) {
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 CFX_WideString& sError) { 868 CFX_WideString& sError) {
876 return FALSE; 869 return FALSE;
877 } 870 }
878 871
879 FX_BOOL app::execDialog(IFXJS_Context* cc, 872 FX_BOOL app::execDialog(IFXJS_Context* cc,
880 const CJS_Parameters& params, 873 const CJS_Parameters& params,
881 CJS_Value& vRet, 874 CJS_Value& vRet,
882 CFX_WideString& sError) { 875 CFX_WideString& sError) {
883 return TRUE; 876 return TRUE;
884 } 877 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fxedit/fxet_list.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Wnd.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698