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

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

Issue 811593007: XFA: merge patch from CL 733693003, getting rid of more casts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 12 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/javascript/app.cpp ('k') | no next file » | 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 v8::Local<v8::Context> context = pObj->CreationContext(); 345 v8::Local<v8::Context> context = pObj->CreationContext();
346 v8::Isolate* isolate = context->GetIsolate(); 346 v8::Isolate* isolate = context->GetIsolate();
347 347
348 for (int i=0; i<nObjElements; i++) 348 for (int i=0; i<nObjElements; i++)
349 { 349 {
350 350
351 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i)) ; 351 CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i)) ;
352 CFX_ByteString sKey = ws.UTF8Encode(); 352 CFX_ByteString sKey = ws.UTF8Encode();
353 353
354 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, (FX _LPCWSTR)ws); 354 » » v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws. c_str());
355 FXJSVALUETYPE vt = GET_VALUE_TYPE(v); 355 FXJSVALUETYPE vt = GET_VALUE_TYPE(v);
356 switch (vt) 356 switch (vt)
357 { 357 {
358 case VT_number: 358 case VT_number:
359 { 359 {
360 CJS_KeyValue* pObjElement = new CJS_KeyValue; 360 CJS_KeyValue* pObjElement = new CJS_KeyValue;
361 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; 361 pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER;
362 pObjElement->sKey = sKey; 362 pObjElement->sKey = sKey;
363 pObjElement->dData = JS_ToNumber(v); 363 pObjElement->dData = JS_ToNumber(v);
364 array.Add(pObjElement); 364 array.Add(pObjElement);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } 551 }
552 break; 552 break;
553 default: 553 default:
554 return FALSE; 554 return FALSE;
555 } 555 }
556 556
557 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); 557 m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData);
558 558
559 return TRUE; 559 return TRUE;
560 } 560 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/app.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698