summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Field.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
commit506df426d5d64d68e9dc27ffebcf56f6c6a1bccf (patch)
tree3ba8d38a3bef95c0555549953bce0cce90845cdb /fpdfsdk/src/javascript/Field.cpp
parent615d7aba0f7d53a78eb05fbd4ae0e1a7e1d3b103 (diff)
downloadpdfium-506df426d5d64d68e9dc27ffebcf56f6c6a1bccf.tar.xz
Ensure functions in FXJS_V8 are prefixed by FXJS_.
Currently, its hard to tell which functions come from the JS_ layer at fpdfsdk/include/javascript vs. which functions come from the FXJS_V8 layer at fpdfsdk/include/jsapi. Until we take up the task of using namespaces, at least make the prefix consistent. Move objects out of FXJS_V8 that are really part of JS_. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1347833002 .
Diffstat (limited to 'fpdfsdk/src/javascript/Field.cpp')
-rw-r--r--fpdfsdk/src/javascript/Field.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index a0570cb56c..66a9601cbf 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -1038,7 +1038,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc,
CFX_DWordArray array;
- if (vp.GetType() == VT_number) {
+ if (vp.GetType() == CJS_Value::VT_number) {
int iSelecting = 0;
vp >> iSelecting;
array.Add(iSelecting);
@@ -3316,15 +3316,12 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc,
ASSERT(pRuntime != NULL);
v8::Local<v8::Object> pObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon"));
+ FXJS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon"));
ASSERT(pObj.IsEmpty() == FALSE);
- CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
- ASSERT(pJS_Icon != NULL);
-
+ CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj);
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- ASSERT(pIcon != NULL);
CPDF_Stream* pIconStream = NULL;
if (nface == 0)
@@ -3531,17 +3528,13 @@ FX_BOOL Field::getArray(IFXJS_Context* cc,
for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) {
CFX_WideString* pStr = swSort.GetAt(j);
- v8::Local<v8::Object> pObj =
- JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
- JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
+ v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
+ pRuntime->GetIsolate(), pContext,
+ FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
ASSERT(pObj.IsEmpty() == FALSE);
- CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
- ASSERT(pJSField != NULL);
-
+ CJS_Field* pJSField = (CJS_Field*)FXJS_GetPrivate(pObj);
Field* pField = (Field*)pJSField->GetEmbedObject();
- ASSERT(pField != NULL);
-
pField->AttachField(m_pJSDoc, *pStr);
CJS_Value FormFieldValue(m_isolate);