Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / fpdfsdk / src / jsapi / fxjs_v8.cpp
index c03c84b..3ab27e2 100644 (file)
@@ -33,7 +33,7 @@ class CJS_PrivateData
 public:
        CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {}
        int ObjDefID;
-       FX_LPVOID       pPrivate;
+       void*   pPrivate;
 };
 
 
@@ -105,7 +105,7 @@ int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s
        if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0;
        CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
        v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
-       objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly);
+       objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly);
        pObjDef->m_objTemplate.Reset(isolate,objTemp);
        return 0;
 }
@@ -125,7 +125,7 @@ int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t*
        if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0;
        CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
        v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
-       objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsPropertyName), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut);
+       objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, bsPropertyName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut);
        pObjDef->m_objTemplate.Reset(isolate,objTemp);
        return 0;
 }
@@ -162,7 +162,7 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC
        if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0;
        CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
        v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
-       objTemp->Set(isolate, FX_LPCSTR(bsConstName), pDefault);
+       objTemp->Set(isolate, bsConstName.c_str(), pDefault);
        pObjDef->m_objTemplate.Reset(isolate,objTemp);
        return 0;
 }
@@ -202,7 +202,7 @@ int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v
                objTemp = v8::ObjectTemplate::New(isolate);
        else
                objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp);
-       objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly);
+       objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly);
 
        globalObjTemp.Reset(isolate,objTemp);
 
@@ -225,7 +225,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8:
                objTemp = v8::ObjectTemplate::New(isolate);
        else
                objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp);
-       objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly);
+       objTemp->Set(v8::String::NewFromUtf8(isolate, bsConst.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly);
 
        globalObjTemp.Reset(isolate,objTemp);
 
@@ -473,12 +473,12 @@ void JS_Error(v8::Isolate* isolate, const CFX_WideString& message)
 
 unsigned JS_CalcHash(const wchar_t* main, unsigned nLen)
 {
-       return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, nLen);
+       return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, nLen);
 }
 
 unsigned JS_CalcHash(const wchar_t* main)
 {
-       return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, FXSYS_wcslen(main));
+       return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, FXSYS_wcslen(main));
 }
 const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj)
 {