More master side changes for convergence with XFA.
[pdfium.git] / fpdfsdk / src / javascript / JS_EventHandler.cpp
index 64a6168..cb86fde 100644 (file)
@@ -4,15 +4,16 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "JS_EventHandler.h"
+
 #include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/Field.h"
+#include "Document.h"
+#include "Field.h"
+#include "JS_Context.h"
+#include "JS_Define.h"
+#include "JS_Object.h"
+#include "JS_Runtime.h"
+#include "JS_Value.h"
 
 /* ---------------------------- CJS_EventHandler ---------------------------- */
 
@@ -612,13 +613,12 @@ FX_BOOL CJS_EventHandler::Shift() {
 Field* CJS_EventHandler::Source() {
   CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
   v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
-      pRuntime->GetIsolate(), m_pJSContext,
-      FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
-  ASSERT(pDocObj.IsEmpty() == FALSE);
-  v8::Local<v8::Object> pFieldObj =
-      FXJS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
-                           FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
-  ASSERT(pFieldObj.IsEmpty() == FALSE);
+      pRuntime->GetIsolate(), pRuntime, CJS_Document::g_nObjDefnID);
+  ASSERT(!pDocObj.IsEmpty());
+
+  v8::Local<v8::Object> pFieldObj = FXJS_NewFxDynamicObj(
+      pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
+  ASSERT(!pFieldObj.IsEmpty());
 
   CJS_Document* pJSDocument =
       (CJS_Document*)FXJS_GetPrivate(pRuntime->GetIsolate(), pDocObj);
@@ -636,13 +636,12 @@ Field* CJS_EventHandler::Source() {
 Field* CJS_EventHandler::Target_Field() {
   CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
   v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
-      pRuntime->GetIsolate(), m_pJSContext,
-      FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
-  ASSERT(pDocObj.IsEmpty() == FALSE);
-  v8::Local<v8::Object> pFieldObj =
-      FXJS_NewFxDynamicObj(pRuntime->GetIsolate(), m_pJSContext,
-                           FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Field"));
-  ASSERT(pFieldObj.IsEmpty() == FALSE);
+      pRuntime->GetIsolate(), pRuntime, CJS_Document::g_nObjDefnID);
+  ASSERT(!pDocObj.IsEmpty());
+
+  v8::Local<v8::Object> pFieldObj = FXJS_NewFxDynamicObj(
+      pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
+  ASSERT(!pFieldObj.IsEmpty());
 
   CJS_Document* pJSDocument =
       (CJS_Document*)FXJS_GetPrivate(pRuntime->GetIsolate(), pDocObj);