diff options
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jsapi.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/xfa_fm2jscontext.h | 5 |
3 files changed, 5 insertions, 12 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp index 147869dfb1..2c02c347f3 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp @@ -39,7 +39,7 @@ int32_t XFA_FM2JS_Translate(const CFX_WideStringC& wsFormcalc, return 0; } XFA_HFM2JSCONTEXT XFA_FM2JS_ContextCreate() { - return (XFA_HFM2JSCONTEXT)CXFA_FM2JSContext::Create(); + return reinterpret_cast<XFA_HFM2JSCONTEXT>(new CXFA_FM2JSContext); } void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext, FXJSE_HRUNTIME hScriptRuntime, @@ -56,9 +56,7 @@ void XFA_FM2JS_GlobalPropertyGetter(XFA_HFM2JSCONTEXT hFM2JSContext, pContext->GlobalPropertyGetter(hValue); } void XFA_FM2JS_ContextRelease(XFA_HFM2JSCONTEXT hFM2JSContext) { - CXFA_FM2JSContext* pContext = - reinterpret_cast<CXFA_FM2JSContext*>(hFM2JSContext); - pContext->Release(); + delete reinterpret_cast<CXFA_FM2JSContext*>(hFM2JSContext); } #ifdef __cplusplus } diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index 3a1925c0ab..96ebbfa1e9 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -7179,9 +7179,6 @@ CXFA_FM2JSContext::~CXFA_FM2JSContext() { } m_hScriptRuntime = NULL; } -CXFA_FM2JSContext* CXFA_FM2JSContext::Create() { - return new CXFA_FM2JSContext; -} void CXFA_FM2JSContext::Initialize(FXJSE_HRUNTIME hScriptRuntime, FXJSE_HCONTEXT hScriptContext, CXFA_Document* pDoc) { @@ -7202,9 +7199,6 @@ void CXFA_FM2JSContext::Initialize(FXJSE_HRUNTIME hScriptRuntime, void CXFA_FM2JSContext::GlobalPropertyGetter(FXJSE_HVALUE hValue) { FXJSE_Value_Set(hValue, m_hValue); } -void CXFA_FM2JSContext::Release() { - delete this; -} void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); ASSERT(pAppProvider); diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h index b35d135912..287340345e 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h @@ -431,14 +431,15 @@ class CXFA_FM2JSContext { static FX_DOUBLE HValueToDouble(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); static void HValueToUTF8String(FXJSE_HVALUE hValue, CFX_ByteString& outputValue); + CXFA_FM2JSContext(); ~CXFA_FM2JSContext(); - static CXFA_FM2JSContext* Create(); + void Initialize(FXJSE_HRUNTIME hScriptRuntime, FXJSE_HCONTEXT hScriptContext, CXFA_Document* pDoc); void GlobalPropertyGetter(FXJSE_HVALUE hValue); - void Release(); + FXJSE_HRUNTIME GetScriptRuntime() const { return m_hScriptRuntime; } CXFA_Document* GetDocument() const { return m_pDocument; } void ThrowScriptErrorMessage(int32_t iStringID, ...); |