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

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

Issue 1332973002: Remove some abstractions in fxjs_v8.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove implicit cast operator from CJS_Runtime. Created 5 years, 3 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/Document.cpp ('k') | fpdfsdk/src/javascript/JS_Context.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 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); 3308 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
3309 if (!pFormControl) 3309 if (!pFormControl)
3310 return FALSE; 3310 return FALSE;
3311 3311
3312 CJS_Context* pContext = (CJS_Context*)cc; 3312 CJS_Context* pContext = (CJS_Context*)cc;
3313 ASSERT(pContext != NULL); 3313 ASSERT(pContext != NULL);
3314 3314
3315 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); 3315 CJS_Runtime* pRuntime = pContext->GetJSRuntime();
3316 ASSERT(pRuntime != NULL); 3316 ASSERT(pRuntime != NULL);
3317 3317
3318 JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, 3318 v8::Local<v8::Object> pObj =
3319 JS_GetObjDefnID(*pRuntime, L"Icon")); 3319 JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
3320 JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon"));
3320 ASSERT(pObj.IsEmpty() == FALSE); 3321 ASSERT(pObj.IsEmpty() == FALSE);
3321 3322
3322 CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj); 3323 CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
3323 ASSERT(pJS_Icon != NULL); 3324 ASSERT(pJS_Icon != NULL);
3324 3325
3325 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); 3326 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
3326 ASSERT(pIcon != NULL); 3327 ASSERT(pIcon != NULL);
3327 3328
3328 CPDF_Stream* pIconStream = NULL; 3329 CPDF_Stream* pIconStream = NULL;
3329 if (nface == 0) 3330 if (nface == 0)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3523 3524
3524 CJS_Context* pContext = (CJS_Context*)cc; 3525 CJS_Context* pContext = (CJS_Context*)cc;
3525 ASSERT(pContext != NULL); 3526 ASSERT(pContext != NULL);
3526 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); 3527 CJS_Runtime* pRuntime = pContext->GetJSRuntime();
3527 ASSERT(pRuntime != NULL); 3528 ASSERT(pRuntime != NULL);
3528 3529
3529 CJS_Array FormFieldArray(m_isolate); 3530 CJS_Array FormFieldArray(m_isolate);
3530 for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) { 3531 for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) {
3531 CFX_WideString* pStr = swSort.GetAt(j); 3532 CFX_WideString* pStr = swSort.GetAt(j);
3532 3533
3533 JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, 3534 v8::Local<v8::Object> pObj =
3534 JS_GetObjDefnID(*pRuntime, L"Field")); 3535 JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
3536 JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
3535 ASSERT(pObj.IsEmpty() == FALSE); 3537 ASSERT(pObj.IsEmpty() == FALSE);
3536 3538
3537 CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj); 3539 CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
3538 ASSERT(pJSField != NULL); 3540 ASSERT(pJSField != NULL);
3539 3541
3540 Field* pField = (Field*)pJSField->GetEmbedObject(); 3542 Field* pField = (Field*)pJSField->GetEmbedObject();
3541 ASSERT(pField != NULL); 3543 ASSERT(pField != NULL);
3542 3544
3543 pField->AttachField(m_pJSDoc, *pStr); 3545 pField->AttachField(m_pJSDoc, *pStr);
3544 3546
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
4055 #define JS_FIELD_MINWIDTH 1 4057 #define JS_FIELD_MINWIDTH 1
4056 #define JS_FIELD_MINHEIGHT 1 4058 #define JS_FIELD_MINHEIGHT 1
4057 4059
4058 void Field::AddField(CPDFSDK_Document* pDocument, 4060 void Field::AddField(CPDFSDK_Document* pDocument,
4059 int nPageIndex, 4061 int nPageIndex,
4060 int nFieldType, 4062 int nFieldType,
4061 const CFX_WideString& sName, 4063 const CFX_WideString& sName,
4062 const CPDF_Rect& rcCoords) { 4064 const CPDF_Rect& rcCoords) {
4063 // Not supported. 4065 // Not supported.
4064 } 4066 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Document.cpp ('k') | fpdfsdk/src/javascript/JS_Context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698