summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/global.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-23 11:31:31 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-23 11:31:31 -0700
commitf4ef3f92eb89a460a0715df758122ba662aadc39 (patch)
tree7b3d3533929299c587bb2ab52382430ea34960e6 /fpdfsdk/src/javascript/global.cpp
parentf99882e726d4a78e1b8fecad8b478276fbdf9c86 (diff)
downloadpdfium-f4ef3f92eb89a460a0715df758122ba662aadc39.tar.xz
Merge to XFA: Kill overloaded cast operators in CJS_Value.
Original Review URL: https://codereview.chromium.org/1096813008 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1106663002
Diffstat (limited to 'fpdfsdk/src/javascript/global.cpp')
-rw-r--r--fpdfsdk/src/javascript/global.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 1a59e257be..b778239b5d 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -175,7 +175,7 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS
{
bool bData;
vp >> bData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_string:
{
@@ -185,20 +185,9 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS
}
case VT_object:
{
- JSObject pData = (JSObject)vp;
+ JSObject pData;
+ vp >> pData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
-// else
-// {
-// if (vp.IsArrayObject())
-// {
-// CJS_Array array;
-// vp.ConvertToArray(array);
-// return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
-// (Dobject*)(Darray*)array, FALSE);
-// }
-// else
-// return FALSE;
-// }
}
case VT_null:
{
@@ -279,14 +268,14 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters&
return FALSE;
}
- CFX_ByteString sName = params[0];
+ CFX_ByteString sName = params[0].ToCFXByteString();
js_global_data* pData = NULL;
if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData))
{
if (pData && !pData->bDeleted)
{
- pData->bPersistent = (bool)params[1];
+ pData->bPersistent = params[1].ToBool();
return TRUE;
}
}
@@ -435,7 +424,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari
break;
case VT_string:
{
- CFX_ByteString sValue = CJS_Value(isolate, v, VT_string);
+ CFX_ByteString sValue = CJS_Value(isolate, v, VT_string).ToCFXByteString();
CJS_KeyValue* pObjElement = new CJS_KeyValue;
pObjElement->nType = JS_GLOBALDATA_TYPE_STRING;
pObjElement->sKey = sKey;