OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/javascript/event.h" | 7 #include "fpdfsdk/javascript/event.h" |
8 | 8 |
9 #include "fpdfsdk/javascript/Field.h" | 9 #include "fpdfsdk/javascript/Field.h" |
10 #include "fpdfsdk/javascript/JS_Define.h" | 10 #include "fpdfsdk/javascript/JS_Define.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 event::~event() {} | 49 event::~event() {} |
50 | 50 |
51 FX_BOOL event::change(IJS_Context* cc, | 51 FX_BOOL event::change(IJS_Context* cc, |
52 CJS_PropValue& vp, | 52 CJS_PropValue& vp, |
53 CFX_WideString& sError) { | 53 CFX_WideString& sError) { |
54 CJS_Context* pContext = (CJS_Context*)cc; | 54 CJS_Context* pContext = (CJS_Context*)cc; |
55 CJS_EventHandler* pEvent = pContext->GetEventHandler(); | 55 CJS_EventHandler* pEvent = pContext->GetEventHandler(); |
56 CFX_WideString& wChange = pEvent->Change(); | 56 CFX_WideString& wChange = pEvent->Change(); |
57 if (vp.IsSetting()) { | 57 if (vp.IsSetting()) { |
58 if (vp.GetType() == CJS_Value::VT_string) | 58 if (vp.GetJSValue()->GetType() == CJS_Value::VT_string) |
59 vp >> wChange; | 59 vp >> wChange; |
60 } else { | 60 } else { |
61 vp << wChange; | 61 vp << wChange; |
62 } | 62 } |
63 return TRUE; | 63 return TRUE; |
64 } | 64 } |
65 | 65 |
66 FX_BOOL event::changeEx(IJS_Context* cc, | 66 FX_BOOL event::changeEx(IJS_Context* cc, |
67 CJS_PropValue& vp, | 67 CJS_PropValue& vp, |
68 CFX_WideString& sError) { | 68 CFX_WideString& sError) { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 CJS_Context* pContext = (CJS_Context*)cc; | 315 CJS_Context* pContext = (CJS_Context*)cc; |
316 CJS_EventHandler* pEvent = pContext->GetEventHandler(); | 316 CJS_EventHandler* pEvent = pContext->GetEventHandler(); |
317 | 317 |
318 if (pEvent->WillCommit()) | 318 if (pEvent->WillCommit()) |
319 vp << TRUE; | 319 vp << TRUE; |
320 else | 320 else |
321 vp << FALSE; | 321 vp << FALSE; |
322 return TRUE; | 322 return TRUE; |
323 } | 323 } |
OLD | NEW |