From f743552fbdb17f974c9b1675af81210fe0ffcc50 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 22:27:22 +0000 Subject: Fold CJS_EmbedObj classes into CJS_Object classes This CL removes the CJS_EmbedObj class and various subclasses and folds the subclasses into their CJS_Object counterparts. Change-Id: If6b882a4995c0b1bf83ac783f5c27ba9216c2d5c Reviewed-on: https://pdfium-review.googlesource.com/25410 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fxjs/cjs_eventhandler.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'fxjs/cjs_eventhandler.cpp') diff --git a/fxjs/cjs_eventhandler.cpp b/fxjs/cjs_eventhandler.cpp index eb150b247b..6e7e840250 100644 --- a/fxjs/cjs_eventhandler.cpp +++ b/fxjs/cjs_eventhandler.cpp @@ -587,7 +587,7 @@ bool CJS_EventHandler::Shift() const { return m_bShift; } -Field* CJS_EventHandler::Source() { +CJS_Field* CJS_EventHandler::Source() { CJS_Runtime* pRuntime = m_pJSEventContext->GetJSRuntime(); v8::Local pDocObj = pRuntime->NewFxDynamicObj(CJS_Document::GetObjDefnID()); @@ -604,17 +604,15 @@ Field* CJS_EventHandler::Source() { CJS_Field* pJSField = static_cast(pRuntime->GetObjectPrivate(pFieldObj)); - Document* pDocument = static_cast(pJSDocument->GetEmbedObject()); - pDocument->SetFormFillEnv(m_pTargetFormFillEnv - ? m_pTargetFormFillEnv.Get() - : m_pJSEventContext->GetFormFillEnv()); + pJSDocument->SetFormFillEnv(m_pTargetFormFillEnv + ? m_pTargetFormFillEnv.Get() + : m_pJSEventContext->GetFormFillEnv()); - Field* pField = static_cast(pJSField->GetEmbedObject()); - pField->AttachField(pDocument, m_strSourceName); - return pField; + pJSField->AttachField(pJSDocument, m_strSourceName); + return pJSField; } -Field* CJS_EventHandler::Target_Field() { +CJS_Field* CJS_EventHandler::Target_Field() { CJS_Runtime* pRuntime = m_pJSEventContext->GetJSRuntime(); v8::Local pDocObj = pRuntime->NewFxDynamicObj(CJS_Document::GetObjDefnID()); @@ -631,14 +629,12 @@ Field* CJS_EventHandler::Target_Field() { CJS_Field* pJSField = static_cast(pRuntime->GetObjectPrivate(pFieldObj)); - Document* pDocument = static_cast(pJSDocument->GetEmbedObject()); - pDocument->SetFormFillEnv(m_pTargetFormFillEnv - ? m_pTargetFormFillEnv.Get() - : m_pJSEventContext->GetFormFillEnv()); + pJSDocument->SetFormFillEnv(m_pTargetFormFillEnv + ? m_pTargetFormFillEnv.Get() + : m_pJSEventContext->GetFormFillEnv()); - Field* pField = static_cast(pJSField->GetEmbedObject()); - pField->AttachField(pDocument, m_strTargetName); - return pField; + pJSField->AttachField(pJSDocument, m_strTargetName); + return pJSField; } WideString& CJS_EventHandler::Value() { -- cgit v1.2.3