summaryrefslogtreecommitdiff
path: root/fxjs/cjs_eventhandler.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-05 22:27:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-05 22:27:22 +0000
commitf743552fbdb17f974c9b1675af81210fe0ffcc50 (patch)
treed0eccefff3c758151428e18eb803e93d8864046a /fxjs/cjs_eventhandler.cpp
parent998fee395fc8a543968c7db3db9e3cf81dee57fc (diff)
downloadpdfium-f743552fbdb17f974c9b1675af81210fe0ffcc50.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_eventhandler.cpp')
-rw-r--r--fxjs/cjs_eventhandler.cpp28
1 files changed, 12 insertions, 16 deletions
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<v8::Object> pDocObj =
pRuntime->NewFxDynamicObj(CJS_Document::GetObjDefnID());
@@ -604,17 +604,15 @@ Field* CJS_EventHandler::Source() {
CJS_Field* pJSField =
static_cast<CJS_Field*>(pRuntime->GetObjectPrivate(pFieldObj));
- Document* pDocument = static_cast<Document*>(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<Field*>(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<v8::Object> pDocObj =
pRuntime->NewFxDynamicObj(CJS_Document::GetObjDefnID());
@@ -631,14 +629,12 @@ Field* CJS_EventHandler::Target_Field() {
CJS_Field* pJSField =
static_cast<CJS_Field*>(pRuntime->GetObjectPrivate(pFieldObj));
- Document* pDocument = static_cast<Document*>(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<Field*>(pJSField->GetEmbedObject());
- pField->AttachField(pDocument, m_strTargetName);
- return pField;
+ pJSField->AttachField(pJSDocument, m_strTargetName);
+ return pJSField;
}
WideString& CJS_EventHandler::Value() {